- target/i386: csv: Release CSV3 shared pages after unmapping DMA - target/i386: Add new CPU model ClearwaterForest - target/i386: add sha512, sm3, sm4 feature bits - docs: Add GNR, SRF and CWF CPU models - target/i386: Export BHI_NO bit to guests - target/i386: Introduce SierraForest-v2 model - vdpa/iommufd:Implement DMA mapping through the iommufd interface - vdpa/iommufd:Introduce vdpa-iommufd module - vdpa/iommufd:support associating iommufd backend for vDPA devices - Kconfig/iommufd/VDPA: Update IOMMUFD module configuration dependencies The vDPA module can also use IOMMUFD like the VFIO module. - backends/iommufd: Get rid of qemu_open_old() - backends/iommufd: Make iommufd_backend_*() return bool - backends/iommufd: Fix missing ERRP_GUARD() for error_prepend() - backends/iommufd: Remove mutex - backends/iommufd: Remove check on number of backend users - hw/intc: Add extioi ability of 256 vcpu interrupt routing - hw/rtc: Fixed loongson rtc emulation errors - hw/loongarch/boot: Adjust the loading position of the initrd - target/loongarch: Fix the cpu unplug resource leak - target/loongarch: fix vcpu reset command word issue - vdpa:Fix dirty page bitmap synchronization not done after suspend for vdpa devices Signed-off-by: Jiabo Feng <fengjiabo1@huawei.com> (cherry picked from commit a5212066e7516ff2a316e1b2feaa75dd5ee4d17a)
58 lines
1.8 KiB
Diff
58 lines
1.8 KiB
Diff
From 184e5195a815d57701cd9358f4b0537025729833 Mon Sep 17 00:00:00 2001
|
|
From: libai <libai12@huawei.com>
|
|
Date: Wed, 26 Mar 2025 20:44:40 +0800
|
|
Subject: [PATCH] vdpa/iommufd:support associating iommufd backend for vDPA
|
|
devices
|
|
|
|
The following parameters can associate the iommufd object with the vdpa device:
|
|
|
|
-object iommufd,id=iommufd1
|
|
-device '{
|
|
"driver":"vhost-vdpa-device-pci",
|
|
"id":"vhostdev0",
|
|
"vhostdev":"/dev/vhost-vdpa-1",
|
|
"iommufd":"iommufd1",
|
|
}'
|
|
|
|
Signed-off-by: libai <libai12@huawei.com>
|
|
---
|
|
hw/virtio/vdpa-dev.c | 1 +
|
|
include/hw/virtio/vdpa-dev.h | 2 ++
|
|
2 files changed, 3 insertions(+)
|
|
|
|
diff --git a/hw/virtio/vdpa-dev.c b/hw/virtio/vdpa-dev.c
|
|
index bd787cf39c..9ce7ed7eae 100644
|
|
--- a/hw/virtio/vdpa-dev.c
|
|
+++ b/hw/virtio/vdpa-dev.c
|
|
@@ -356,6 +356,7 @@ static void vhost_vdpa_device_set_status(VirtIODevice *vdev, uint8_t status)
|
|
static Property vhost_vdpa_device_properties[] = {
|
|
DEFINE_PROP_STRING("vhostdev", VhostVdpaDevice, vhostdev),
|
|
DEFINE_PROP_UINT16("queue-size", VhostVdpaDevice, queue_size, 0),
|
|
+ DEFINE_PROP_LINK("iommufd", VhostVdpaDevice, iommufd, TYPE_IOMMUFD_BACKEND, IOMMUFDBackend *),
|
|
DEFINE_PROP_END_OF_LIST(),
|
|
};
|
|
|
|
diff --git a/include/hw/virtio/vdpa-dev.h b/include/hw/virtio/vdpa-dev.h
|
|
index 60e9c3f3fe..accdb7fa28 100644
|
|
--- a/include/hw/virtio/vdpa-dev.h
|
|
+++ b/include/hw/virtio/vdpa-dev.h
|
|
@@ -18,6 +18,7 @@
|
|
#include "hw/virtio/vhost.h"
|
|
#include "hw/virtio/vhost-vdpa.h"
|
|
#include "qom/object.h"
|
|
+#include "sysemu/iommufd.h"
|
|
|
|
|
|
#define TYPE_VHOST_VDPA_DEVICE "vhost-vdpa-device"
|
|
@@ -41,6 +42,7 @@ struct VhostVdpaDevice {
|
|
int (*post_init)(VhostVdpaDevice *v, Error **errp);
|
|
VMChangeStateEntry *vmstate;
|
|
Notifier migration_state;
|
|
+ IOMMUFDBackend *iommufd;
|
|
};
|
|
|
|
#endif
|
|
--
|
|
2.41.0.windows.1
|
|
|