• Juergen Gross's avatar
    platform/x86/dell: add buffer allocation/free functions for SMI calls · 77089467
    Juergen Gross authored
    The dcdbas driver is used to call SMI handlers for both, dcdbas and
    dell-smbios-smm. Both drivers allocate a buffer for communicating
    with the SMI handler. The physical buffer address is then passed to
    the called SMI handler via %ebx.
    
    Unfortunately this doesn't work when running in Xen dom0, as the
    physical address obtained via virt_to_phys() is only a guest physical
    address, and not a machine physical address as needed by SMI.
    
    The problem in dcdbas is easy to correct, as dcdbas is using
    dma_alloc_coherent() for allocating the buffer, and the machine
    physical address is available via the DMA address returned in the DMA
    handle.
    
    In order to avoid duplicating the buffer allocation code in
    dell-smbios-smm, add a generic buffer allocation function to dcdbas
    and use it for both drivers. This is especially fine regarding driver
    dependencies, as dell-smbios-smm is already calling dcdbas to generate
    the SMI request.
    Signed-off-by: default avatarJuergen Gross <jgross@suse.com>
    Link: https://lore.kernel.org/r/20220318150950.16843-1-jgross@suse.comReviewed-by: default avatarHans de Goede <hdegoede@redhat.com>
    Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
    77089467
dell-smbios-smm.c 3.61 KB