-by: Cédric Le Goater
---
hw/vfio/container.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/hw/vfio/container.c b/hw/vfio/container.c
index
afcfe8048805c58291d1104ff0ef20bdc457f99c..f4a0434a5239bfb6a17b91c8879cb98e686afccc
100644
--- a/hw/vfio/container.c
+++ b/hw/vfio
, including the removal of the iommufd backend mutex
* Introduced VFIOIOMMUClass, to avoid compiling spapr when !CONFIG_PSERIES
Avihai Horon (1):
vfio/migration: Add helper function to set state or reset device
Cédric Le Goater (14
.
vfio_init_container() operates on legacy container and setup IOMMU
context with ioctl(VFIO_SET_IOMMU).
So choose to rename vfio_init_container to vfio_set_iommu to avoid
the confusion.
No functional change intended.
Suggested-by: Cédric Le Goater
Signed-off-by: Zhenzhong Duan
Reviewed-by: Cédric Le
This will help subsequent patches to unify the initialization of type1
and sPAPR IOMMU backends.
Reviewed-by: Zhenzhong Duan
Tested-by: Eric Farman
Signed-off-by: Cédric Le Goater
---
hw/vfio/container.c | 63 +
1 file changed, 35 insertions(+), 28
specific to the sPAPR IOMMU.
This allows reuse and provides better abstraction of the backends. It
will be useful to avoid compiling the sPAPR IOMMU backend on targets
not supporting it.
Reviewed-by: Zhenzhong Duan
Tested-by: Eric Farman
Signed-off-by: Cédric Le Goater
---
include/hw/vfio/vfio
Availability of the IOMMUFD backend can now be fully determined at
runtime and the ifdef check was a build time protection (for PPC not
supporting it mostly).
Reviewed-by: Zhenzhong Duan
Tested-by: Eric Farman
Signed-off-by: Cédric Le Goater
---
hw/vfio/common.c | 3 ---
1 file changed, 3
On 1/2/24 13:32, Cédric Le Goater wrote:
Hello !
Coverity has some reports regarding the IOMMUFDBackend mutex. Since
the IOMMUFDBackend routines are called from the QEMU main thread, this
series simply suggests removing the mutex and rely on the BQL to
handle concurrent access.
Thanks,
C
Hello Zhenzhong,
On 1/3/24 02:40, Duan, Zhenzhong wrote:
Hi Cédric,
-Original Message-
From: Cédric Le Goater
Sent: Tuesday, January 2, 2024 8:32 PM
To: qemu-devel@nongnu.org
Cc: Liu, Yi L ; Eric Auger ; Duan,
Zhenzhong ; Cédric Le Goater
Subject: [PATCH 1/2] backends/iommufd
On 1/2/24 17:15, Philippe Mathieu-Daudé wrote:
Hi Cédric,
On 2/1/24 15:55, Cédric Le Goater wrote:
On 12/12/23 17:29, Philippe Mathieu-Daudé wrote:
Hi,
When a MPCore cluster is used, the Cortex-A cores belong the the
cluster container, not to the board/soc layer. This series move
i
Acked-by: Markus Armbruster
Reviewed-by: Philippe Mathieu-Daudé
Reviewed-by: Cédric Le Goater
Thanks,
C.
On 1/2/24 16:35, Stefan Hajnoczi wrote:
The term "iothread lock" is obsolete. The APIs use Big QEMU Lock (BQL)
in their names. Update the code comments to use "BQL" instead of
"iothread lock".
Signed-off-by: Stefan Hajnoczi
Reviewed-by: Philippe Mathieu-Daudé
On 12/12/23 17:29, Philippe Mathieu-Daudé wrote:
Hi,
When a MPCore cluster is used, the Cortex-A cores belong the the
cluster container, not to the board/soc layer. This series move
the creation of vCPUs to the MPCore private container.
Doing so we consolidate the QOM model, moving common code
On 12/12/23 17:29, Philippe Mathieu-Daudé wrote:
TYPE_CORTEX_MPCORE_PRIV becomes the common parent to
TYPE_A9MPCORE_PRIV and TYPE_A15MPCORE_PRIV.
Signed-off-by: Philippe Mathieu-Daudé
Reviewed-by: Cédric Le Goater
Thanks,
C.
On 12/12/23 17:29, Philippe Mathieu-Daudé wrote:
Move the memory region container creation to the abstract QOM
parent. Children set the region size via the class 'container_size'
field.
Signed-off-by: Philippe Mathieu-Daudé
Reviewed-by: Cédric Le Goater
Thanks,
C.
On 12/12/23 17:29, Philippe Mathieu-Daudé wrote:
This type will be common to A9MPCORE/A15MPCORE devices.
Reviewed-by: Cédric Le Goater
Thanks,
C.
On 12/12/23 17:29, Philippe Mathieu-Daudé wrote:
Merge Cortex-A{9,15} MPCore devices in the same header.
Signed-off-by: Philippe Mathieu-Daudé
Reviewed-by: Cédric Le Goater
Thanks,
C.
-by: Cédric Le Goater
Thanks,
C.
On 12/12/23 17:29, Philippe Mathieu-Daudé wrote:
No need to duplicate and forward the 'num-cpu' property from
TYPE_ARM11MPCORE_PRIV to TYPE_REALVIEW_MPCORE, alias it with
QOM object_property_add_alias().
Signed-off-by: Philippe Mathieu-Daudé
Reviewed-by: Cédric Le Goater
Thanks,
C.
-by: Cédric Le Goater
Thanks,
C.
On 12/12/23 17:29, Philippe Mathieu-Daudé wrote:
ARM MPCore Kconfig are defined in hw/arm/Kconfig.
hw/cpu/Kconfig is never used, remove it.
Fixes: 82f5181777 ("kconfig: introduce kconfig files")
Signed-off-by: Philippe Mathieu-Daudé
Reviewed-by: Cédric Le Goater
Thanks,
C.
On 12/12/23 17:29, Philippe Mathieu-Daudé wrote:
The A7MPCore forward the IRQs from its internal GIC.
To make the code clearer, add a 'gic' variable.
Signed-off-by: Philippe Mathieu-Daudé
Reviewed-by: Cédric Le Goater
Thanks,
C.
On 12/12/23 17:29, Philippe Mathieu-Daudé wrote:
The A7MPCore forward the IRQs from its internal GIC.
To make the code clearer, add a 'gic' variable.
Signed-off-by: Philippe Mathieu-Daudé
Reviewed-by: Cédric Le Goater
Thanks,
C.
On 12/12/23 17:29, Philippe Mathieu-Daudé wrote:
The A9MPCore forward the IRQs from its internal GIC.
To make the code clearer, add a 'gic' variable.
Signed-off-by: Philippe Mathieu-Daudé
Reviewed-by: Cédric Le Goater
Thanks,
C.
On 12/12/23 17:29, Philippe Mathieu-Daudé wrote:
In heterogeneous setup the first vCPU might not be
the one expected, better pass it explicitly.
Signed-off-by: Philippe Mathieu-Daudé
Reviewed-by: Cédric Le Goater
Thanks,
C.
BQL lock and it should be safe to drop the IOMMUFD backend mutex.
Simply remove it.
Fixes: CID 1531550
Fixes: CID 1531549
Signed-off-by: Cédric Le Goater
---
include/sysemu/iommufd.h | 2 --
backends/iommufd.c | 7 ---
2 files changed, 9 deletions(-)
diff --git a/include/sysemu/iommuf
Hello !
Coverity has some reports regarding the IOMMUFDBackend mutex. Since
the IOMMUFDBackend routines are called from the QEMU main thread, this
series simply suggests removing the mutex and rely on the BQL to
handle concurrent access.
Thanks,
C.
Cédric Le Goater (2):
backends/iommufd
QOM already has a ref count on objects and it will assert much
earlier, when INT_MAX is reached.
Signed-off-by: Cédric Le Goater
---
backends/iommufd.c | 5 -
1 file changed, 5 deletions(-)
diff --git a/backends/iommufd.c b/backends/iommufd.c
index
ba58a0eb0d0ba9aae625c987eb728547543dba66
On 12/31/23 11:48, Avihai Horon wrote:
There are several places where failure in setting the device state leads
to a device reset, which is done by setting ERROR as the recover state.
Add a helper function that sets the device state and resets the device
in case of failure. This will make the
the code cleaner and remove duplicate
comments.
Signed-off-by: Avihai Horon
Reviewed-by: Cédric Le Goater
Thanks,
C.
], replace basename() with g_path_get_basename().
[1]: https://lore.kernel.org/all/20231212010228.2701544-1-raj.k...@gmail.com/
Suggested-by: Cédric Le Goater
Signed-off-by: Zhao Liu
Reviewed-by: Cédric Le Goater
Thanks,
C.
---
Suggested by credit:
Cédric: Referred his description
g argument.
Replace dirname() with g_path_get_dirname().
Suggested-by: Cédric Le Goater
Signed-off-by: Zhao Liu
Reviewed-by: Cédric Le Goater
Thanks,
C.
---
Suggested by credit:
Cédric: Referred his words for g_path_get_basename() and
g_path_get_dirname() has the same advantage
'VFIOContainerBase *' ops.
vfio_init_container() operates on legacy container and setup IOMMU
context with ioctl(VFIO_SET_IOMMU).
So choose to rename vfio_init_container to vfio_set_iommu to avoid
the confusion.
No functional change intended.
Suggested-by: Cédric Le Goater
Signed-off-by: Zhenzhong Duan
On 12/21/23 09:09, Cédric Le Goater wrote:
Using stat() before opening a file or a directory can lead to a
time-of-check to time-of-use (TOCTOU) filesystem race, which is
reported by coverity as a Security best practices violations. The
sequence could be replaced by open and fdopendir
On 1/2/24 05:27, Duan, Zhenzhong wrote:
-Original Message-
From: Volker Rümelin
Subject: [PATCH] hw/vfio: fix iteration over global VFIODevice list
Commit 3d779abafe ("vfio/common: Introduce a global VFIODevice list")
introduced a global VFIODevice list, but forgot to update the
ld.
Fixes: 3d779abafe ("vfio/common: Introduce a global VFIODevice list")
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2061
Signed-off-by: Volker Rümelin
Reviewed-by: Cédric Le Goater
Thanks,
C.
---
hw/vfio/common.c | 8
1 file changed, 4 insertions(+), 4 dele
On 12/22/23 11:09, Eric Auger wrote:
Hi Cédric,
On 12/21/23 22:23, Cédric Le Goater wrote:
On 12/21/23 18:14, Eric Auger wrote:
Hi Cédric,
On 12/21/23 17:00, Cédric Le Goater wrote:
[ ... ]
+static void iommufd_backend_init(Object *obj)
+{
+ IOMMUFDBackend *be = IOMMUFD_BACKEND(obj
On 12/21/23 18:14, Eric Auger wrote:
Hi Cédric,
On 12/21/23 17:00, Cédric Le Goater wrote:
[ ... ]
+static void iommufd_backend_init(Object *obj)
+{
+ IOMMUFDBackend *be = IOMMUFD_BACKEND(obj);
+
+ be->fd = -1;
+ be->users = 0;
+ be->owned = true;
+ qemu_mutex_i
[ ... ]
+static void iommufd_backend_init(Object *obj)
+{
+IOMMUFDBackend *be = IOMMUFD_BACKEND(obj);
+
+be->fd = -1;
+be->users = 0;
+be->owned = true;
+qemu_mutex_init(>lock);> +}
+
+static void iommufd_backend_finalize(Object *obj)
+{
+IOMMUFDBackend *be =
Hello Zhenzhong
On 12/21/23 09:55, Duan, Zhenzhong wrote:
-Original Message-
From: Cédric Le Goater
Sent: Thursday, December 21, 2023 4:10 PM
Subject: [PATCH] vfio/iommufd: Remove the use of stat() to check file
existence
Using stat() before opening a file or a directory can lead
'VFIOContainerBase *' ops.
vfio_init_container() operates on legacy container and setup IOMMU
context with ioctl(VFIO_SET_IOMMU).
So choose to rename vfio_init_container to vfio_set_iommu to avoid
the confusion.
No functional change intended.
Suggested-by: Cédric Le Goater
Signed-off-by: Zhenzhong Duan
On 12/21/23 04:16, Richard Henderson wrote:
Signed-off-by: Richard Henderson
Reviewed-by: Cédric Le Goater
I suppose you will include the patch in :
https://lore.kernel.org/qemu-devel/20231221031652.119827-1-richard.hender...@linaro.org/
Thanks,
C.
---
hw/vfio/display.c | 2
opendir to avoid the race.
Fixes: CID 1531551
Signed-off-by: Cédric Le Goater
---
hw/vfio/iommufd.c | 6 --
1 file changed, 6 deletions(-)
diff --git a/hw/vfio/iommufd.c b/hw/vfio/iommufd.c
index
d4c586e842def8f04d3a914843f5eece2c75ea30..9bfddc1360895413176a9f170e29e89027384a66
100644
--- a/hw
On 12/20/23 21:35, Eric Farman wrote:
On Tue, 2023-12-19 at 07:58 +0100, Cédric Le Goater wrote:
Hello,
The VFIO object hierarchy has some constraints because each VFIO type
has a dual nature: a VFIO nature for passthrough support and a bus
nature (PCI, AP, CCW, Platform) for its initial
Hello,
On 12/20/23 16:09, Zhao Liu wrote:
Hi Cédric,
On Wed, Dec 20, 2023 at 02:53:02PM +0100, Cédric Le Goater wrote:
Date: Wed, 20 Dec 2023 14:53:02 +0100
From: Cédric Le Goater
Subject: [PATCH] vfio/container: Replace basename with g_path_get_basename
X-Mailer: git-send-email 2.43.0
On 12/20/23 14:53, Cédric Le Goater wrote:
g_path_get_basename() is a portable utility function that has the
advantage of not modifing the string argument. It also fixes a compile
breakage with the Musl C library reported in [1].
[1] https://lore.kernel.org/all/20231212010228.2701544-1-raj.k
On 12/19/23 07:58, Cédric Le Goater wrote:
Hello,
The VFIO object hierarchy has some constraints because each VFIO type
has a dual nature: a VFIO nature for passthrough support and a bus
nature (PCI, AP, CCW, Platform) for its initial presentation. It
seemed the best approach made because multi
-off-by: Cédric Le Goater
---
hw/vfio/container.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/hw/vfio/container.c b/hw/vfio/container.c
index
688cf23bab88f85246378bc5a7da3c51ea6b79d9..8d334f52f2438d05f632502e07ffd4dc2ec76cb5
100644
--- a/hw/vfio/container.c
+++ b/hw
From: Eric Auger
No functional change intended.
Signed-off-by: Eric Auger
Signed-off-by: Yi Liu
Signed-off-by: Yi Sun
Signed-off-by: Zhenzhong Duan
Reviewed-by: Cédric Le Goater
Signed-off-by: Cédric Le Goater
---
include/hw/vfio/vfio-common.h | 4 ---
include/hw/vfio/vfio
From: Zhenzhong Duan
Some of the VFIODevice initializations is in vfio_ccw_realize,
move all of them in vfio_ccw_instance_init.
No functional change intended.
Suggested-by: Cédric Le Goater
Signed-off-by: Zhenzhong Duan
Reviewed-by: Philippe Mathieu-Daudé
Reviewed-by: Eric Farman
Tested
Goater
Reviewed-by: Eric Farman
Tested-by: Nicolin Chen
Signed-off-by: Cédric Le Goater
---
hw/vfio/ccw.c | 25 ++---
1 file changed, 22 insertions(+), 3 deletions(-)
diff --git a/hw/vfio/ccw.c b/hw/vfio/ccw.c
index
d2d58bb677cfad38a6965ea6a43783256407207b
Suggested-by: Alex Williamson
Signed-off-by: Eric Auger
Signed-off-by: Yi Liu
Signed-off-by: Zhenzhong Duan
Reviewed-by: Cédric Le Goater
Tested-by: Eric Auger
Tested-by: Nicolin Chen
Signed-off-by: Cédric Le Goater
---
hw/vfio/pci.c | 6 ++
1 file changed, 6 insertions(+)
diff --git a/hw
From: Zhenzhong Duan
Implement the newly introduced pci_hot_reset callback named
iommufd_cdev_pci_hot_reset to do iommufd specific check and
reset operation.
Signed-off-by: Zhenzhong Duan
Reviewed-by: Eric Auger
Tested-by: Eric Auger
Tested-by: Nicolin Chen
Signed-off-by: Cédric Le Goater
Cédric Le Goater
Tested-by: Eric Auger
Tested-by: Nicolin Chen
Signed-off-by: Cédric Le Goater
---
include/hw/vfio/vfio-common.h | 4
hw/vfio/helpers.c | 43 +++
hw/vfio/iommufd.c | 12 ++
hw/vfio/pci.c
From: Zhenzhong Duan
Suggested-by: Cédric Le Goater
Signed-off-by: Eric Auger
Signed-off-by: Yi Liu
Signed-off-by: Zhenzhong Duan
Tested-by: Nicolin Chen
Signed-off-by: Cédric Le Goater
---
MAINTAINERS| 1 +
docs/devel/index-internals.rst | 1 +
docs/devel/vfio
Signed-off-by: Cédric Le Goater
Signed-off-by: Zhenzhong Duan
Reviewed-by: Matthew Rosato
Reviewed-by: Eric Farman
Tested-by: Nicolin Chen
Signed-off-by: Cédric Le Goater
---
hw/s390x/Kconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/hw/s390x/Kconfig b/hw/s390x/Kconfig
index
From: Zhenzhong Duan
No functional change intended.
Signed-off-by: Zhenzhong Duan
Reviewed-by: Cédric Le Goater
---
include/hw/vfio/vfio-common.h | 5 -
include/hw/vfio/vfio-container-base.h | 5 +
hw/vfio/common.c | 8 ++--
hw/vfio/container
From: Zhenzhong Duan
Some of the VFIODevice initializations is in vfio_realize,
move all of them in vfio_instance_init.
No functional change intended.
Suggested-by: Cédric Le Goater
Signed-off-by: Zhenzhong Duan
Reviewed-by: Philippe Mathieu-Daudé
Tested-by: Nicolin Chen
Signed-off
backend, if this fails, fallback to
64bit IOVA range.
Also use out_iova_alignment returned from uAPI as pgsizes instead of
qemu_real_host_page_size() as a fallback.
Signed-off-by: Zhenzhong Duan
Reviewed-by: Cédric Le Goater
Reviewed-by: Eric Auger
Tested-by: Eric Auger
Tested-by: Nicolin Chen
From: Zhenzhong Duan
Some of the VFIODevice initializations is in vfio_ap_realize,
move all of them in vfio_ap_instance_init.
No functional change intended.
Suggested-by: Cédric Le Goater
Signed-off-by: Zhenzhong Duan
Reviewed-by: Philippe Mathieu-Daudé
Reviewed-by: Eric Farman
Tested
From: Zhenzhong Duan
No functional changes intended.
Signed-off-by: Zhenzhong Duan
Reviewed-by: Cédric Le Goater
Signed-off-by: Cédric Le Goater
---
include/hw/vfio/vfio-common.h | 1 -
hw/vfio/spapr.c | 24
2 files changed, 16 insertions(+), 9
From: Zhenzhong Duan
This helper will be used by both legacy and iommufd backends.
No functional changes intended.
Signed-off-by: Zhenzhong Duan
Reviewed-by: Cédric Le Goater
Reviewed-by: Eric Auger
Tested-by: Eric Auger
Tested-by: Nicolin Chen
Signed-off-by: Cédric Le Goater
---
hw
From: Zhenzhong Duan
This is a trivial optimization. If there is active container in space,
vfio_reset_handler will never be unregistered. So revert the check of
space->containers and return early.
Signed-off-by: Zhenzhong Duan
Reviewed-by: Cédric Le Goater
Reviewed-by: Eric Auger
Tes
From: Zhenzhong Duan
This empty VFIOIOMMUOps named vfio_legacy_ops will hold all general
IOMMU ops of legacy container.
Signed-off-by: Zhenzhong Duan
Reviewed-by: Cédric Le Goater
Signed-off-by: Cédric Le Goater
---
include/hw/vfio/vfio-common.h | 2 +-
hw/vfio/container.c | 5
From: Eric Auger
No functional change intended.
Signed-off-by: Eric Auger
Signed-off-by: Yi Liu
Signed-off-by: Yi Sun
Signed-off-by: Zhenzhong Duan
Reviewed-by: Cédric Le Goater
Signed-off-by: Cédric Le Goater
---
hw/vfio/common.c| 16
hw/vfio/container.c | 12
Duan
Signed-off-by: Cédric Le Goater
---
hw/ppc/spapr_pci_vfio.c | 36
hw/ppc/Kconfig | 2 +-
2 files changed, 37 insertions(+), 1 deletion(-)
diff --git a/hw/ppc/spapr_pci_vfio.c b/hw/ppc/spapr_pci_vfio.c
index
From: Zhenzhong Duan
This gives management tools like libvirt a chance to open the vfio
cdev with privilege and pass FD to qemu. This way qemu never needs
to have privilege to open a VFIO or iommu cdev node.
Signed-off-by: Zhenzhong Duan
Reviewed-by: Cédric Le Goater
Tested-by: Nicolin Chen
vfio_get_dirty_bitmap
Signed-off-by: Eric Auger
Signed-off-by: Zhenzhong Duan
Reviewed-by: Cédric Le Goater
Signed-off-by: Cédric Le Goater
---
include/hw/vfio/vfio-common.h | 9
hw/vfio/common.c | 42 +++
hw/vfio/container.c | 6
From: Yi Liu
/dev/vfio/devices/vfioX may not exist. In that case it is still possible
to open /dev/char/$major:$minor instead. Add helper function to abstract
the cdev open.
Suggested-by: Jason Gunthorpe
Signed-off-by: Yi Liu
Signed-off-by: Zhenzhong Duan
Reviewed-by: Cédric Le Goater
From: Zhenzhong Duan
Introduce a helper function to replace the common code to initialize
VFIODevice in pci, platform, ap and ccw VFIO device.
No functional change intended.
Suggested-by: Cédric Le Goater
Signed-off-by: Zhenzhong Duan
Tested-by: Nicolin Chen
Signed-off-by: Cédric Le Goater
From: Zhenzhong Duan
VFIO Device is also changed to point to base container instead of
legacy container.
No functional change intended.
Signed-off-by: Zhenzhong Duan
Reviewed-by: Cédric Le Goater
Signed-off-by: Cédric Le Goater
---
include/hw/vfio/vfio-common.h | 3 +--
include/hw
Signed-off-by: Cédric Le Goater
Signed-off-by: Zhenzhong Duan
Reviewed-by: Eric Auger
Tested-by: Eric Auger
Tested-by: Nicolin Chen
Signed-off-by: Cédric Le Goater
---
hw/arm/Kconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig
index
callbacks also need same changes to avoid
build error.
Suggested-by: Cédric Le Goater
Signed-off-by: Zhenzhong Duan
Reviewed-by: Cédric Le Goater
Reviewed-by: Eric Auger
Tested-by: Eric Auger
Tested-by: Nicolin Chen
Signed-off-by: Cédric Le Goater
---
include/hw/vfio/vfio-common.h
From: Zhenzhong Duan
Some of the VFIODevice initializations is in vfio_platform_realize,
move all of them in vfio_platform_instance_init.
No functional change intended.
Suggested-by: Cédric Le Goater
Signed-off-by: Zhenzhong Duan
Reviewed-by: Philippe Mathieu-Daudé
Tested-by: Nicolin Chen
Signed-off-by: Cédric Le Goater
Signed-off-by: Zhenzhong Duan
Reviewed-by: Eric Auger
Tested-by: Nicolin Chen
Signed-off-by: Cédric Le Goater
---
hw/i386/Kconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/hw/i386/Kconfig b/hw/i386/Kconfig
index
From: Eric Auger
Move listener to base container. Also error and initialized fields
are moved at the same time.
No functional change intended.
Signed-off-by: Eric Auger
Signed-off-by: Yi Liu
Signed-off-by: Yi Sun
Signed-off-by: Zhenzhong Duan
Reviewed-by: Cédric Le Goater
Signed-off
=iommufd0
Suggested-by: Alex Williamson
Signed-off-by: Zhenzhong Duan
Reviewed-by: Cédric Le Goater
Reviewed-by: Eric Auger
Tested-by: Nicolin Chen
Signed-off-by: Cédric Le Goater
---
hw/vfio/platform.c | 6 ++
1 file changed, 6 insertions(+)
diff --git a/hw/vfio/platform.c b/hw/vfio
From: Eric Auger
Move the giommu_list field in the base container and store
the base container in the VFIOGuestIOMMU.
No functional change intended.
Signed-off-by: Eric Auger
Signed-off-by: Yi Liu
Signed-off-by: Yi Sun
Signed-off-by: Zhenzhong Duan
Reviewed-by: Cédric Le Goater
Signed-off
/mdev/devices/XXX,iommufd=iommufd0
Suggested-by: Alex Williamson
Signed-off-by: Zhenzhong Duan
Reviewed-by: Matthew Rosato
Reviewed-by: Cédric Le Goater
Reviewed-by: Eric Farman
Tested-by: Nicolin Chen
Signed-off-by: Cédric Le Goater
---
hw/vfio/ccw.c | 6 ++
1 file changed, 6 insertions
to vfio_legacy_pci_hot_reset and move it
into container.c.
vfio_pci_[pre/post]_reset and vfio_pci_host_match are exported so
they could be called in legacy and iommufd pci_hot_reset callback.
Suggested-by: Cédric Le Goater
Signed-off-by: Zhenzhong Duan
Reviewed-by: Eric Auger
Tested-by: Eric Auger
Tested-by: Nicolin
/devices/XXX,iommufd=iommufd0
Suggested-by: Alex Williamson
Signed-off-by: Zhenzhong Duan
Reviewed-by: Matthew Rosato
Reviewed-by: Cédric Le Goater
Tested-by: Nicolin Chen
Signed-off-by: Cédric Le Goater
---
hw/vfio/ap.c | 6 ++
1 file changed, 6 insertions(+)
diff --git a/hw/vfio/ap.c b/hw
From: Eric Auger
No functional change intended.
Signed-off-by: Eric Auger
Signed-off-by: Yi Liu
Signed-off-by: Yi Sun
Signed-off-by: Zhenzhong Duan
Reviewed-by: Cédric Le Goater
Signed-off-by: Cédric Le Goater
---
include/hw/vfio/vfio-common.h | 2 --
include/hw/vfio/vfio
-by: Cédric Le Goater
Tested-by: Eric Auger
Tested-by: Nicolin Chen
Signed-off-by: Cédric Le Goater
---
include/hw/vfio/vfio-common.h | 11 +
hw/vfio/common.c | 6 +
hw/vfio/iommufd.c | 422 ++
hw/vfio/meson.build | 3 +
hw
it to bcontainer->ops.
Signed-off-by: Zhenzhong Duan
Reviewed-by: Cédric Le Goater
Signed-off-by: Cédric Le Goater
---
include/hw/vfio/vfio-container-base.h | 6 ++
hw/vfio/spapr.c | 14 ++
2 files changed, 20 insertions(+)
diff --git a/include/hw/vfio/v
Duan
Reviewed-by: Cédric Le Goater
Tested-by: Eric Auger
Tested-by: Nicolin Chen
Signed-off-by: Cédric Le Goater
---
MAINTAINERS | 8 ++
qapi/qom.json| 19 +++
include/sysemu/iommufd.h | 38 ++
backends/iommufd.c | 245
Goater
Tested-by: Nicolin Chen
Signed-off-by: Cédric Le Goater
---
hw/vfio/ap.c | 23 ++-
1 file changed, 22 insertions(+), 1 deletion(-)
diff --git a/hw/vfio/ap.c b/hw/vfio/ap.c
index
80629609aebbff9156f78c9bbde5dc6c293ac84e..f180e4a32aa00f391f02e49b6c1bc2e8ebd2fecb
100644
page sync isn't supported, query_dirty_bitmap will
never be called.
Suggested-by: Cédric Le Goater
Signed-off-by: Zhenzhong Duan
Reviewed-by: Cédric Le Goater
Reviewed-by: Eric Auger
Tested-by: Eric Auger
Tested-by: Nicolin Chen
Signed-off-by: Cédric Le Goater
---
hw/vfio/container-base.c | 4
.
No functional change intended.
Signed-off-by: Eric Auger
Signed-off-by: Yi Liu
Signed-off-by: Yi Sun
Signed-off-by: Zhenzhong Duan
Reviewed-by: Cédric Le Goater
Signed-off-by: Cédric Le Goater
---
include/hw/vfio/vfio-common.h | 8 ++---
include/hw/vfio/vfio-container-base.h | 50
From: Zhenzhong Duan
This adds two helper functions vfio_container_init/destroy which will be
used by both legacy and iommufd containers to do base container specific
initialization and release.
No functional change intended.
Suggested-by: Cédric Le Goater
Signed-off-by: Zhenzhong Duan
backend for ARM, x86_64 and s390x platforms
Cédric Le Goater (4):
hw/arm: Activate IOMMUFD for virt machines
kconfig: Activate IOMMUFD for s390x machines
hw/i386: Activate IOMMUFD for q35 machines
hw/ppc/Kconfig
From: Zhenzhong Duan
No functional changes intended.
Signed-off-by: Zhenzhong Duan
Reviewed-by: Cédric Le Goater
Signed-off-by: Cédric Le Goater
---
include/hw/vfio/vfio-common.h | 1 -
hw/vfio/spapr.c | 36 +++
2 files changed, 20 insertions
From: Eric Auger
Move the space field to the base object. Also the VFIOAddressSpace
now contains a list of base containers.
No functional change intended.
Signed-off-by: Eric Auger
Signed-off-by: Yi Liu
Signed-off-by: Yi Sun
Signed-off-by: Zhenzhong Duan
Reviewed-by: Cédric Le Goater
From: Zhenzhong Duan
Meanwhile remove the helper function vfio_free_container as it
only calls g_free now.
No functional change intended.
Signed-off-by: Zhenzhong Duan
Reviewed-by: Cédric Le Goater
Signed-off-by: Cédric Le Goater
---
include/hw/vfio/vfio-common.h | 1 -
include/hw
From: Eric Auger
No functional change intended.
Signed-off-by: Eric Auger
Signed-off-by: Yi Liu
Signed-off-by: Yi Sun
Signed-off-by: Zhenzhong Duan
Reviewed-by: Cédric Le Goater
Signed-off-by: Cédric Le Goater
---
include/hw/vfio/vfio-common.h | 2 --
include/hw/vfio/vfio
From: Eric Auger
dirty_pages_supported field is also moved to the base container
No functional change intended.
Signed-off-by: Eric Auger
Signed-off-by: Yi Liu
Signed-off-by: Yi Sun
Signed-off-by: Zhenzhong Duan
Reviewed-by: Cédric Le Goater
Signed-off-by: Cédric Le Goater
---
include
From: Zhenzhong Duan
No functional change intended.
Signed-off-by: Zhenzhong Duan
Reviewed-by: Cédric Le Goater
Signed-off-by: Cédric Le Goater
---
include/hw/vfio/vfio-common.h | 11
include/hw/vfio/vfio-container-base.h | 11
hw/vfio/common.c
Convert the legacy VFIOIOMMUOps struct to the new VFIOIOMMU QOM
interface. The set of of operations for this backend can be referenced
with a literal typename instead of a C struct. This will simplify
support of multiple backends.
Reviewed-by: Zhenzhong Duan
Signed-off-by: Cédric Le Goater
not needing it. This saves some text in QEMU.
Applies on vfio-next.
Thanks,
C.
Changes in v2:
- Removed superfluous define and struct definitions
- Improved comments and commit log
- Removed NULL initialization of vioc
- Removed class_size initialization
Cédric Le Goater (10):
vfio/spapr
specific to the sPAPR IOMMU.
This allows reuse and provides better abstraction of the backends. It
will be useful to avoid compiling the sPAPR IOMMU backend on targets
not supporting it.
Reviewed-by: Zhenzhong Duan
Signed-off-by: Cédric Le Goater
---
v2: - Removed class_size initialization
This allows to abstract a bit more the sPAPR IOMMU support in the
legacy IOMMU backend.
Reviewed-by: Zhenzhong Duan
Signed-off-by: Cédric Le Goater
---
include/hw/vfio/vfio-container-base.h | 1 +
hw/vfio/container.c | 10 +++-
hw/vfio/spapr.c | 35
This will help subsequent patches to unify the initialization of type1
and sPAPR IOMMU backends.
Reviewed-by: Zhenzhong Duan
Signed-off-by: Cédric Le Goater
---
hw/vfio/container.c | 63 +
1 file changed, 35 insertions(+), 28 deletions(-)
diff --git
601 - 700 of 9210 matches
Mail list logo