qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] vhost-vdpa: skip TPM CRB memory section
@ 2022-11-22 14:53 marcandre.lureau
  2022-11-22 15:18 ` [PATCH-for-7.2] " Philippe Mathieu-Daudé
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: marcandre.lureau @ 2022-11-22 14:53 UTC (permalink / raw)
  To: qemu-devel
  Cc: eperezma, eric.auger, Marc-André Lureau, Michael S. Tsirkin

From: Marc-André Lureau <marcandre.lureau@redhat.com>

851d6d1a0f ("vfio/common: remove spurious tpm-crb-cmd misalignment
warning") removed the warning on vfio_listener_region_add() path.

An error is reported for vhost-vdpa case:
qemu-kvm: vhost_vdpa_listener_region_add received unaligned region

Skip the CRB device.

Fixes:
https://bugzilla.redhat.com/show_bug.cgi?id=2141965

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 hw/virtio/vhost-vdpa.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c
index 7468e44b87..9d7206e4b8 100644
--- a/hw/virtio/vhost-vdpa.c
+++ b/hw/virtio/vhost-vdpa.c
@@ -19,6 +19,7 @@
 #include "hw/virtio/virtio-net.h"
 #include "hw/virtio/vhost-shadow-virtqueue.h"
 #include "hw/virtio/vhost-vdpa.h"
+#include "sysemu/tpm.h"
 #include "exec/address-spaces.h"
 #include "migration/blocker.h"
 #include "qemu/cutils.h"
@@ -46,6 +47,11 @@ static bool vhost_vdpa_listener_skipped_section(MemoryRegionSection *section,
 {
     Int128 llend;
 
+    if (TPM_IS_CRB(section->mr->owner)) {
+        /* The CRB command buffer has its base address unaligned. */
+        return true;
+    }
+
     if ((!memory_region_is_ram(section->mr) &&
          !memory_region_is_iommu(section->mr)) ||
         memory_region_is_protected(section->mr) ||
-- 
2.38.1



^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2022-11-23 13:31 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-22 14:53 [PATCH] vhost-vdpa: skip TPM CRB memory section marcandre.lureau
2022-11-22 15:18 ` [PATCH-for-7.2] " Philippe Mathieu-Daudé
2022-11-22 16:05 ` [PATCH] " Eric Auger
2022-11-22 16:49 ` Eugenio Perez Martin
2022-11-23  4:25   ` Jason Wang
2022-11-22 20:32 ` Michael S. Tsirkin
2022-11-23  7:20   ` Marc-André Lureau
2022-11-23  7:23     ` Michael S. Tsirkin
2022-11-23 11:25       ` Philippe Mathieu-Daudé
2022-11-23 12:20         ` Michael S. Tsirkin
2022-11-23 13:30         ` Michael S. Tsirkin
2022-11-23  7:31     ` Eugenio Perez Martin
2022-11-23  9:37       ` Michael S. Tsirkin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).