OSDN Git Service

vfio/common: remove spurious tpm-crb-cmd misalignment warning
authorEric Auger <eric.auger@redhat.com>
Fri, 6 May 2022 13:25:10 +0000 (15:25 +0200)
committerAlex Williamson <alex.williamson@redhat.com>
Fri, 6 May 2022 15:06:50 +0000 (09:06 -0600)
commit851d6d1a0ff29a87ec588205842edf6b86d99b5c
tree821f1bc56799f28b62c18ef6e3855923d51cd21f
parent4168cdad398843ed53d650a27651868b4d3e21c9
vfio/common: remove spurious tpm-crb-cmd misalignment warning

The CRB command buffer currently is a RAM MemoryRegion and given
its base address alignment, it causes an error report on
vfio_listener_region_add(). This region could have been a RAM device
region, easing the detection of such safe situation but this option
was not well received. So let's add a helper function that uses the
memory region owner type to detect the situation is safe wrt
the assignment. Other device types can be checked here if such kind
of problem occurs again.

Signed-off-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Acked-by: Stefan Berger <stefanb@linux.ibm.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Link: https://lore.kernel.org/r/20220506132510.1847942-3-eric.auger@redhat.com
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
hw/vfio/common.c
hw/vfio/trace-events