Skip to content
  • Eric Auger's avatar
    vfio: Use a trace point when a RAM section cannot be DMA mapped · 5c086005
    Eric Auger authored
    Commit 567b5b30 ("vfio/pci: Relax DMA map errors for MMIO regions")
    added an error message if a passed memory section address or size
    is not aligned to the page size and thus cannot be DMA mapped.
    
    This patch fixes the trace by printing the region name and the
    memory region section offset within the address space (instead of
    offset_within_region).
    
    We also turn the error_report into a trace event. Indeed, In some
    cases, the traces can be confusing to non expert end-users and
    let think the use case does not work (whereas it works as before).
    
    This is the case where a BAR is successively mapped at different
    GPAs and its sections are not compatible with dma map. The listener
    is called several times and traces are issued for each intermediate
    mapping.  The end-user cannot easily match those GPAs against the
    final GPA output by lscpi. So let's keep those information to
    informed users. In mid term, the plan is to advise the user about
    BAR relocation relevance.
    
    Fixes: 567b5b30
    
     ("vfio/pci: Relax DMA map errors for MMIO regions")
    Signed-off-by: default avatarEric Auger <eric.auger@redhat.com>
    Reviewed-by: default avatarPhilippe Mathieu-Daudé <f4bug@amsat.org>
    Reviewed-by: default avatarAlexey Kardashevskiy <aik@ozlabs.ru>
    Signed-off-by: default avatarAlex Williamson <alex.williamson@redhat.com>
    5c086005