* [PATCH 00/14] hw/vfio: Build various objects once
@ 2025-03-07 18:03 Philippe Mathieu-Daudé
2025-03-07 18:03 ` [PATCH 01/14] hw/vfio/common: Include missing 'system/tcg.h' header Philippe Mathieu-Daudé
` (14 more replies)
0 siblings, 15 replies; 57+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-03-07 18:03 UTC (permalink / raw)
To: qemu-devel
Cc: Alex Williamson, Igor Mammedov, qemu-ppc, Thomas Huth,
Richard Henderson, Tony Krowiak, Ilya Leoshkevich,
Philippe Mathieu-Daudé, kvm, Yi Liu, Paolo Bonzini,
Zhenzhong Duan, Matthew Rosato, Eric Farman, Peter Xu,
Pierrick Bouvier, Daniel Henrique Barboza, Eric Auger, qemu-s390x,
Jason Herne, Cédric Le Goater, David Hildenbrand,
Alex Bennée, Harsh Prateek Bora, Nicholas Piggin,
Halil Pasic, Christian Borntraeger
By doing the following changes:
- Clean some headers up
- Replace compile-time CONFIG_KVM check by kvm_enabled()
- Replace compile-time CONFIG_IOMMUFD check by iommufd_builtin()
we can build less vfio objects.
Philippe Mathieu-Daudé (14):
hw/vfio/common: Include missing 'system/tcg.h' header
hw/vfio/spapr: Do not include <linux/kvm.h>
hw/vfio: Compile some common objects once
hw/vfio: Compile more objects once
hw/vfio: Compile iommufd.c once
system: Declare qemu_[min/max]rampagesize() in 'system/hostmem.h'
hw/vfio: Compile display.c once
system/kvm: Expose kvm_irqchip_[add,remove]_change_notifier()
hw/vfio/pci: Convert CONFIG_KVM check to runtime one
system/iommufd: Introduce iommufd_builtin() helper
hw/vfio/pci: Check CONFIG_IOMMUFD at runtime using iommufd_builtin()
hw/vfio/ap: Check CONFIG_IOMMUFD at runtime using iommufd_builtin()
hw/vfio/ccw: Check CONFIG_IOMMUFD at runtime using iommufd_builtin()
hw/vfio/platform: Check CONFIG_IOMMUFD at runtime using
iommufd_builtin
docs/devel/vfio-iommufd.rst | 2 +-
include/exec/ram_addr.h | 3 --
include/system/hostmem.h | 3 ++
include/system/iommufd.h | 8 +++++
include/system/kvm.h | 8 ++---
target/s390x/kvm/kvm_s390x.h | 2 +-
accel/stubs/kvm-stub.c | 12 ++++++++
hw/ppc/spapr_caps.c | 1 +
hw/s390x/s390-virtio-ccw.c | 1 +
hw/vfio/ap.c | 27 ++++++++---------
hw/vfio/ccw.c | 27 ++++++++---------
hw/vfio/common.c | 1 +
hw/vfio/iommufd.c | 1 -
hw/vfio/migration.c | 1 -
hw/vfio/pci.c | 57 +++++++++++++++++-------------------
hw/vfio/platform.c | 25 ++++++++--------
hw/vfio/spapr.c | 4 +--
hw/vfio/meson.build | 33 ++++++++++++---------
18 files changed, 117 insertions(+), 99 deletions(-)
--
2.47.1
^ permalink raw reply [flat|nested] 57+ messages in thread
* [PATCH 01/14] hw/vfio/common: Include missing 'system/tcg.h' header
2025-03-07 18:03 [PATCH 00/14] hw/vfio: Build various objects once Philippe Mathieu-Daudé
@ 2025-03-07 18:03 ` Philippe Mathieu-Daudé
2025-03-07 19:14 ` Pierrick Bouvier
` (2 more replies)
2025-03-07 18:03 ` [PATCH 02/14] hw/vfio/spapr: Do not include <linux/kvm.h> Philippe Mathieu-Daudé
` (13 subsequent siblings)
14 siblings, 3 replies; 57+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-03-07 18:03 UTC (permalink / raw)
To: qemu-devel
Cc: Alex Williamson, Igor Mammedov, qemu-ppc, Thomas Huth,
Richard Henderson, Tony Krowiak, Ilya Leoshkevich,
Philippe Mathieu-Daudé, kvm, Yi Liu, Paolo Bonzini,
Zhenzhong Duan, Matthew Rosato, Eric Farman, Peter Xu,
Pierrick Bouvier, Daniel Henrique Barboza, Eric Auger, qemu-s390x,
Jason Herne, Cédric Le Goater, David Hildenbrand,
Alex Bennée, Harsh Prateek Bora, Nicholas Piggin,
Halil Pasic, Christian Borntraeger
Always include necessary headers explicitly, to avoid
when refactoring unrelated ones:
hw/vfio/common.c:1176:45: error: implicit declaration of function ‘tcg_enabled’;
1176 | tcg_enabled() ? DIRTY_CLIENTS_ALL :
| ^~~~~~~~~~~
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/vfio/common.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/hw/vfio/common.c b/hw/vfio/common.c
index 7a4010ef4ee..b1596b6bf64 100644
--- a/hw/vfio/common.c
+++ b/hw/vfio/common.c
@@ -42,6 +42,7 @@
#include "migration/misc.h"
#include "migration/blocker.h"
#include "migration/qemu-file.h"
+#include "system/tcg.h"
#include "system/tpm.h"
VFIODeviceList vfio_device_list =
--
2.47.1
^ permalink raw reply related [flat|nested] 57+ messages in thread
* [PATCH 02/14] hw/vfio/spapr: Do not include <linux/kvm.h>
2025-03-07 18:03 [PATCH 00/14] hw/vfio: Build various objects once Philippe Mathieu-Daudé
2025-03-07 18:03 ` [PATCH 01/14] hw/vfio/common: Include missing 'system/tcg.h' header Philippe Mathieu-Daudé
@ 2025-03-07 18:03 ` Philippe Mathieu-Daudé
2025-03-07 19:14 ` Pierrick Bouvier
` (2 more replies)
2025-03-07 18:03 ` [PATCH 03/14] hw/vfio: Compile some common objects once Philippe Mathieu-Daudé
` (12 subsequent siblings)
14 siblings, 3 replies; 57+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-03-07 18:03 UTC (permalink / raw)
To: qemu-devel
Cc: Alex Williamson, Igor Mammedov, qemu-ppc, Thomas Huth,
Richard Henderson, Tony Krowiak, Ilya Leoshkevich,
Philippe Mathieu-Daudé, kvm, Yi Liu, Paolo Bonzini,
Zhenzhong Duan, Matthew Rosato, Eric Farman, Peter Xu,
Pierrick Bouvier, Daniel Henrique Barboza, Eric Auger, qemu-s390x,
Jason Herne, Cédric Le Goater, David Hildenbrand,
Alex Bennée, Harsh Prateek Bora, Nicholas Piggin,
Halil Pasic, Christian Borntraeger
<linux/kvm.h> is already include by "system/kvm.h" in the next line.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/vfio/spapr.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/hw/vfio/spapr.c b/hw/vfio/spapr.c
index ad4c499eafe..9b5ad05bb1c 100644
--- a/hw/vfio/spapr.c
+++ b/hw/vfio/spapr.c
@@ -11,9 +11,6 @@
#include "qemu/osdep.h"
#include <sys/ioctl.h>
#include <linux/vfio.h>
-#ifdef CONFIG_KVM
-#include <linux/kvm.h>
-#endif
#include "system/kvm.h"
#include "exec/address-spaces.h"
--
2.47.1
^ permalink raw reply related [flat|nested] 57+ messages in thread
* [PATCH 03/14] hw/vfio: Compile some common objects once
2025-03-07 18:03 [PATCH 00/14] hw/vfio: Build various objects once Philippe Mathieu-Daudé
2025-03-07 18:03 ` [PATCH 01/14] hw/vfio/common: Include missing 'system/tcg.h' header Philippe Mathieu-Daudé
2025-03-07 18:03 ` [PATCH 02/14] hw/vfio/spapr: Do not include <linux/kvm.h> Philippe Mathieu-Daudé
@ 2025-03-07 18:03 ` Philippe Mathieu-Daudé
2025-03-07 19:15 ` Pierrick Bouvier
` (2 more replies)
2025-03-07 18:03 ` [PATCH 04/14] hw/vfio: Compile more " Philippe Mathieu-Daudé
` (11 subsequent siblings)
14 siblings, 3 replies; 57+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-03-07 18:03 UTC (permalink / raw)
To: qemu-devel
Cc: Alex Williamson, Igor Mammedov, qemu-ppc, Thomas Huth,
Richard Henderson, Tony Krowiak, Ilya Leoshkevich,
Philippe Mathieu-Daudé, kvm, Yi Liu, Paolo Bonzini,
Zhenzhong Duan, Matthew Rosato, Eric Farman, Peter Xu,
Pierrick Bouvier, Daniel Henrique Barboza, Eric Auger, qemu-s390x,
Jason Herne, Cédric Le Goater, David Hildenbrand,
Alex Bennée, Harsh Prateek Bora, Nicholas Piggin,
Halil Pasic, Christian Borntraeger
Some files don't rely on any target-specific knowledge
and can be compiled once:
- helpers.c
- container-base.c
- migration.c (removing unnecessary "exec/ram_addr.h")
- migration-multifd.c
- cpr.c
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/vfio/migration.c | 1 -
hw/vfio/meson.build | 13 ++++++++-----
2 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/hw/vfio/migration.c b/hw/vfio/migration.c
index 416643ddd69..fbff46cfc35 100644
--- a/hw/vfio/migration.c
+++ b/hw/vfio/migration.c
@@ -27,7 +27,6 @@
#include "qapi/error.h"
#include "qapi/qapi-events-vfio.h"
#include "exec/ramlist.h"
-#include "exec/ram_addr.h"
#include "pci.h"
#include "trace.h"
#include "hw/hw.h"
diff --git a/hw/vfio/meson.build b/hw/vfio/meson.build
index 260d65febd6..8e376cfcbf8 100644
--- a/hw/vfio/meson.build
+++ b/hw/vfio/meson.build
@@ -1,12 +1,7 @@
vfio_ss = ss.source_set()
vfio_ss.add(files(
- 'helpers.c',
'common.c',
- 'container-base.c',
'container.c',
- 'migration.c',
- 'migration-multifd.c',
- 'cpr.c',
))
vfio_ss.add(when: 'CONFIG_PSERIES', if_true: files('spapr.c'))
vfio_ss.add(when: 'CONFIG_IOMMUFD', if_true: files(
@@ -25,3 +20,11 @@ vfio_ss.add(when: 'CONFIG_VFIO_AP', if_true: files('ap.c'))
vfio_ss.add(when: 'CONFIG_VFIO_IGD', if_true: files('igd.c'))
specific_ss.add_all(when: 'CONFIG_VFIO', if_true: vfio_ss)
+
+system_ss.add(when: 'CONFIG_VFIO', if_true: files(
+ 'helpers.c',
+ 'container-base.c',
+ 'migration.c',
+ 'migration-multifd.c',
+ 'cpr.c',
+))
--
2.47.1
^ permalink raw reply related [flat|nested] 57+ messages in thread
* [PATCH 04/14] hw/vfio: Compile more objects once
2025-03-07 18:03 [PATCH 00/14] hw/vfio: Build various objects once Philippe Mathieu-Daudé
` (2 preceding siblings ...)
2025-03-07 18:03 ` [PATCH 03/14] hw/vfio: Compile some common objects once Philippe Mathieu-Daudé
@ 2025-03-07 18:03 ` Philippe Mathieu-Daudé
2025-03-07 19:15 ` Pierrick Bouvier
` (2 more replies)
2025-03-07 18:03 ` [PATCH 05/14] hw/vfio: Compile iommufd.c once Philippe Mathieu-Daudé
` (10 subsequent siblings)
14 siblings, 3 replies; 57+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-03-07 18:03 UTC (permalink / raw)
To: qemu-devel
Cc: Alex Williamson, Igor Mammedov, qemu-ppc, Thomas Huth,
Richard Henderson, Tony Krowiak, Ilya Leoshkevich,
Philippe Mathieu-Daudé, kvm, Yi Liu, Paolo Bonzini,
Zhenzhong Duan, Matthew Rosato, Eric Farman, Peter Xu,
Pierrick Bouvier, Daniel Henrique Barboza, Eric Auger, qemu-s390x,
Jason Herne, Cédric Le Goater, David Hildenbrand,
Alex Bennée, Harsh Prateek Bora, Nicholas Piggin,
Halil Pasic, Christian Borntraeger
These files depend on the VFIO symbol in their Kconfig
definition. They don't rely on target specific definitions,
move them to system_ss[] to build them once.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/vfio/meson.build | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/hw/vfio/meson.build b/hw/vfio/meson.build
index 8e376cfcbf8..2972c6ff8de 100644
--- a/hw/vfio/meson.build
+++ b/hw/vfio/meson.build
@@ -14,13 +14,13 @@ vfio_ss.add(when: 'CONFIG_VFIO_PCI', if_true: files(
))
vfio_ss.add(when: 'CONFIG_VFIO_CCW', if_true: files('ccw.c'))
vfio_ss.add(when: 'CONFIG_VFIO_PLATFORM', if_true: files('platform.c'))
-vfio_ss.add(when: 'CONFIG_VFIO_XGMAC', if_true: files('calxeda-xgmac.c'))
-vfio_ss.add(when: 'CONFIG_VFIO_AMD_XGBE', if_true: files('amd-xgbe.c'))
vfio_ss.add(when: 'CONFIG_VFIO_AP', if_true: files('ap.c'))
-vfio_ss.add(when: 'CONFIG_VFIO_IGD', if_true: files('igd.c'))
specific_ss.add_all(when: 'CONFIG_VFIO', if_true: vfio_ss)
+system_ss.add(when: 'CONFIG_VFIO_XGMAC', if_true: files('calxeda-xgmac.c'))
+system_ss.add(when: 'CONFIG_VFIO_AMD_XGBE', if_true: files('amd-xgbe.c'))
+system_ss.add(when: 'CONFIG_VFIO_IGD', if_true: files('igd.c'))
system_ss.add(when: 'CONFIG_VFIO', if_true: files(
'helpers.c',
'container-base.c',
--
2.47.1
^ permalink raw reply related [flat|nested] 57+ messages in thread
* [PATCH 05/14] hw/vfio: Compile iommufd.c once
2025-03-07 18:03 [PATCH 00/14] hw/vfio: Build various objects once Philippe Mathieu-Daudé
` (3 preceding siblings ...)
2025-03-07 18:03 ` [PATCH 04/14] hw/vfio: Compile more " Philippe Mathieu-Daudé
@ 2025-03-07 18:03 ` Philippe Mathieu-Daudé
2025-03-07 19:16 ` Pierrick Bouvier
` (2 more replies)
2025-03-07 18:03 ` [PATCH 06/14] system: Declare qemu_[min/max]rampagesize() in 'system/hostmem.h' Philippe Mathieu-Daudé
` (9 subsequent siblings)
14 siblings, 3 replies; 57+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-03-07 18:03 UTC (permalink / raw)
To: qemu-devel
Cc: Alex Williamson, Igor Mammedov, qemu-ppc, Thomas Huth,
Richard Henderson, Tony Krowiak, Ilya Leoshkevich,
Philippe Mathieu-Daudé, kvm, Yi Liu, Paolo Bonzini,
Zhenzhong Duan, Matthew Rosato, Eric Farman, Peter Xu,
Pierrick Bouvier, Daniel Henrique Barboza, Eric Auger, qemu-s390x,
Jason Herne, Cédric Le Goater, David Hildenbrand,
Alex Bennée, Harsh Prateek Bora, Nicholas Piggin,
Halil Pasic, Christian Borntraeger
Removing unused "exec/ram_addr.h" header allow to compile
iommufd.c once for all targets.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/vfio/iommufd.c | 1 -
hw/vfio/meson.build | 6 +++---
2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/hw/vfio/iommufd.c b/hw/vfio/iommufd.c
index df61edffc08..42c8412bbf5 100644
--- a/hw/vfio/iommufd.c
+++ b/hw/vfio/iommufd.c
@@ -25,7 +25,6 @@
#include "qemu/cutils.h"
#include "qemu/chardev_open.h"
#include "pci.h"
-#include "exec/ram_addr.h"
static int iommufd_cdev_map(const VFIOContainerBase *bcontainer, hwaddr iova,
ram_addr_t size, void *vaddr, bool readonly)
diff --git a/hw/vfio/meson.build b/hw/vfio/meson.build
index 2972c6ff8de..fea6dbe88cd 100644
--- a/hw/vfio/meson.build
+++ b/hw/vfio/meson.build
@@ -4,9 +4,6 @@ vfio_ss.add(files(
'container.c',
))
vfio_ss.add(when: 'CONFIG_PSERIES', if_true: files('spapr.c'))
-vfio_ss.add(when: 'CONFIG_IOMMUFD', if_true: files(
- 'iommufd.c',
-))
vfio_ss.add(when: 'CONFIG_VFIO_PCI', if_true: files(
'display.c',
'pci-quirks.c',
@@ -28,3 +25,6 @@ system_ss.add(when: 'CONFIG_VFIO', if_true: files(
'migration-multifd.c',
'cpr.c',
))
+system_ss.add(when: ['CONFIG_VFIO', 'CONFIG_IOMMUFD'], if_true: files(
+ 'iommufd.c',
+))
--
2.47.1
^ permalink raw reply related [flat|nested] 57+ messages in thread
* [PATCH 06/14] system: Declare qemu_[min/max]rampagesize() in 'system/hostmem.h'
2025-03-07 18:03 [PATCH 00/14] hw/vfio: Build various objects once Philippe Mathieu-Daudé
` (4 preceding siblings ...)
2025-03-07 18:03 ` [PATCH 05/14] hw/vfio: Compile iommufd.c once Philippe Mathieu-Daudé
@ 2025-03-07 18:03 ` Philippe Mathieu-Daudé
2025-03-07 19:16 ` Pierrick Bouvier
2025-03-07 21:12 ` Philippe Mathieu-Daudé
2025-03-07 18:03 ` [PATCH 07/14] hw/vfio: Compile display.c once Philippe Mathieu-Daudé
` (8 subsequent siblings)
14 siblings, 2 replies; 57+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-03-07 18:03 UTC (permalink / raw)
To: qemu-devel
Cc: Alex Williamson, Igor Mammedov, qemu-ppc, Thomas Huth,
Richard Henderson, Tony Krowiak, Ilya Leoshkevich,
Philippe Mathieu-Daudé, kvm, Yi Liu, Paolo Bonzini,
Zhenzhong Duan, Matthew Rosato, Eric Farman, Peter Xu,
Pierrick Bouvier, Daniel Henrique Barboza, Eric Auger, qemu-s390x,
Jason Herne, Cédric Le Goater, David Hildenbrand,
Alex Bennée, Harsh Prateek Bora, Nicholas Piggin,
Halil Pasic, Christian Borntraeger
Both qemu_minrampagesize() and qemu_maxrampagesize() are
related to host memory backends. Move their prototype
declaration to "system/hostmem.h".
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
include/exec/ram_addr.h | 3 ---
include/system/hostmem.h | 3 +++
hw/ppc/spapr_caps.c | 1 +
hw/s390x/s390-virtio-ccw.c | 1 +
hw/vfio/spapr.c | 1 +
5 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/include/exec/ram_addr.h b/include/exec/ram_addr.h
index 94bb3ccbe42..ccc8df561af 100644
--- a/include/exec/ram_addr.h
+++ b/include/exec/ram_addr.h
@@ -101,9 +101,6 @@ static inline unsigned long int ramblock_recv_bitmap_offset(void *host_addr,
bool ramblock_is_pmem(RAMBlock *rb);
-long qemu_minrampagesize(void);
-long qemu_maxrampagesize(void);
-
/**
* qemu_ram_alloc_from_file,
* qemu_ram_alloc_from_fd: Allocate a ram block from the specified backing
diff --git a/include/system/hostmem.h b/include/system/hostmem.h
index 5c21ca55c01..62642e602ca 100644
--- a/include/system/hostmem.h
+++ b/include/system/hostmem.h
@@ -93,4 +93,7 @@ bool host_memory_backend_is_mapped(HostMemoryBackend *backend);
size_t host_memory_backend_pagesize(HostMemoryBackend *memdev);
char *host_memory_backend_get_name(HostMemoryBackend *backend);
+long qemu_minrampagesize(void);
+long qemu_maxrampagesize(void);
+
#endif
diff --git a/hw/ppc/spapr_caps.c b/hw/ppc/spapr_caps.c
index 904bff87ce1..9e53d0c1fd1 100644
--- a/hw/ppc/spapr_caps.c
+++ b/hw/ppc/spapr_caps.c
@@ -34,6 +34,7 @@
#include "kvm_ppc.h"
#include "migration/vmstate.h"
#include "system/tcg.h"
+#include "system/hostmem.h"
#include "hw/ppc/spapr.h"
diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c
index 51ae0c133d8..1261d93b7ce 100644
--- a/hw/s390x/s390-virtio-ccw.c
+++ b/hw/s390x/s390-virtio-ccw.c
@@ -41,6 +41,7 @@
#include "hw/s390x/tod.h"
#include "system/system.h"
#include "system/cpus.h"
+#include "system/hostmem.h"
#include "target/s390x/kvm/pv.h"
#include "migration/blocker.h"
#include "qapi/visitor.h"
diff --git a/hw/vfio/spapr.c b/hw/vfio/spapr.c
index 9b5ad05bb1c..1a5d1611f2c 100644
--- a/hw/vfio/spapr.c
+++ b/hw/vfio/spapr.c
@@ -12,6 +12,7 @@
#include <sys/ioctl.h>
#include <linux/vfio.h>
#include "system/kvm.h"
+#include "system/hostmem.h"
#include "exec/address-spaces.h"
#include "hw/vfio/vfio-common.h"
--
2.47.1
^ permalink raw reply related [flat|nested] 57+ messages in thread
* [PATCH 07/14] hw/vfio: Compile display.c once
2025-03-07 18:03 [PATCH 00/14] hw/vfio: Build various objects once Philippe Mathieu-Daudé
` (5 preceding siblings ...)
2025-03-07 18:03 ` [PATCH 06/14] system: Declare qemu_[min/max]rampagesize() in 'system/hostmem.h' Philippe Mathieu-Daudé
@ 2025-03-07 18:03 ` Philippe Mathieu-Daudé
2025-03-07 19:17 ` Pierrick Bouvier
` (2 more replies)
2025-03-07 18:03 ` [PATCH 08/14] system/kvm: Expose kvm_irqchip_[add, remove]_change_notifier() Philippe Mathieu-Daudé
` (7 subsequent siblings)
14 siblings, 3 replies; 57+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-03-07 18:03 UTC (permalink / raw)
To: qemu-devel
Cc: Alex Williamson, Igor Mammedov, qemu-ppc, Thomas Huth,
Richard Henderson, Tony Krowiak, Ilya Leoshkevich,
Philippe Mathieu-Daudé, kvm, Yi Liu, Paolo Bonzini,
Zhenzhong Duan, Matthew Rosato, Eric Farman, Peter Xu,
Pierrick Bouvier, Daniel Henrique Barboza, Eric Auger, qemu-s390x,
Jason Herne, Cédric Le Goater, David Hildenbrand,
Alex Bennée, Harsh Prateek Bora, Nicholas Piggin,
Halil Pasic, Christian Borntraeger
display.c doesn't rely on target specific definitions,
move it to system_ss[] to build it once.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/vfio/meson.build | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/hw/vfio/meson.build b/hw/vfio/meson.build
index fea6dbe88cd..96e342aa8cb 100644
--- a/hw/vfio/meson.build
+++ b/hw/vfio/meson.build
@@ -5,7 +5,6 @@ vfio_ss.add(files(
))
vfio_ss.add(when: 'CONFIG_PSERIES', if_true: files('spapr.c'))
vfio_ss.add(when: 'CONFIG_VFIO_PCI', if_true: files(
- 'display.c',
'pci-quirks.c',
'pci.c',
))
@@ -28,3 +27,6 @@ system_ss.add(when: 'CONFIG_VFIO', if_true: files(
system_ss.add(when: ['CONFIG_VFIO', 'CONFIG_IOMMUFD'], if_true: files(
'iommufd.c',
))
+system_ss.add(when: 'CONFIG_VFIO_PCI', if_true: files(
+ 'display.c',
+))
--
2.47.1
^ permalink raw reply related [flat|nested] 57+ messages in thread
* [PATCH 08/14] system/kvm: Expose kvm_irqchip_[add, remove]_change_notifier()
2025-03-07 18:03 [PATCH 00/14] hw/vfio: Build various objects once Philippe Mathieu-Daudé
` (6 preceding siblings ...)
2025-03-07 18:03 ` [PATCH 07/14] hw/vfio: Compile display.c once Philippe Mathieu-Daudé
@ 2025-03-07 18:03 ` Philippe Mathieu-Daudé
2025-03-07 19:17 ` [PATCH 08/14] system/kvm: Expose kvm_irqchip_[add,remove]_change_notifier() Pierrick Bouvier
2025-03-07 20:09 ` Richard Henderson
2025-03-07 18:03 ` [PATCH 09/14] hw/vfio/pci: Convert CONFIG_KVM check to runtime one Philippe Mathieu-Daudé
` (6 subsequent siblings)
14 siblings, 2 replies; 57+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-03-07 18:03 UTC (permalink / raw)
To: qemu-devel
Cc: Alex Williamson, Igor Mammedov, qemu-ppc, Thomas Huth,
Richard Henderson, Tony Krowiak, Ilya Leoshkevich,
Philippe Mathieu-Daudé, kvm, Yi Liu, Paolo Bonzini,
Zhenzhong Duan, Matthew Rosato, Eric Farman, Peter Xu,
Pierrick Bouvier, Daniel Henrique Barboza, Eric Auger, qemu-s390x,
Jason Herne, Cédric Le Goater, David Hildenbrand,
Alex Bennée, Harsh Prateek Bora, Nicholas Piggin,
Halil Pasic, Christian Borntraeger
Currently kvm_irqchip_add_irqfd_notifier() and
kvm_irqchip_remove_irqfd_notifier() are only declared on
target specific code. There is not particular reason to,
as their prototypes don't use anything target related.
Move their declaration with common prototypes, and
implement their stub.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
include/system/kvm.h | 8 ++++----
accel/stubs/kvm-stub.c | 12 ++++++++++++
2 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/include/system/kvm.h b/include/system/kvm.h
index ab17c09a551..75673fb794e 100644
--- a/include/system/kvm.h
+++ b/include/system/kvm.h
@@ -412,10 +412,6 @@ int kvm_irqchip_send_msi(KVMState *s, MSIMessage msg);
void kvm_irqchip_add_irq_route(KVMState *s, int gsi, int irqchip, int pin);
-void kvm_irqchip_add_change_notifier(Notifier *n);
-void kvm_irqchip_remove_change_notifier(Notifier *n);
-void kvm_irqchip_change_notify(void);
-
struct kvm_guest_debug;
struct kvm_debug_exit_arch;
@@ -517,6 +513,10 @@ void kvm_irqchip_release_virq(KVMState *s, int virq);
void kvm_add_routing_entry(KVMState *s,
struct kvm_irq_routing_entry *entry);
+void kvm_irqchip_add_change_notifier(Notifier *n);
+void kvm_irqchip_remove_change_notifier(Notifier *n);
+void kvm_irqchip_change_notify(void);
+
int kvm_irqchip_add_irqfd_notifier_gsi(KVMState *s, EventNotifier *n,
EventNotifier *rn, int virq);
int kvm_irqchip_remove_irqfd_notifier_gsi(KVMState *s, EventNotifier *n,
diff --git a/accel/stubs/kvm-stub.c b/accel/stubs/kvm-stub.c
index ecfd7636f5f..a305b33d84d 100644
--- a/accel/stubs/kvm-stub.c
+++ b/accel/stubs/kvm-stub.c
@@ -83,6 +83,18 @@ void kvm_irqchip_change_notify(void)
{
}
+int kvm_irqchip_add_irqfd_notifier(KVMState *s, EventNotifier *n,
+ EventNotifier *rn, qemu_irq irq)
+{
+ return -ENOSYS;
+}
+
+int kvm_irqchip_remove_irqfd_notifier(KVMState *s, EventNotifier *n,
+ qemu_irq irq)
+{
+ return -ENOSYS;
+}
+
int kvm_irqchip_add_irqfd_notifier_gsi(KVMState *s, EventNotifier *n,
EventNotifier *rn, int virq)
{
--
2.47.1
^ permalink raw reply related [flat|nested] 57+ messages in thread
* [PATCH 09/14] hw/vfio/pci: Convert CONFIG_KVM check to runtime one
2025-03-07 18:03 [PATCH 00/14] hw/vfio: Build various objects once Philippe Mathieu-Daudé
` (7 preceding siblings ...)
2025-03-07 18:03 ` [PATCH 08/14] system/kvm: Expose kvm_irqchip_[add, remove]_change_notifier() Philippe Mathieu-Daudé
@ 2025-03-07 18:03 ` Philippe Mathieu-Daudé
2025-03-07 19:18 ` Pierrick Bouvier
` (2 more replies)
2025-03-07 18:03 ` [PATCH 10/14] system/iommufd: Introduce iommufd_builtin() helper Philippe Mathieu-Daudé
` (5 subsequent siblings)
14 siblings, 3 replies; 57+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-03-07 18:03 UTC (permalink / raw)
To: qemu-devel
Cc: Alex Williamson, Igor Mammedov, qemu-ppc, Thomas Huth,
Richard Henderson, Tony Krowiak, Ilya Leoshkevich,
Philippe Mathieu-Daudé, kvm, Yi Liu, Paolo Bonzini,
Zhenzhong Duan, Matthew Rosato, Eric Farman, Peter Xu,
Pierrick Bouvier, Daniel Henrique Barboza, Eric Auger, qemu-s390x,
Jason Herne, Cédric Le Goater, David Hildenbrand,
Alex Bennée, Harsh Prateek Bora, Nicholas Piggin,
Halil Pasic, Christian Borntraeger
Use the runtime kvm_enabled() helper to check whether
KVM is available or not.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/vfio/pci.c | 19 +++++++++----------
1 file changed, 9 insertions(+), 10 deletions(-)
diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c
index fdbc15885d4..9872884ff8a 100644
--- a/hw/vfio/pci.c
+++ b/hw/vfio/pci.c
@@ -118,8 +118,13 @@ static void vfio_intx_eoi(VFIODevice *vbasedev)
static bool vfio_intx_enable_kvm(VFIOPCIDevice *vdev, Error **errp)
{
-#ifdef CONFIG_KVM
- int irq_fd = event_notifier_get_fd(&vdev->intx.interrupt);
+ int irq_fd;
+
+ if (!kvm_enabled()) {
+ return true;
+ }
+
+ irq_fd = event_notifier_get_fd(&vdev->intx.interrupt);
if (vdev->no_kvm_intx || !kvm_irqfds_enabled() ||
vdev->intx.route.mode != PCI_INTX_ENABLED ||
@@ -171,16 +176,13 @@ fail_irqfd:
fail:
qemu_set_fd_handler(irq_fd, vfio_intx_interrupt, NULL, vdev);
vfio_unmask_single_irqindex(&vdev->vbasedev, VFIO_PCI_INTX_IRQ_INDEX);
+
return false;
-#else
- return true;
-#endif
}
static void vfio_intx_disable_kvm(VFIOPCIDevice *vdev)
{
-#ifdef CONFIG_KVM
- if (!vdev->intx.kvm_accel) {
+ if (!kvm_enabled() || !vdev->intx.kvm_accel) {
return;
}
@@ -211,7 +213,6 @@ static void vfio_intx_disable_kvm(VFIOPCIDevice *vdev)
vfio_unmask_single_irqindex(&vdev->vbasedev, VFIO_PCI_INTX_IRQ_INDEX);
trace_vfio_intx_disable_kvm(vdev->vbasedev.name);
-#endif
}
static void vfio_intx_update(VFIOPCIDevice *vdev, PCIINTxRoute *route)
@@ -278,7 +279,6 @@ static bool vfio_intx_enable(VFIOPCIDevice *vdev, Error **errp)
vdev->intx.pin = pin - 1; /* Pin A (1) -> irq[0] */
pci_config_set_interrupt_pin(vdev->pdev.config, pin);
-#ifdef CONFIG_KVM
/*
* Only conditional to avoid generating error messages on platforms
* where we won't actually use the result anyway.
@@ -287,7 +287,6 @@ static bool vfio_intx_enable(VFIOPCIDevice *vdev, Error **errp)
vdev->intx.route = pci_device_route_intx_to_irq(&vdev->pdev,
vdev->intx.pin);
}
-#endif
ret = event_notifier_init(&vdev->intx.interrupt, 0);
if (ret) {
--
2.47.1
^ permalink raw reply related [flat|nested] 57+ messages in thread
* [PATCH 10/14] system/iommufd: Introduce iommufd_builtin() helper
2025-03-07 18:03 [PATCH 00/14] hw/vfio: Build various objects once Philippe Mathieu-Daudé
` (8 preceding siblings ...)
2025-03-07 18:03 ` [PATCH 09/14] hw/vfio/pci: Convert CONFIG_KVM check to runtime one Philippe Mathieu-Daudé
@ 2025-03-07 18:03 ` Philippe Mathieu-Daudé
2025-03-07 19:18 ` Pierrick Bouvier
2025-03-07 20:33 ` Richard Henderson
2025-03-07 18:03 ` [PATCH 11/14] hw/vfio/pci: Check CONFIG_IOMMUFD at runtime using iommufd_builtin() Philippe Mathieu-Daudé
` (4 subsequent siblings)
14 siblings, 2 replies; 57+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-03-07 18:03 UTC (permalink / raw)
To: qemu-devel
Cc: Alex Williamson, Igor Mammedov, qemu-ppc, Thomas Huth,
Richard Henderson, Tony Krowiak, Ilya Leoshkevich,
Philippe Mathieu-Daudé, kvm, Yi Liu, Paolo Bonzini,
Zhenzhong Duan, Matthew Rosato, Eric Farman, Peter Xu,
Pierrick Bouvier, Daniel Henrique Barboza, Eric Auger, qemu-s390x,
Jason Herne, Cédric Le Goater, David Hildenbrand,
Alex Bennée, Harsh Prateek Bora, Nicholas Piggin,
Halil Pasic, Christian Borntraeger
iommufd_builtin() can be used to check at runtime whether
the IOMMUFD feature is built in a qemu-system binary.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
docs/devel/vfio-iommufd.rst | 2 +-
include/system/iommufd.h | 8 ++++++++
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/docs/devel/vfio-iommufd.rst b/docs/devel/vfio-iommufd.rst
index 3d1c11f175e..08882094eee 100644
--- a/docs/devel/vfio-iommufd.rst
+++ b/docs/devel/vfio-iommufd.rst
@@ -88,7 +88,7 @@ Step 2: configure QEMU
----------------------
Interactions with the ``/dev/iommu`` are abstracted by a new iommufd
-object (compiled in with the ``CONFIG_IOMMUFD`` option).
+object (which availability can be checked at runtime using ``iommufd_builtin()``).
Any QEMU device (e.g. VFIO device) wishing to use ``/dev/iommu`` must
be linked with an iommufd object. It gets a new optional property
diff --git a/include/system/iommufd.h b/include/system/iommufd.h
index cbab75bfbf6..ce459254025 100644
--- a/include/system/iommufd.h
+++ b/include/system/iommufd.h
@@ -63,4 +63,12 @@ bool iommufd_backend_get_dirty_bitmap(IOMMUFDBackend *be, uint32_t hwpt_id,
Error **errp);
#define TYPE_HOST_IOMMU_DEVICE_IOMMUFD TYPE_HOST_IOMMU_DEVICE "-iommufd"
+
+static inline bool iommufd_builtin(void)
+{
+ bool ambig = false;
+
+ return object_resolve_path_type("", TYPE_IOMMUFD_BACKEND, &ambig) || ambig;
+}
+
#endif
--
2.47.1
^ permalink raw reply related [flat|nested] 57+ messages in thread
* [PATCH 11/14] hw/vfio/pci: Check CONFIG_IOMMUFD at runtime using iommufd_builtin()
2025-03-07 18:03 [PATCH 00/14] hw/vfio: Build various objects once Philippe Mathieu-Daudé
` (9 preceding siblings ...)
2025-03-07 18:03 ` [PATCH 10/14] system/iommufd: Introduce iommufd_builtin() helper Philippe Mathieu-Daudé
@ 2025-03-07 18:03 ` Philippe Mathieu-Daudé
2025-03-07 19:19 ` Pierrick Bouvier
2025-03-07 20:35 ` Richard Henderson
2025-03-07 18:03 ` [PATCH 12/14] hw/vfio/ap: " Philippe Mathieu-Daudé
` (3 subsequent siblings)
14 siblings, 2 replies; 57+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-03-07 18:03 UTC (permalink / raw)
To: qemu-devel
Cc: Alex Williamson, Igor Mammedov, qemu-ppc, Thomas Huth,
Richard Henderson, Tony Krowiak, Ilya Leoshkevich,
Philippe Mathieu-Daudé, kvm, Yi Liu, Paolo Bonzini,
Zhenzhong Duan, Matthew Rosato, Eric Farman, Peter Xu,
Pierrick Bouvier, Daniel Henrique Barboza, Eric Auger, qemu-s390x,
Jason Herne, Cédric Le Goater, David Hildenbrand,
Alex Bennée, Harsh Prateek Bora, Nicholas Piggin,
Halil Pasic, Christian Borntraeger
Convert the compile time check on the CONFIG_IOMMUFD definition
by a runtime one by calling iommufd_builtin().
Since the file doesn't use any target-specific knowledge anymore,
move it to system_ss[] to build it once.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/vfio/pci.c | 38 ++++++++++++++++++--------------------
hw/vfio/meson.build | 2 +-
2 files changed, 19 insertions(+), 21 deletions(-)
diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c
index 9872884ff8a..e83252766d1 100644
--- a/hw/vfio/pci.c
+++ b/hw/vfio/pci.c
@@ -19,7 +19,6 @@
*/
#include "qemu/osdep.h"
-#include CONFIG_DEVICES /* CONFIG_IOMMUFD */
#include <linux/vfio.h>
#include <sys/ioctl.h>
@@ -2973,11 +2972,10 @@ static void vfio_realize(PCIDevice *pdev, Error **errp)
if (!(~vdev->host.domain || ~vdev->host.bus ||
~vdev->host.slot || ~vdev->host.function)) {
error_setg(errp, "No provided host device");
- error_append_hint(errp, "Use -device vfio-pci,host=DDDD:BB:DD.F "
-#ifdef CONFIG_IOMMUFD
- "or -device vfio-pci,fd=DEVICE_FD "
-#endif
- "or -device vfio-pci,sysfsdev=PATH_TO_DEVICE\n");
+ error_append_hint(errp, "Use -device vfio-pci,host=DDDD:BB:DD.F %s"
+ "or -device vfio-pci,sysfsdev=PATH_TO_DEVICE\n",
+ iommufd_builtin()
+ ? "or -device vfio-pci,fd=DEVICE_FD " : "");
return;
}
vbasedev->sysfsdev =
@@ -3412,19 +3410,18 @@ static const Property vfio_pci_dev_properties[] = {
qdev_prop_nv_gpudirect_clique, uint8_t),
DEFINE_PROP_OFF_AUTO_PCIBAR("x-msix-relocation", VFIOPCIDevice, msix_relo,
OFF_AUTO_PCIBAR_OFF),
-#ifdef CONFIG_IOMMUFD
- DEFINE_PROP_LINK("iommufd", VFIOPCIDevice, vbasedev.iommufd,
- TYPE_IOMMUFD_BACKEND, IOMMUFDBackend *),
-#endif
DEFINE_PROP_BOOL("skip-vsc-check", VFIOPCIDevice, skip_vsc_check, true),
};
-#ifdef CONFIG_IOMMUFD
+static const Property vfio_pci_dev_iommufd_properties[] = {
+ DEFINE_PROP_LINK("iommufd", VFIOPCIDevice, vbasedev.iommufd,
+ TYPE_IOMMUFD_BACKEND, IOMMUFDBackend *),
+};
+
static void vfio_pci_set_fd(Object *obj, const char *str, Error **errp)
{
vfio_device_set_fd(&VFIO_PCI(obj)->vbasedev, str, errp);
}
-#endif
static void vfio_pci_dev_class_init(ObjectClass *klass, void *data)
{
@@ -3433,9 +3430,10 @@ static void vfio_pci_dev_class_init(ObjectClass *klass, void *data)
device_class_set_legacy_reset(dc, vfio_pci_reset);
device_class_set_props(dc, vfio_pci_dev_properties);
-#ifdef CONFIG_IOMMUFD
- object_class_property_add_str(klass, "fd", NULL, vfio_pci_set_fd);
-#endif
+ if (iommufd_builtin()) {
+ device_class_set_props(dc, vfio_pci_dev_iommufd_properties);
+ object_class_property_add_str(klass, "fd", NULL, vfio_pci_set_fd);
+ }
dc->desc = "VFIO-based PCI device assignment";
set_bit(DEVICE_CATEGORY_MISC, dc->categories);
pdc->realize = vfio_realize;
@@ -3540,11 +3538,11 @@ static void vfio_pci_dev_class_init(ObjectClass *klass, void *data)
"vf-token",
"Specify UUID VF token. Required for VF when PF is owned "
"by another VFIO driver");
-#ifdef CONFIG_IOMMUFD
- object_class_property_set_description(klass, /* 9.0 */
- "iommufd",
- "Set host IOMMUFD backend device");
-#endif
+ if (iommufd_builtin()) {
+ object_class_property_set_description(klass, /* 9.0 */
+ "iommufd",
+ "Set host IOMMUFD backend device");
+ }
object_class_property_set_description(klass, /* 9.1 */
"x-device-dirty-page-tracking",
"Disable device dirty page tracking and use "
diff --git a/hw/vfio/meson.build b/hw/vfio/meson.build
index 96e342aa8cb..9a004992c11 100644
--- a/hw/vfio/meson.build
+++ b/hw/vfio/meson.build
@@ -6,7 +6,6 @@ vfio_ss.add(files(
vfio_ss.add(when: 'CONFIG_PSERIES', if_true: files('spapr.c'))
vfio_ss.add(when: 'CONFIG_VFIO_PCI', if_true: files(
'pci-quirks.c',
- 'pci.c',
))
vfio_ss.add(when: 'CONFIG_VFIO_CCW', if_true: files('ccw.c'))
vfio_ss.add(when: 'CONFIG_VFIO_PLATFORM', if_true: files('platform.c'))
@@ -29,4 +28,5 @@ system_ss.add(when: ['CONFIG_VFIO', 'CONFIG_IOMMUFD'], if_true: files(
))
system_ss.add(when: 'CONFIG_VFIO_PCI', if_true: files(
'display.c',
+ 'pci.c',
))
--
2.47.1
^ permalink raw reply related [flat|nested] 57+ messages in thread
* [PATCH 12/14] hw/vfio/ap: Check CONFIG_IOMMUFD at runtime using iommufd_builtin()
2025-03-07 18:03 [PATCH 00/14] hw/vfio: Build various objects once Philippe Mathieu-Daudé
` (10 preceding siblings ...)
2025-03-07 18:03 ` [PATCH 11/14] hw/vfio/pci: Check CONFIG_IOMMUFD at runtime using iommufd_builtin() Philippe Mathieu-Daudé
@ 2025-03-07 18:03 ` Philippe Mathieu-Daudé
2025-03-07 19:19 ` Pierrick Bouvier
2025-03-07 20:42 ` Richard Henderson
2025-03-07 18:03 ` [PATCH 13/14] hw/vfio/ccw: " Philippe Mathieu-Daudé
` (2 subsequent siblings)
14 siblings, 2 replies; 57+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-03-07 18:03 UTC (permalink / raw)
To: qemu-devel
Cc: Alex Williamson, Igor Mammedov, qemu-ppc, Thomas Huth,
Richard Henderson, Tony Krowiak, Ilya Leoshkevich,
Philippe Mathieu-Daudé, kvm, Yi Liu, Paolo Bonzini,
Zhenzhong Duan, Matthew Rosato, Eric Farman, Peter Xu,
Pierrick Bouvier, Daniel Henrique Barboza, Eric Auger, qemu-s390x,
Jason Herne, Cédric Le Goater, David Hildenbrand,
Alex Bennée, Harsh Prateek Bora, Nicholas Piggin,
Halil Pasic, Christian Borntraeger
Convert the compile time check on the CONFIG_IOMMUFD definition
by a runtime one by calling iommufd_builtin().
Since the file doesn't use any target-specific knowledge anymore,
move it to system_ss[] to build it once.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
target/s390x/kvm/kvm_s390x.h | 2 +-
hw/vfio/ap.c | 27 +++++++++++++--------------
hw/vfio/meson.build | 2 +-
3 files changed, 15 insertions(+), 16 deletions(-)
diff --git a/target/s390x/kvm/kvm_s390x.h b/target/s390x/kvm/kvm_s390x.h
index 649dae5948a..7b1cce3e60d 100644
--- a/target/s390x/kvm/kvm_s390x.h
+++ b/target/s390x/kvm/kvm_s390x.h
@@ -10,7 +10,7 @@
#ifndef KVM_S390X_H
#define KVM_S390X_H
-#include "cpu-qom.h"
+#include "target/s390x/cpu-qom.h"
struct kvm_s390_irq;
diff --git a/hw/vfio/ap.c b/hw/vfio/ap.c
index c7ab4ff57ad..832b98532ea 100644
--- a/hw/vfio/ap.c
+++ b/hw/vfio/ap.c
@@ -11,7 +11,6 @@
*/
#include "qemu/osdep.h"
-#include CONFIG_DEVICES /* CONFIG_IOMMUFD */
#include <linux/vfio.h>
#include <sys/ioctl.h>
#include "qapi/error.h"
@@ -24,7 +23,7 @@
#include "qemu/module.h"
#include "qemu/option.h"
#include "qemu/config-file.h"
-#include "kvm/kvm_s390x.h"
+#include "target/s390x/kvm/kvm_s390x.h"
#include "migration/vmstate.h"
#include "hw/qdev-properties.h"
#include "hw/s390x/ap-bridge.h"
@@ -193,10 +192,11 @@ static void vfio_ap_unrealize(DeviceState *dev)
static const Property vfio_ap_properties[] = {
DEFINE_PROP_STRING("sysfsdev", VFIOAPDevice, vdev.sysfsdev),
-#ifdef CONFIG_IOMMUFD
+};
+
+static const Property vfio_ap_iommufd_properties[] = {
DEFINE_PROP_LINK("iommufd", VFIOAPDevice, vdev.iommufd,
TYPE_IOMMUFD_BACKEND, IOMMUFDBackend *),
-#endif
};
static void vfio_ap_reset(DeviceState *dev)
@@ -234,21 +234,20 @@ static void vfio_ap_instance_init(Object *obj)
vbasedev->mdev = true;
}
-#ifdef CONFIG_IOMMUFD
static void vfio_ap_set_fd(Object *obj, const char *str, Error **errp)
{
vfio_device_set_fd(&VFIO_AP_DEVICE(obj)->vdev, str, errp);
}
-#endif
static void vfio_ap_class_init(ObjectClass *klass, void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
device_class_set_props(dc, vfio_ap_properties);
-#ifdef CONFIG_IOMMUFD
- object_class_property_add_str(klass, "fd", NULL, vfio_ap_set_fd);
-#endif
+ if (iommufd_builtin()) {
+ device_class_set_props(dc, vfio_ap_iommufd_properties);
+ object_class_property_add_str(klass, "fd", NULL, vfio_ap_set_fd);
+ }
dc->vmsd = &vfio_ap_vmstate;
dc->desc = "VFIO-based AP device assignment";
set_bit(DEVICE_CATEGORY_MISC, dc->categories);
@@ -261,11 +260,11 @@ static void vfio_ap_class_init(ObjectClass *klass, void *data)
object_class_property_set_description(klass, /* 3.1 */
"sysfsdev",
"Host sysfs path of assigned device");
-#ifdef CONFIG_IOMMUFD
- object_class_property_set_description(klass, /* 9.0 */
- "iommufd",
- "Set host IOMMUFD backend device");
-#endif
+ if (iommufd_builtin()) {
+ object_class_property_set_description(klass, /* 9.0 */
+ "iommufd",
+ "Set host IOMMUFD backend device");
+ }
}
static const TypeInfo vfio_ap_info = {
diff --git a/hw/vfio/meson.build b/hw/vfio/meson.build
index 9a004992c11..510ebe6d720 100644
--- a/hw/vfio/meson.build
+++ b/hw/vfio/meson.build
@@ -9,7 +9,6 @@ vfio_ss.add(when: 'CONFIG_VFIO_PCI', if_true: files(
))
vfio_ss.add(when: 'CONFIG_VFIO_CCW', if_true: files('ccw.c'))
vfio_ss.add(when: 'CONFIG_VFIO_PLATFORM', if_true: files('platform.c'))
-vfio_ss.add(when: 'CONFIG_VFIO_AP', if_true: files('ap.c'))
specific_ss.add_all(when: 'CONFIG_VFIO', if_true: vfio_ss)
@@ -26,6 +25,7 @@ system_ss.add(when: 'CONFIG_VFIO', if_true: files(
system_ss.add(when: ['CONFIG_VFIO', 'CONFIG_IOMMUFD'], if_true: files(
'iommufd.c',
))
+system_ss.add(when: 'CONFIG_VFIO_AP', if_true: files('ap.c'))
system_ss.add(when: 'CONFIG_VFIO_PCI', if_true: files(
'display.c',
'pci.c',
--
2.47.1
^ permalink raw reply related [flat|nested] 57+ messages in thread
* [PATCH 13/14] hw/vfio/ccw: Check CONFIG_IOMMUFD at runtime using iommufd_builtin()
2025-03-07 18:03 [PATCH 00/14] hw/vfio: Build various objects once Philippe Mathieu-Daudé
` (11 preceding siblings ...)
2025-03-07 18:03 ` [PATCH 12/14] hw/vfio/ap: " Philippe Mathieu-Daudé
@ 2025-03-07 18:03 ` Philippe Mathieu-Daudé
2025-03-07 19:19 ` Pierrick Bouvier
2025-03-07 20:45 ` Richard Henderson
2025-03-07 18:03 ` [PATCH 14/14] hw/vfio/platform: Check CONFIG_IOMMUFD at runtime using iommufd_builtin Philippe Mathieu-Daudé
2025-03-08 17:48 ` [PATCH 00/14] hw/vfio: Build various objects once Cédric Le Goater
14 siblings, 2 replies; 57+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-03-07 18:03 UTC (permalink / raw)
To: qemu-devel
Cc: Alex Williamson, Igor Mammedov, qemu-ppc, Thomas Huth,
Richard Henderson, Tony Krowiak, Ilya Leoshkevich,
Philippe Mathieu-Daudé, kvm, Yi Liu, Paolo Bonzini,
Zhenzhong Duan, Matthew Rosato, Eric Farman, Peter Xu,
Pierrick Bouvier, Daniel Henrique Barboza, Eric Auger, qemu-s390x,
Jason Herne, Cédric Le Goater, David Hildenbrand,
Alex Bennée, Harsh Prateek Bora, Nicholas Piggin,
Halil Pasic, Christian Borntraeger
Convert the compile time check on the CONFIG_IOMMUFD definition
by a runtime one by calling iommufd_builtin().
Since the file doesn't use any target-specific knowledge anymore,
move it to system_ss[] to build it once.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/vfio/ccw.c | 27 +++++++++++++--------------
hw/vfio/meson.build | 2 +-
2 files changed, 14 insertions(+), 15 deletions(-)
diff --git a/hw/vfio/ccw.c b/hw/vfio/ccw.c
index e5e0d9e3e7e..84d1437a568 100644
--- a/hw/vfio/ccw.c
+++ b/hw/vfio/ccw.c
@@ -15,7 +15,6 @@
*/
#include "qemu/osdep.h"
-#include CONFIG_DEVICES /* CONFIG_IOMMUFD */
#include <linux/vfio.h>
#include <linux/vfio_ccw.h>
#include <sys/ioctl.h>
@@ -650,11 +649,12 @@ static void vfio_ccw_unrealize(DeviceState *dev)
static const Property vfio_ccw_properties[] = {
DEFINE_PROP_STRING("sysfsdev", VFIOCCWDevice, vdev.sysfsdev),
DEFINE_PROP_BOOL("force-orb-pfch", VFIOCCWDevice, force_orb_pfch, false),
-#ifdef CONFIG_IOMMUFD
+ DEFINE_PROP_CCW_LOADPARM("loadparm", CcwDevice, loadparm),
+};
+
+static const Property vfio_ccw_iommufd_properties[] = {
DEFINE_PROP_LINK("iommufd", VFIOCCWDevice, vdev.iommufd,
TYPE_IOMMUFD_BACKEND, IOMMUFDBackend *),
-#endif
- DEFINE_PROP_CCW_LOADPARM("loadparm", CcwDevice, loadparm),
};
static const VMStateDescription vfio_ccw_vmstate = {
@@ -682,12 +682,10 @@ static void vfio_ccw_instance_init(Object *obj)
DEVICE(vcdev), true);
}
-#ifdef CONFIG_IOMMUFD
static void vfio_ccw_set_fd(Object *obj, const char *str, Error **errp)
{
vfio_device_set_fd(&VFIO_CCW(obj)->vdev, str, errp);
}
-#endif
static void vfio_ccw_class_init(ObjectClass *klass, void *data)
{
@@ -695,9 +693,10 @@ static void vfio_ccw_class_init(ObjectClass *klass, void *data)
S390CCWDeviceClass *cdc = S390_CCW_DEVICE_CLASS(klass);
device_class_set_props(dc, vfio_ccw_properties);
-#ifdef CONFIG_IOMMUFD
- object_class_property_add_str(klass, "fd", NULL, vfio_ccw_set_fd);
-#endif
+ if (iommufd_builtin()) {
+ device_class_set_props(dc, vfio_ccw_iommufd_properties);
+ object_class_property_add_str(klass, "fd", NULL, vfio_ccw_set_fd);
+ }
dc->vmsd = &vfio_ccw_vmstate;
dc->desc = "VFIO-based subchannel assignment";
set_bit(DEVICE_CATEGORY_MISC, dc->categories);
@@ -716,11 +715,11 @@ static void vfio_ccw_class_init(ObjectClass *klass, void *data)
object_class_property_set_description(klass, /* 3.0 */
"force-orb-pfch",
"Force unlimited prefetch");
-#ifdef CONFIG_IOMMUFD
- object_class_property_set_description(klass, /* 9.0 */
- "iommufd",
- "Set host IOMMUFD backend device");
-#endif
+ if (iommufd_builtin()) {
+ object_class_property_set_description(klass, /* 9.0 */
+ "iommufd",
+ "Set host IOMMUFD backend device");
+ }
object_class_property_set_description(klass, /* 9.2 */
"loadparm",
"Define which devices that can be used for booting");
diff --git a/hw/vfio/meson.build b/hw/vfio/meson.build
index 510ebe6d720..bd6e1d999e4 100644
--- a/hw/vfio/meson.build
+++ b/hw/vfio/meson.build
@@ -7,7 +7,6 @@ vfio_ss.add(when: 'CONFIG_PSERIES', if_true: files('spapr.c'))
vfio_ss.add(when: 'CONFIG_VFIO_PCI', if_true: files(
'pci-quirks.c',
))
-vfio_ss.add(when: 'CONFIG_VFIO_CCW', if_true: files('ccw.c'))
vfio_ss.add(when: 'CONFIG_VFIO_PLATFORM', if_true: files('platform.c'))
specific_ss.add_all(when: 'CONFIG_VFIO', if_true: vfio_ss)
@@ -26,6 +25,7 @@ system_ss.add(when: ['CONFIG_VFIO', 'CONFIG_IOMMUFD'], if_true: files(
'iommufd.c',
))
system_ss.add(when: 'CONFIG_VFIO_AP', if_true: files('ap.c'))
+system_ss.add(when: 'CONFIG_VFIO_CCW', if_true: files('ccw.c'))
system_ss.add(when: 'CONFIG_VFIO_PCI', if_true: files(
'display.c',
'pci.c',
--
2.47.1
^ permalink raw reply related [flat|nested] 57+ messages in thread
* [PATCH 14/14] hw/vfio/platform: Check CONFIG_IOMMUFD at runtime using iommufd_builtin
2025-03-07 18:03 [PATCH 00/14] hw/vfio: Build various objects once Philippe Mathieu-Daudé
` (12 preceding siblings ...)
2025-03-07 18:03 ` [PATCH 13/14] hw/vfio/ccw: " Philippe Mathieu-Daudé
@ 2025-03-07 18:03 ` Philippe Mathieu-Daudé
2025-03-07 19:20 ` Pierrick Bouvier
2025-03-07 20:48 ` Richard Henderson
2025-03-08 17:48 ` [PATCH 00/14] hw/vfio: Build various objects once Cédric Le Goater
14 siblings, 2 replies; 57+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-03-07 18:03 UTC (permalink / raw)
To: qemu-devel
Cc: Alex Williamson, Igor Mammedov, qemu-ppc, Thomas Huth,
Richard Henderson, Tony Krowiak, Ilya Leoshkevich,
Philippe Mathieu-Daudé, kvm, Yi Liu, Paolo Bonzini,
Zhenzhong Duan, Matthew Rosato, Eric Farman, Peter Xu,
Pierrick Bouvier, Daniel Henrique Barboza, Eric Auger, qemu-s390x,
Jason Herne, Cédric Le Goater, David Hildenbrand,
Alex Bennée, Harsh Prateek Bora, Nicholas Piggin,
Halil Pasic, Christian Borntraeger
Convert the compile time check on the CONFIG_IOMMUFD definition
by a runtime one by calling iommufd_builtin().
Since the file doesn't use any target-specific knowledge anymore,
move it to system_ss[] to build it once.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/vfio/platform.c | 25 ++++++++++++-------------
hw/vfio/meson.build | 2 +-
2 files changed, 13 insertions(+), 14 deletions(-)
diff --git a/hw/vfio/platform.c b/hw/vfio/platform.c
index 67bc57409c1..265c550b747 100644
--- a/hw/vfio/platform.c
+++ b/hw/vfio/platform.c
@@ -15,7 +15,6 @@
*/
#include "qemu/osdep.h"
-#include CONFIG_DEVICES /* CONFIG_IOMMUFD */
#include "qapi/error.h"
#include <sys/ioctl.h>
#include <linux/vfio.h>
@@ -637,10 +636,11 @@ static const Property vfio_platform_dev_properties[] = {
DEFINE_PROP_UINT32("mmap-timeout-ms", VFIOPlatformDevice,
mmap_timeout, 1100),
DEFINE_PROP_BOOL("x-irqfd", VFIOPlatformDevice, irqfd_allowed, true),
-#ifdef CONFIG_IOMMUFD
+};
+
+static const Property vfio_platform_dev_iommufd_properties[] = {
DEFINE_PROP_LINK("iommufd", VFIOPlatformDevice, vbasedev.iommufd,
TYPE_IOMMUFD_BACKEND, IOMMUFDBackend *),
-#endif
};
static void vfio_platform_instance_init(Object *obj)
@@ -652,12 +652,10 @@ static void vfio_platform_instance_init(Object *obj)
DEVICE(vdev), false);
}
-#ifdef CONFIG_IOMMUFD
static void vfio_platform_set_fd(Object *obj, const char *str, Error **errp)
{
vfio_device_set_fd(&VFIO_PLATFORM_DEVICE(obj)->vbasedev, str, errp);
}
-#endif
static void vfio_platform_class_init(ObjectClass *klass, void *data)
{
@@ -666,9 +664,10 @@ static void vfio_platform_class_init(ObjectClass *klass, void *data)
dc->realize = vfio_platform_realize;
device_class_set_props(dc, vfio_platform_dev_properties);
-#ifdef CONFIG_IOMMUFD
- object_class_property_add_str(klass, "fd", NULL, vfio_platform_set_fd);
-#endif
+ if (iommufd_builtin()) {
+ device_class_set_props(dc, vfio_platform_dev_iommufd_properties);
+ object_class_property_add_str(klass, "fd", NULL, vfio_platform_set_fd);
+ }
dc->vmsd = &vfio_platform_vmstate;
dc->desc = "VFIO-based platform device assignment";
sbc->connect_irq_notifier = vfio_start_irqfd_injection;
@@ -692,11 +691,11 @@ static void vfio_platform_class_init(ObjectClass *klass, void *data)
object_class_property_set_description(klass, /* 2.6 */
"sysfsdev",
"Host sysfs path of assigned device");
-#ifdef CONFIG_IOMMUFD
- object_class_property_set_description(klass, /* 9.0 */
- "iommufd",
- "Set host IOMMUFD backend device");
-#endif
+ if (iommufd_builtin()) {
+ object_class_property_set_description(klass, /* 9.0 */
+ "iommufd",
+ "Set host IOMMUFD backend device");
+ }
}
static const TypeInfo vfio_platform_dev_info = {
diff --git a/hw/vfio/meson.build b/hw/vfio/meson.build
index bd6e1d999e4..e5010db2c71 100644
--- a/hw/vfio/meson.build
+++ b/hw/vfio/meson.build
@@ -7,7 +7,6 @@ vfio_ss.add(when: 'CONFIG_PSERIES', if_true: files('spapr.c'))
vfio_ss.add(when: 'CONFIG_VFIO_PCI', if_true: files(
'pci-quirks.c',
))
-vfio_ss.add(when: 'CONFIG_VFIO_PLATFORM', if_true: files('platform.c'))
specific_ss.add_all(when: 'CONFIG_VFIO', if_true: vfio_ss)
@@ -26,6 +25,7 @@ system_ss.add(when: ['CONFIG_VFIO', 'CONFIG_IOMMUFD'], if_true: files(
))
system_ss.add(when: 'CONFIG_VFIO_AP', if_true: files('ap.c'))
system_ss.add(when: 'CONFIG_VFIO_CCW', if_true: files('ccw.c'))
+system_ss.add(when: 'CONFIG_VFIO_PLATFORM', if_true: files('platform.c'))
system_ss.add(when: 'CONFIG_VFIO_PCI', if_true: files(
'display.c',
'pci.c',
--
2.47.1
^ permalink raw reply related [flat|nested] 57+ messages in thread
* Re: [PATCH 01/14] hw/vfio/common: Include missing 'system/tcg.h' header
2025-03-07 18:03 ` [PATCH 01/14] hw/vfio/common: Include missing 'system/tcg.h' header Philippe Mathieu-Daudé
@ 2025-03-07 19:14 ` Pierrick Bouvier
2025-03-07 19:35 ` Richard Henderson
2025-03-08 17:39 ` Cédric Le Goater
2 siblings, 0 replies; 57+ messages in thread
From: Pierrick Bouvier @ 2025-03-07 19:14 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, qemu-devel
Cc: Alex Williamson, Igor Mammedov, qemu-ppc, Thomas Huth,
Richard Henderson, Tony Krowiak, Ilya Leoshkevich, kvm, Yi Liu,
Paolo Bonzini, Zhenzhong Duan, Matthew Rosato, Eric Farman,
Peter Xu, Daniel Henrique Barboza, Eric Auger, qemu-s390x,
Jason Herne, Cédric Le Goater, David Hildenbrand,
Alex Bennée, Harsh Prateek Bora, Nicholas Piggin,
Halil Pasic, Christian Borntraeger
On 3/7/25 10:03, Philippe Mathieu-Daudé wrote:
> Always include necessary headers explicitly, to avoid
> when refactoring unrelated ones:
>
> hw/vfio/common.c:1176:45: error: implicit declaration of function ‘tcg_enabled’;
> 1176 | tcg_enabled() ? DIRTY_CLIENTS_ALL :
> | ^~~~~~~~~~~
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> hw/vfio/common.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/hw/vfio/common.c b/hw/vfio/common.c
> index 7a4010ef4ee..b1596b6bf64 100644
> --- a/hw/vfio/common.c
> +++ b/hw/vfio/common.c
> @@ -42,6 +42,7 @@
> #include "migration/misc.h"
> #include "migration/blocker.h"
> #include "migration/qemu-file.h"
> +#include "system/tcg.h"
> #include "system/tpm.h"
>
> VFIODeviceList vfio_device_list =
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
^ permalink raw reply [flat|nested] 57+ messages in thread
* Re: [PATCH 02/14] hw/vfio/spapr: Do not include <linux/kvm.h>
2025-03-07 18:03 ` [PATCH 02/14] hw/vfio/spapr: Do not include <linux/kvm.h> Philippe Mathieu-Daudé
@ 2025-03-07 19:14 ` Pierrick Bouvier
2025-03-07 19:39 ` Richard Henderson
2025-03-08 17:39 ` Cédric Le Goater
2 siblings, 0 replies; 57+ messages in thread
From: Pierrick Bouvier @ 2025-03-07 19:14 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, qemu-devel
Cc: Alex Williamson, Igor Mammedov, qemu-ppc, Thomas Huth,
Richard Henderson, Tony Krowiak, Ilya Leoshkevich, kvm, Yi Liu,
Paolo Bonzini, Zhenzhong Duan, Matthew Rosato, Eric Farman,
Peter Xu, Daniel Henrique Barboza, Eric Auger, qemu-s390x,
Jason Herne, Cédric Le Goater, David Hildenbrand,
Alex Bennée, Harsh Prateek Bora, Nicholas Piggin,
Halil Pasic, Christian Borntraeger
On 3/7/25 10:03, Philippe Mathieu-Daudé wrote:
> <linux/kvm.h> is already include by "system/kvm.h" in the next line.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> hw/vfio/spapr.c | 3 ---
> 1 file changed, 3 deletions(-)
>
> diff --git a/hw/vfio/spapr.c b/hw/vfio/spapr.c
> index ad4c499eafe..9b5ad05bb1c 100644
> --- a/hw/vfio/spapr.c
> +++ b/hw/vfio/spapr.c
> @@ -11,9 +11,6 @@
> #include "qemu/osdep.h"
> #include <sys/ioctl.h>
> #include <linux/vfio.h>
> -#ifdef CONFIG_KVM
> -#include <linux/kvm.h>
> -#endif
> #include "system/kvm.h"
> #include "exec/address-spaces.h"
>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
^ permalink raw reply [flat|nested] 57+ messages in thread
* Re: [PATCH 03/14] hw/vfio: Compile some common objects once
2025-03-07 18:03 ` [PATCH 03/14] hw/vfio: Compile some common objects once Philippe Mathieu-Daudé
@ 2025-03-07 19:15 ` Pierrick Bouvier
2025-03-07 19:40 ` Richard Henderson
2025-03-08 17:39 ` Cédric Le Goater
2 siblings, 0 replies; 57+ messages in thread
From: Pierrick Bouvier @ 2025-03-07 19:15 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, qemu-devel
Cc: Alex Williamson, Igor Mammedov, qemu-ppc, Thomas Huth,
Richard Henderson, Tony Krowiak, Ilya Leoshkevich, kvm, Yi Liu,
Paolo Bonzini, Zhenzhong Duan, Matthew Rosato, Eric Farman,
Peter Xu, Daniel Henrique Barboza, Eric Auger, qemu-s390x,
Jason Herne, Cédric Le Goater, David Hildenbrand,
Alex Bennée, Harsh Prateek Bora, Nicholas Piggin,
Halil Pasic, Christian Borntraeger
On 3/7/25 10:03, Philippe Mathieu-Daudé wrote:
> Some files don't rely on any target-specific knowledge
> and can be compiled once:
>
> - helpers.c
> - container-base.c
> - migration.c (removing unnecessary "exec/ram_addr.h")
> - migration-multifd.c
> - cpr.c
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> hw/vfio/migration.c | 1 -
> hw/vfio/meson.build | 13 ++++++++-----
> 2 files changed, 8 insertions(+), 6 deletions(-)
>
> diff --git a/hw/vfio/migration.c b/hw/vfio/migration.c
> index 416643ddd69..fbff46cfc35 100644
> --- a/hw/vfio/migration.c
> +++ b/hw/vfio/migration.c
> @@ -27,7 +27,6 @@
> #include "qapi/error.h"
> #include "qapi/qapi-events-vfio.h"
> #include "exec/ramlist.h"
> -#include "exec/ram_addr.h"
> #include "pci.h"
> #include "trace.h"
> #include "hw/hw.h"
> diff --git a/hw/vfio/meson.build b/hw/vfio/meson.build
> index 260d65febd6..8e376cfcbf8 100644
> --- a/hw/vfio/meson.build
> +++ b/hw/vfio/meson.build
> @@ -1,12 +1,7 @@
> vfio_ss = ss.source_set()
> vfio_ss.add(files(
> - 'helpers.c',
> 'common.c',
> - 'container-base.c',
> 'container.c',
> - 'migration.c',
> - 'migration-multifd.c',
> - 'cpr.c',
> ))
> vfio_ss.add(when: 'CONFIG_PSERIES', if_true: files('spapr.c'))
> vfio_ss.add(when: 'CONFIG_IOMMUFD', if_true: files(
> @@ -25,3 +20,11 @@ vfio_ss.add(when: 'CONFIG_VFIO_AP', if_true: files('ap.c'))
> vfio_ss.add(when: 'CONFIG_VFIO_IGD', if_true: files('igd.c'))
>
> specific_ss.add_all(when: 'CONFIG_VFIO', if_true: vfio_ss)
> +
> +system_ss.add(when: 'CONFIG_VFIO', if_true: files(
> + 'helpers.c',
> + 'container-base.c',
> + 'migration.c',
> + 'migration-multifd.c',
> + 'cpr.c',
> +))
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
^ permalink raw reply [flat|nested] 57+ messages in thread
* Re: [PATCH 04/14] hw/vfio: Compile more objects once
2025-03-07 18:03 ` [PATCH 04/14] hw/vfio: Compile more " Philippe Mathieu-Daudé
@ 2025-03-07 19:15 ` Pierrick Bouvier
2025-03-07 19:40 ` Richard Henderson
2025-03-08 17:45 ` Cédric Le Goater
2 siblings, 0 replies; 57+ messages in thread
From: Pierrick Bouvier @ 2025-03-07 19:15 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, qemu-devel
Cc: Alex Williamson, Igor Mammedov, qemu-ppc, Thomas Huth,
Richard Henderson, Tony Krowiak, Ilya Leoshkevich, kvm, Yi Liu,
Paolo Bonzini, Zhenzhong Duan, Matthew Rosato, Eric Farman,
Peter Xu, Daniel Henrique Barboza, Eric Auger, qemu-s390x,
Jason Herne, Cédric Le Goater, David Hildenbrand,
Alex Bennée, Harsh Prateek Bora, Nicholas Piggin,
Halil Pasic, Christian Borntraeger
On 3/7/25 10:03, Philippe Mathieu-Daudé wrote:
> These files depend on the VFIO symbol in their Kconfig
> definition. They don't rely on target specific definitions,
> move them to system_ss[] to build them once.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> hw/vfio/meson.build | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/hw/vfio/meson.build b/hw/vfio/meson.build
> index 8e376cfcbf8..2972c6ff8de 100644
> --- a/hw/vfio/meson.build
> +++ b/hw/vfio/meson.build
> @@ -14,13 +14,13 @@ vfio_ss.add(when: 'CONFIG_VFIO_PCI', if_true: files(
> ))
> vfio_ss.add(when: 'CONFIG_VFIO_CCW', if_true: files('ccw.c'))
> vfio_ss.add(when: 'CONFIG_VFIO_PLATFORM', if_true: files('platform.c'))
> -vfio_ss.add(when: 'CONFIG_VFIO_XGMAC', if_true: files('calxeda-xgmac.c'))
> -vfio_ss.add(when: 'CONFIG_VFIO_AMD_XGBE', if_true: files('amd-xgbe.c'))
> vfio_ss.add(when: 'CONFIG_VFIO_AP', if_true: files('ap.c'))
> -vfio_ss.add(when: 'CONFIG_VFIO_IGD', if_true: files('igd.c'))
>
> specific_ss.add_all(when: 'CONFIG_VFIO', if_true: vfio_ss)
>
> +system_ss.add(when: 'CONFIG_VFIO_XGMAC', if_true: files('calxeda-xgmac.c'))
> +system_ss.add(when: 'CONFIG_VFIO_AMD_XGBE', if_true: files('amd-xgbe.c'))
> +system_ss.add(when: 'CONFIG_VFIO_IGD', if_true: files('igd.c'))
> system_ss.add(when: 'CONFIG_VFIO', if_true: files(
> 'helpers.c',
> 'container-base.c',
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
^ permalink raw reply [flat|nested] 57+ messages in thread
* Re: [PATCH 05/14] hw/vfio: Compile iommufd.c once
2025-03-07 18:03 ` [PATCH 05/14] hw/vfio: Compile iommufd.c once Philippe Mathieu-Daudé
@ 2025-03-07 19:16 ` Pierrick Bouvier
2025-03-07 19:41 ` Richard Henderson
2025-03-08 17:45 ` Cédric Le Goater
2 siblings, 0 replies; 57+ messages in thread
From: Pierrick Bouvier @ 2025-03-07 19:16 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, qemu-devel
Cc: Alex Williamson, Igor Mammedov, qemu-ppc, Thomas Huth,
Richard Henderson, Tony Krowiak, Ilya Leoshkevich, kvm, Yi Liu,
Paolo Bonzini, Zhenzhong Duan, Matthew Rosato, Eric Farman,
Peter Xu, Daniel Henrique Barboza, Eric Auger, qemu-s390x,
Jason Herne, Cédric Le Goater, David Hildenbrand,
Alex Bennée, Harsh Prateek Bora, Nicholas Piggin,
Halil Pasic, Christian Borntraeger
On 3/7/25 10:03, Philippe Mathieu-Daudé wrote:
> Removing unused "exec/ram_addr.h" header allow to compile
> iommufd.c once for all targets.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> hw/vfio/iommufd.c | 1 -
> hw/vfio/meson.build | 6 +++---
> 2 files changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/hw/vfio/iommufd.c b/hw/vfio/iommufd.c
> index df61edffc08..42c8412bbf5 100644
> --- a/hw/vfio/iommufd.c
> +++ b/hw/vfio/iommufd.c
> @@ -25,7 +25,6 @@
> #include "qemu/cutils.h"
> #include "qemu/chardev_open.h"
> #include "pci.h"
> -#include "exec/ram_addr.h"
>
> static int iommufd_cdev_map(const VFIOContainerBase *bcontainer, hwaddr iova,
> ram_addr_t size, void *vaddr, bool readonly)
> diff --git a/hw/vfio/meson.build b/hw/vfio/meson.build
> index 2972c6ff8de..fea6dbe88cd 100644
> --- a/hw/vfio/meson.build
> +++ b/hw/vfio/meson.build
> @@ -4,9 +4,6 @@ vfio_ss.add(files(
> 'container.c',
> ))
> vfio_ss.add(when: 'CONFIG_PSERIES', if_true: files('spapr.c'))
> -vfio_ss.add(when: 'CONFIG_IOMMUFD', if_true: files(
> - 'iommufd.c',
> -))
> vfio_ss.add(when: 'CONFIG_VFIO_PCI', if_true: files(
> 'display.c',
> 'pci-quirks.c',
> @@ -28,3 +25,6 @@ system_ss.add(when: 'CONFIG_VFIO', if_true: files(
> 'migration-multifd.c',
> 'cpr.c',
> ))
> +system_ss.add(when: ['CONFIG_VFIO', 'CONFIG_IOMMUFD'], if_true: files(
> + 'iommufd.c',
> +))
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
^ permalink raw reply [flat|nested] 57+ messages in thread
* Re: [PATCH 06/14] system: Declare qemu_[min/max]rampagesize() in 'system/hostmem.h'
2025-03-07 18:03 ` [PATCH 06/14] system: Declare qemu_[min/max]rampagesize() in 'system/hostmem.h' Philippe Mathieu-Daudé
@ 2025-03-07 19:16 ` Pierrick Bouvier
2025-03-07 21:12 ` Philippe Mathieu-Daudé
1 sibling, 0 replies; 57+ messages in thread
From: Pierrick Bouvier @ 2025-03-07 19:16 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, qemu-devel
Cc: Alex Williamson, Igor Mammedov, qemu-ppc, Thomas Huth,
Richard Henderson, Tony Krowiak, Ilya Leoshkevich, kvm, Yi Liu,
Paolo Bonzini, Zhenzhong Duan, Matthew Rosato, Eric Farman,
Peter Xu, Daniel Henrique Barboza, Eric Auger, qemu-s390x,
Jason Herne, Cédric Le Goater, David Hildenbrand,
Alex Bennée, Harsh Prateek Bora, Nicholas Piggin,
Halil Pasic, Christian Borntraeger
On 3/7/25 10:03, Philippe Mathieu-Daudé wrote:
> Both qemu_minrampagesize() and qemu_maxrampagesize() are
> related to host memory backends. Move their prototype
> declaration to "system/hostmem.h".
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> include/exec/ram_addr.h | 3 ---
> include/system/hostmem.h | 3 +++
> hw/ppc/spapr_caps.c | 1 +
> hw/s390x/s390-virtio-ccw.c | 1 +
> hw/vfio/spapr.c | 1 +
> 5 files changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/include/exec/ram_addr.h b/include/exec/ram_addr.h
> index 94bb3ccbe42..ccc8df561af 100644
> --- a/include/exec/ram_addr.h
> +++ b/include/exec/ram_addr.h
> @@ -101,9 +101,6 @@ static inline unsigned long int ramblock_recv_bitmap_offset(void *host_addr,
>
> bool ramblock_is_pmem(RAMBlock *rb);
>
> -long qemu_minrampagesize(void);
> -long qemu_maxrampagesize(void);
> -
> /**
> * qemu_ram_alloc_from_file,
> * qemu_ram_alloc_from_fd: Allocate a ram block from the specified backing
> diff --git a/include/system/hostmem.h b/include/system/hostmem.h
> index 5c21ca55c01..62642e602ca 100644
> --- a/include/system/hostmem.h
> +++ b/include/system/hostmem.h
> @@ -93,4 +93,7 @@ bool host_memory_backend_is_mapped(HostMemoryBackend *backend);
> size_t host_memory_backend_pagesize(HostMemoryBackend *memdev);
> char *host_memory_backend_get_name(HostMemoryBackend *backend);
>
> +long qemu_minrampagesize(void);
> +long qemu_maxrampagesize(void);
> +
> #endif
> diff --git a/hw/ppc/spapr_caps.c b/hw/ppc/spapr_caps.c
> index 904bff87ce1..9e53d0c1fd1 100644
> --- a/hw/ppc/spapr_caps.c
> +++ b/hw/ppc/spapr_caps.c
> @@ -34,6 +34,7 @@
> #include "kvm_ppc.h"
> #include "migration/vmstate.h"
> #include "system/tcg.h"
> +#include "system/hostmem.h"
>
> #include "hw/ppc/spapr.h"
>
> diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c
> index 51ae0c133d8..1261d93b7ce 100644
> --- a/hw/s390x/s390-virtio-ccw.c
> +++ b/hw/s390x/s390-virtio-ccw.c
> @@ -41,6 +41,7 @@
> #include "hw/s390x/tod.h"
> #include "system/system.h"
> #include "system/cpus.h"
> +#include "system/hostmem.h"
> #include "target/s390x/kvm/pv.h"
> #include "migration/blocker.h"
> #include "qapi/visitor.h"
> diff --git a/hw/vfio/spapr.c b/hw/vfio/spapr.c
> index 9b5ad05bb1c..1a5d1611f2c 100644
> --- a/hw/vfio/spapr.c
> +++ b/hw/vfio/spapr.c
> @@ -12,6 +12,7 @@
> #include <sys/ioctl.h>
> #include <linux/vfio.h>
> #include "system/kvm.h"
> +#include "system/hostmem.h"
> #include "exec/address-spaces.h"
>
> #include "hw/vfio/vfio-common.h"
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
^ permalink raw reply [flat|nested] 57+ messages in thread
* Re: [PATCH 07/14] hw/vfio: Compile display.c once
2025-03-07 18:03 ` [PATCH 07/14] hw/vfio: Compile display.c once Philippe Mathieu-Daudé
@ 2025-03-07 19:17 ` Pierrick Bouvier
2025-03-07 19:42 ` Richard Henderson
2025-03-08 17:46 ` Cédric Le Goater
2 siblings, 0 replies; 57+ messages in thread
From: Pierrick Bouvier @ 2025-03-07 19:17 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, qemu-devel
Cc: Alex Williamson, Igor Mammedov, qemu-ppc, Thomas Huth,
Richard Henderson, Tony Krowiak, Ilya Leoshkevich, kvm, Yi Liu,
Paolo Bonzini, Zhenzhong Duan, Matthew Rosato, Eric Farman,
Peter Xu, Daniel Henrique Barboza, Eric Auger, qemu-s390x,
Jason Herne, Cédric Le Goater, David Hildenbrand,
Alex Bennée, Harsh Prateek Bora, Nicholas Piggin,
Halil Pasic, Christian Borntraeger
On 3/7/25 10:03, Philippe Mathieu-Daudé wrote:
> display.c doesn't rely on target specific definitions,
> move it to system_ss[] to build it once.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> hw/vfio/meson.build | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/hw/vfio/meson.build b/hw/vfio/meson.build
> index fea6dbe88cd..96e342aa8cb 100644
> --- a/hw/vfio/meson.build
> +++ b/hw/vfio/meson.build
> @@ -5,7 +5,6 @@ vfio_ss.add(files(
> ))
> vfio_ss.add(when: 'CONFIG_PSERIES', if_true: files('spapr.c'))
> vfio_ss.add(when: 'CONFIG_VFIO_PCI', if_true: files(
> - 'display.c',
> 'pci-quirks.c',
> 'pci.c',
> ))
> @@ -28,3 +27,6 @@ system_ss.add(when: 'CONFIG_VFIO', if_true: files(
> system_ss.add(when: ['CONFIG_VFIO', 'CONFIG_IOMMUFD'], if_true: files(
> 'iommufd.c',
> ))
> +system_ss.add(when: 'CONFIG_VFIO_PCI', if_true: files(
> + 'display.c',
> +))
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
^ permalink raw reply [flat|nested] 57+ messages in thread
* Re: [PATCH 08/14] system/kvm: Expose kvm_irqchip_[add,remove]_change_notifier()
2025-03-07 18:03 ` [PATCH 08/14] system/kvm: Expose kvm_irqchip_[add, remove]_change_notifier() Philippe Mathieu-Daudé
@ 2025-03-07 19:17 ` Pierrick Bouvier
2025-03-07 20:09 ` Richard Henderson
1 sibling, 0 replies; 57+ messages in thread
From: Pierrick Bouvier @ 2025-03-07 19:17 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, qemu-devel
Cc: Alex Williamson, Igor Mammedov, qemu-ppc, Thomas Huth,
Richard Henderson, Tony Krowiak, Ilya Leoshkevich, kvm, Yi Liu,
Paolo Bonzini, Zhenzhong Duan, Matthew Rosato, Eric Farman,
Peter Xu, Daniel Henrique Barboza, Eric Auger, qemu-s390x,
Jason Herne, Cédric Le Goater, David Hildenbrand,
Alex Bennée, Harsh Prateek Bora, Nicholas Piggin,
Halil Pasic, Christian Borntraeger
On 3/7/25 10:03, Philippe Mathieu-Daudé wrote:
> Currently kvm_irqchip_add_irqfd_notifier() and
> kvm_irqchip_remove_irqfd_notifier() are only declared on
> target specific code. There is not particular reason to,
> as their prototypes don't use anything target related.
>
> Move their declaration with common prototypes, and
> implement their stub.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> include/system/kvm.h | 8 ++++----
> accel/stubs/kvm-stub.c | 12 ++++++++++++
> 2 files changed, 16 insertions(+), 4 deletions(-)
>
> diff --git a/include/system/kvm.h b/include/system/kvm.h
> index ab17c09a551..75673fb794e 100644
> --- a/include/system/kvm.h
> +++ b/include/system/kvm.h
> @@ -412,10 +412,6 @@ int kvm_irqchip_send_msi(KVMState *s, MSIMessage msg);
>
> void kvm_irqchip_add_irq_route(KVMState *s, int gsi, int irqchip, int pin);
>
> -void kvm_irqchip_add_change_notifier(Notifier *n);
> -void kvm_irqchip_remove_change_notifier(Notifier *n);
> -void kvm_irqchip_change_notify(void);
> -
> struct kvm_guest_debug;
> struct kvm_debug_exit_arch;
>
> @@ -517,6 +513,10 @@ void kvm_irqchip_release_virq(KVMState *s, int virq);
> void kvm_add_routing_entry(KVMState *s,
> struct kvm_irq_routing_entry *entry);
>
> +void kvm_irqchip_add_change_notifier(Notifier *n);
> +void kvm_irqchip_remove_change_notifier(Notifier *n);
> +void kvm_irqchip_change_notify(void);
> +
> int kvm_irqchip_add_irqfd_notifier_gsi(KVMState *s, EventNotifier *n,
> EventNotifier *rn, int virq);
> int kvm_irqchip_remove_irqfd_notifier_gsi(KVMState *s, EventNotifier *n,
> diff --git a/accel/stubs/kvm-stub.c b/accel/stubs/kvm-stub.c
> index ecfd7636f5f..a305b33d84d 100644
> --- a/accel/stubs/kvm-stub.c
> +++ b/accel/stubs/kvm-stub.c
> @@ -83,6 +83,18 @@ void kvm_irqchip_change_notify(void)
> {
> }
>
> +int kvm_irqchip_add_irqfd_notifier(KVMState *s, EventNotifier *n,
> + EventNotifier *rn, qemu_irq irq)
> +{
> + return -ENOSYS;
> +}
> +
> +int kvm_irqchip_remove_irqfd_notifier(KVMState *s, EventNotifier *n,
> + qemu_irq irq)
> +{
> + return -ENOSYS;
> +}
> +
> int kvm_irqchip_add_irqfd_notifier_gsi(KVMState *s, EventNotifier *n,
> EventNotifier *rn, int virq)
> {
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
^ permalink raw reply [flat|nested] 57+ messages in thread
* Re: [PATCH 09/14] hw/vfio/pci: Convert CONFIG_KVM check to runtime one
2025-03-07 18:03 ` [PATCH 09/14] hw/vfio/pci: Convert CONFIG_KVM check to runtime one Philippe Mathieu-Daudé
@ 2025-03-07 19:18 ` Pierrick Bouvier
2025-03-07 20:11 ` Richard Henderson
2025-03-08 17:46 ` Cédric Le Goater
2 siblings, 0 replies; 57+ messages in thread
From: Pierrick Bouvier @ 2025-03-07 19:18 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, qemu-devel
Cc: Alex Williamson, Igor Mammedov, qemu-ppc, Thomas Huth,
Richard Henderson, Tony Krowiak, Ilya Leoshkevich, kvm, Yi Liu,
Paolo Bonzini, Zhenzhong Duan, Matthew Rosato, Eric Farman,
Peter Xu, Daniel Henrique Barboza, Eric Auger, qemu-s390x,
Jason Herne, Cédric Le Goater, David Hildenbrand,
Alex Bennée, Harsh Prateek Bora, Nicholas Piggin,
Halil Pasic, Christian Borntraeger
On 3/7/25 10:03, Philippe Mathieu-Daudé wrote:
> Use the runtime kvm_enabled() helper to check whether
> KVM is available or not.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> hw/vfio/pci.c | 19 +++++++++----------
> 1 file changed, 9 insertions(+), 10 deletions(-)
>
> diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c
> index fdbc15885d4..9872884ff8a 100644
> --- a/hw/vfio/pci.c
> +++ b/hw/vfio/pci.c
> @@ -118,8 +118,13 @@ static void vfio_intx_eoi(VFIODevice *vbasedev)
>
> static bool vfio_intx_enable_kvm(VFIOPCIDevice *vdev, Error **errp)
> {
> -#ifdef CONFIG_KVM
> - int irq_fd = event_notifier_get_fd(&vdev->intx.interrupt);
> + int irq_fd;
> +
> + if (!kvm_enabled()) {
> + return true;
> + }
> +
> + irq_fd = event_notifier_get_fd(&vdev->intx.interrupt);
>
> if (vdev->no_kvm_intx || !kvm_irqfds_enabled() ||
> vdev->intx.route.mode != PCI_INTX_ENABLED ||
> @@ -171,16 +176,13 @@ fail_irqfd:
> fail:
> qemu_set_fd_handler(irq_fd, vfio_intx_interrupt, NULL, vdev);
> vfio_unmask_single_irqindex(&vdev->vbasedev, VFIO_PCI_INTX_IRQ_INDEX);
> +
> return false;
> -#else
> - return true;
> -#endif
> }
>
> static void vfio_intx_disable_kvm(VFIOPCIDevice *vdev)
> {
> -#ifdef CONFIG_KVM
> - if (!vdev->intx.kvm_accel) {
> + if (!kvm_enabled() || !vdev->intx.kvm_accel) {
> return;
> }
>
> @@ -211,7 +213,6 @@ static void vfio_intx_disable_kvm(VFIOPCIDevice *vdev)
> vfio_unmask_single_irqindex(&vdev->vbasedev, VFIO_PCI_INTX_IRQ_INDEX);
>
> trace_vfio_intx_disable_kvm(vdev->vbasedev.name);
> -#endif
> }
>
> static void vfio_intx_update(VFIOPCIDevice *vdev, PCIINTxRoute *route)
> @@ -278,7 +279,6 @@ static bool vfio_intx_enable(VFIOPCIDevice *vdev, Error **errp)
> vdev->intx.pin = pin - 1; /* Pin A (1) -> irq[0] */
> pci_config_set_interrupt_pin(vdev->pdev.config, pin);
>
> -#ifdef CONFIG_KVM
> /*
> * Only conditional to avoid generating error messages on platforms
> * where we won't actually use the result anyway.
> @@ -287,7 +287,6 @@ static bool vfio_intx_enable(VFIOPCIDevice *vdev, Error **errp)
> vdev->intx.route = pci_device_route_intx_to_irq(&vdev->pdev,
> vdev->intx.pin);
> }
> -#endif
>
> ret = event_notifier_init(&vdev->intx.interrupt, 0);
> if (ret) {
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
^ permalink raw reply [flat|nested] 57+ messages in thread
* Re: [PATCH 10/14] system/iommufd: Introduce iommufd_builtin() helper
2025-03-07 18:03 ` [PATCH 10/14] system/iommufd: Introduce iommufd_builtin() helper Philippe Mathieu-Daudé
@ 2025-03-07 19:18 ` Pierrick Bouvier
2025-03-07 20:33 ` Richard Henderson
1 sibling, 0 replies; 57+ messages in thread
From: Pierrick Bouvier @ 2025-03-07 19:18 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, qemu-devel
Cc: Alex Williamson, Igor Mammedov, qemu-ppc, Thomas Huth,
Richard Henderson, Tony Krowiak, Ilya Leoshkevich, kvm, Yi Liu,
Paolo Bonzini, Zhenzhong Duan, Matthew Rosato, Eric Farman,
Peter Xu, Daniel Henrique Barboza, Eric Auger, qemu-s390x,
Jason Herne, Cédric Le Goater, David Hildenbrand,
Alex Bennée, Harsh Prateek Bora, Nicholas Piggin,
Halil Pasic, Christian Borntraeger
On 3/7/25 10:03, Philippe Mathieu-Daudé wrote:
> iommufd_builtin() can be used to check at runtime whether
> the IOMMUFD feature is built in a qemu-system binary.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> docs/devel/vfio-iommufd.rst | 2 +-
> include/system/iommufd.h | 8 ++++++++
> 2 files changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/docs/devel/vfio-iommufd.rst b/docs/devel/vfio-iommufd.rst
> index 3d1c11f175e..08882094eee 100644
> --- a/docs/devel/vfio-iommufd.rst
> +++ b/docs/devel/vfio-iommufd.rst
> @@ -88,7 +88,7 @@ Step 2: configure QEMU
> ----------------------
>
> Interactions with the ``/dev/iommu`` are abstracted by a new iommufd
> -object (compiled in with the ``CONFIG_IOMMUFD`` option).
> +object (which availability can be checked at runtime using ``iommufd_builtin()``).
>
> Any QEMU device (e.g. VFIO device) wishing to use ``/dev/iommu`` must
> be linked with an iommufd object. It gets a new optional property
> diff --git a/include/system/iommufd.h b/include/system/iommufd.h
> index cbab75bfbf6..ce459254025 100644
> --- a/include/system/iommufd.h
> +++ b/include/system/iommufd.h
> @@ -63,4 +63,12 @@ bool iommufd_backend_get_dirty_bitmap(IOMMUFDBackend *be, uint32_t hwpt_id,
> Error **errp);
>
> #define TYPE_HOST_IOMMU_DEVICE_IOMMUFD TYPE_HOST_IOMMU_DEVICE "-iommufd"
> +
> +static inline bool iommufd_builtin(void)
> +{
> + bool ambig = false;
> +
> + return object_resolve_path_type("", TYPE_IOMMUFD_BACKEND, &ambig) || ambig;
> +}
> +
> #endif
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
^ permalink raw reply [flat|nested] 57+ messages in thread
* Re: [PATCH 11/14] hw/vfio/pci: Check CONFIG_IOMMUFD at runtime using iommufd_builtin()
2025-03-07 18:03 ` [PATCH 11/14] hw/vfio/pci: Check CONFIG_IOMMUFD at runtime using iommufd_builtin() Philippe Mathieu-Daudé
@ 2025-03-07 19:19 ` Pierrick Bouvier
2025-03-07 20:35 ` Richard Henderson
1 sibling, 0 replies; 57+ messages in thread
From: Pierrick Bouvier @ 2025-03-07 19:19 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, qemu-devel
Cc: Alex Williamson, Igor Mammedov, qemu-ppc, Thomas Huth,
Richard Henderson, Tony Krowiak, Ilya Leoshkevich, kvm, Yi Liu,
Paolo Bonzini, Zhenzhong Duan, Matthew Rosato, Eric Farman,
Peter Xu, Daniel Henrique Barboza, Eric Auger, qemu-s390x,
Jason Herne, Cédric Le Goater, David Hildenbrand,
Alex Bennée, Harsh Prateek Bora, Nicholas Piggin,
Halil Pasic, Christian Borntraeger
On 3/7/25 10:03, Philippe Mathieu-Daudé wrote:
> Convert the compile time check on the CONFIG_IOMMUFD definition
> by a runtime one by calling iommufd_builtin().
>
> Since the file doesn't use any target-specific knowledge anymore,
> move it to system_ss[] to build it once.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> hw/vfio/pci.c | 38 ++++++++++++++++++--------------------
> hw/vfio/meson.build | 2 +-
> 2 files changed, 19 insertions(+), 21 deletions(-)
>
> diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c
> index 9872884ff8a..e83252766d1 100644
> --- a/hw/vfio/pci.c
> +++ b/hw/vfio/pci.c
> @@ -19,7 +19,6 @@
> */
>
> #include "qemu/osdep.h"
> -#include CONFIG_DEVICES /* CONFIG_IOMMUFD */
> #include <linux/vfio.h>
> #include <sys/ioctl.h>
>
> @@ -2973,11 +2972,10 @@ static void vfio_realize(PCIDevice *pdev, Error **errp)
> if (!(~vdev->host.domain || ~vdev->host.bus ||
> ~vdev->host.slot || ~vdev->host.function)) {
> error_setg(errp, "No provided host device");
> - error_append_hint(errp, "Use -device vfio-pci,host=DDDD:BB:DD.F "
> -#ifdef CONFIG_IOMMUFD
> - "or -device vfio-pci,fd=DEVICE_FD "
> -#endif
> - "or -device vfio-pci,sysfsdev=PATH_TO_DEVICE\n");
> + error_append_hint(errp, "Use -device vfio-pci,host=DDDD:BB:DD.F %s"
> + "or -device vfio-pci,sysfsdev=PATH_TO_DEVICE\n",
> + iommufd_builtin()
> + ? "or -device vfio-pci,fd=DEVICE_FD " : "");
> return;
> }
> vbasedev->sysfsdev =
> @@ -3412,19 +3410,18 @@ static const Property vfio_pci_dev_properties[] = {
> qdev_prop_nv_gpudirect_clique, uint8_t),
> DEFINE_PROP_OFF_AUTO_PCIBAR("x-msix-relocation", VFIOPCIDevice, msix_relo,
> OFF_AUTO_PCIBAR_OFF),
> -#ifdef CONFIG_IOMMUFD
> - DEFINE_PROP_LINK("iommufd", VFIOPCIDevice, vbasedev.iommufd,
> - TYPE_IOMMUFD_BACKEND, IOMMUFDBackend *),
> -#endif
> DEFINE_PROP_BOOL("skip-vsc-check", VFIOPCIDevice, skip_vsc_check, true),
> };
>
> -#ifdef CONFIG_IOMMUFD
> +static const Property vfio_pci_dev_iommufd_properties[] = {
> + DEFINE_PROP_LINK("iommufd", VFIOPCIDevice, vbasedev.iommufd,
> + TYPE_IOMMUFD_BACKEND, IOMMUFDBackend *),
> +};
> +
> static void vfio_pci_set_fd(Object *obj, const char *str, Error **errp)
> {
> vfio_device_set_fd(&VFIO_PCI(obj)->vbasedev, str, errp);
> }
> -#endif
>
> static void vfio_pci_dev_class_init(ObjectClass *klass, void *data)
> {
> @@ -3433,9 +3430,10 @@ static void vfio_pci_dev_class_init(ObjectClass *klass, void *data)
>
> device_class_set_legacy_reset(dc, vfio_pci_reset);
> device_class_set_props(dc, vfio_pci_dev_properties);
> -#ifdef CONFIG_IOMMUFD
> - object_class_property_add_str(klass, "fd", NULL, vfio_pci_set_fd);
> -#endif
> + if (iommufd_builtin()) {
> + device_class_set_props(dc, vfio_pci_dev_iommufd_properties);
> + object_class_property_add_str(klass, "fd", NULL, vfio_pci_set_fd);
> + }
> dc->desc = "VFIO-based PCI device assignment";
> set_bit(DEVICE_CATEGORY_MISC, dc->categories);
> pdc->realize = vfio_realize;
> @@ -3540,11 +3538,11 @@ static void vfio_pci_dev_class_init(ObjectClass *klass, void *data)
> "vf-token",
> "Specify UUID VF token. Required for VF when PF is owned "
> "by another VFIO driver");
> -#ifdef CONFIG_IOMMUFD
> - object_class_property_set_description(klass, /* 9.0 */
> - "iommufd",
> - "Set host IOMMUFD backend device");
> -#endif
> + if (iommufd_builtin()) {
> + object_class_property_set_description(klass, /* 9.0 */
> + "iommufd",
> + "Set host IOMMUFD backend device");
> + }
> object_class_property_set_description(klass, /* 9.1 */
> "x-device-dirty-page-tracking",
> "Disable device dirty page tracking and use "
> diff --git a/hw/vfio/meson.build b/hw/vfio/meson.build
> index 96e342aa8cb..9a004992c11 100644
> --- a/hw/vfio/meson.build
> +++ b/hw/vfio/meson.build
> @@ -6,7 +6,6 @@ vfio_ss.add(files(
> vfio_ss.add(when: 'CONFIG_PSERIES', if_true: files('spapr.c'))
> vfio_ss.add(when: 'CONFIG_VFIO_PCI', if_true: files(
> 'pci-quirks.c',
> - 'pci.c',
> ))
> vfio_ss.add(when: 'CONFIG_VFIO_CCW', if_true: files('ccw.c'))
> vfio_ss.add(when: 'CONFIG_VFIO_PLATFORM', if_true: files('platform.c'))
> @@ -29,4 +28,5 @@ system_ss.add(when: ['CONFIG_VFIO', 'CONFIG_IOMMUFD'], if_true: files(
> ))
> system_ss.add(when: 'CONFIG_VFIO_PCI', if_true: files(
> 'display.c',
> + 'pci.c',
> ))
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
^ permalink raw reply [flat|nested] 57+ messages in thread
* Re: [PATCH 12/14] hw/vfio/ap: Check CONFIG_IOMMUFD at runtime using iommufd_builtin()
2025-03-07 18:03 ` [PATCH 12/14] hw/vfio/ap: " Philippe Mathieu-Daudé
@ 2025-03-07 19:19 ` Pierrick Bouvier
2025-03-07 20:42 ` Richard Henderson
1 sibling, 0 replies; 57+ messages in thread
From: Pierrick Bouvier @ 2025-03-07 19:19 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, qemu-devel
Cc: Alex Williamson, Igor Mammedov, qemu-ppc, Thomas Huth,
Richard Henderson, Tony Krowiak, Ilya Leoshkevich, kvm, Yi Liu,
Paolo Bonzini, Zhenzhong Duan, Matthew Rosato, Eric Farman,
Peter Xu, Daniel Henrique Barboza, Eric Auger, qemu-s390x,
Jason Herne, Cédric Le Goater, David Hildenbrand,
Alex Bennée, Harsh Prateek Bora, Nicholas Piggin,
Halil Pasic, Christian Borntraeger
On 3/7/25 10:03, Philippe Mathieu-Daudé wrote:
> Convert the compile time check on the CONFIG_IOMMUFD definition
> by a runtime one by calling iommufd_builtin().
>
> Since the file doesn't use any target-specific knowledge anymore,
> move it to system_ss[] to build it once.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> target/s390x/kvm/kvm_s390x.h | 2 +-
> hw/vfio/ap.c | 27 +++++++++++++--------------
> hw/vfio/meson.build | 2 +-
> 3 files changed, 15 insertions(+), 16 deletions(-)
>
> diff --git a/target/s390x/kvm/kvm_s390x.h b/target/s390x/kvm/kvm_s390x.h
> index 649dae5948a..7b1cce3e60d 100644
> --- a/target/s390x/kvm/kvm_s390x.h
> +++ b/target/s390x/kvm/kvm_s390x.h
> @@ -10,7 +10,7 @@
> #ifndef KVM_S390X_H
> #define KVM_S390X_H
>
> -#include "cpu-qom.h"
> +#include "target/s390x/cpu-qom.h"
>
> struct kvm_s390_irq;
>
> diff --git a/hw/vfio/ap.c b/hw/vfio/ap.c
> index c7ab4ff57ad..832b98532ea 100644
> --- a/hw/vfio/ap.c
> +++ b/hw/vfio/ap.c
> @@ -11,7 +11,6 @@
> */
>
> #include "qemu/osdep.h"
> -#include CONFIG_DEVICES /* CONFIG_IOMMUFD */
> #include <linux/vfio.h>
> #include <sys/ioctl.h>
> #include "qapi/error.h"
> @@ -24,7 +23,7 @@
> #include "qemu/module.h"
> #include "qemu/option.h"
> #include "qemu/config-file.h"
> -#include "kvm/kvm_s390x.h"
> +#include "target/s390x/kvm/kvm_s390x.h"
> #include "migration/vmstate.h"
> #include "hw/qdev-properties.h"
> #include "hw/s390x/ap-bridge.h"
> @@ -193,10 +192,11 @@ static void vfio_ap_unrealize(DeviceState *dev)
>
> static const Property vfio_ap_properties[] = {
> DEFINE_PROP_STRING("sysfsdev", VFIOAPDevice, vdev.sysfsdev),
> -#ifdef CONFIG_IOMMUFD
> +};
> +
> +static const Property vfio_ap_iommufd_properties[] = {
> DEFINE_PROP_LINK("iommufd", VFIOAPDevice, vdev.iommufd,
> TYPE_IOMMUFD_BACKEND, IOMMUFDBackend *),
> -#endif
> };
>
> static void vfio_ap_reset(DeviceState *dev)
> @@ -234,21 +234,20 @@ static void vfio_ap_instance_init(Object *obj)
> vbasedev->mdev = true;
> }
>
> -#ifdef CONFIG_IOMMUFD
> static void vfio_ap_set_fd(Object *obj, const char *str, Error **errp)
> {
> vfio_device_set_fd(&VFIO_AP_DEVICE(obj)->vdev, str, errp);
> }
> -#endif
>
> static void vfio_ap_class_init(ObjectClass *klass, void *data)
> {
> DeviceClass *dc = DEVICE_CLASS(klass);
>
> device_class_set_props(dc, vfio_ap_properties);
> -#ifdef CONFIG_IOMMUFD
> - object_class_property_add_str(klass, "fd", NULL, vfio_ap_set_fd);
> -#endif
> + if (iommufd_builtin()) {
> + device_class_set_props(dc, vfio_ap_iommufd_properties);
> + object_class_property_add_str(klass, "fd", NULL, vfio_ap_set_fd);
> + }
> dc->vmsd = &vfio_ap_vmstate;
> dc->desc = "VFIO-based AP device assignment";
> set_bit(DEVICE_CATEGORY_MISC, dc->categories);
> @@ -261,11 +260,11 @@ static void vfio_ap_class_init(ObjectClass *klass, void *data)
> object_class_property_set_description(klass, /* 3.1 */
> "sysfsdev",
> "Host sysfs path of assigned device");
> -#ifdef CONFIG_IOMMUFD
> - object_class_property_set_description(klass, /* 9.0 */
> - "iommufd",
> - "Set host IOMMUFD backend device");
> -#endif
> + if (iommufd_builtin()) {
> + object_class_property_set_description(klass, /* 9.0 */
> + "iommufd",
> + "Set host IOMMUFD backend device");
> + }
> }
>
> static const TypeInfo vfio_ap_info = {
> diff --git a/hw/vfio/meson.build b/hw/vfio/meson.build
> index 9a004992c11..510ebe6d720 100644
> --- a/hw/vfio/meson.build
> +++ b/hw/vfio/meson.build
> @@ -9,7 +9,6 @@ vfio_ss.add(when: 'CONFIG_VFIO_PCI', if_true: files(
> ))
> vfio_ss.add(when: 'CONFIG_VFIO_CCW', if_true: files('ccw.c'))
> vfio_ss.add(when: 'CONFIG_VFIO_PLATFORM', if_true: files('platform.c'))
> -vfio_ss.add(when: 'CONFIG_VFIO_AP', if_true: files('ap.c'))
>
> specific_ss.add_all(when: 'CONFIG_VFIO', if_true: vfio_ss)
>
> @@ -26,6 +25,7 @@ system_ss.add(when: 'CONFIG_VFIO', if_true: files(
> system_ss.add(when: ['CONFIG_VFIO', 'CONFIG_IOMMUFD'], if_true: files(
> 'iommufd.c',
> ))
> +system_ss.add(when: 'CONFIG_VFIO_AP', if_true: files('ap.c'))
> system_ss.add(when: 'CONFIG_VFIO_PCI', if_true: files(
> 'display.c',
> 'pci.c',
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
^ permalink raw reply [flat|nested] 57+ messages in thread
* Re: [PATCH 13/14] hw/vfio/ccw: Check CONFIG_IOMMUFD at runtime using iommufd_builtin()
2025-03-07 18:03 ` [PATCH 13/14] hw/vfio/ccw: " Philippe Mathieu-Daudé
@ 2025-03-07 19:19 ` Pierrick Bouvier
2025-03-07 20:45 ` Richard Henderson
1 sibling, 0 replies; 57+ messages in thread
From: Pierrick Bouvier @ 2025-03-07 19:19 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, qemu-devel
Cc: Alex Williamson, Igor Mammedov, qemu-ppc, Thomas Huth,
Richard Henderson, Tony Krowiak, Ilya Leoshkevich, kvm, Yi Liu,
Paolo Bonzini, Zhenzhong Duan, Matthew Rosato, Eric Farman,
Peter Xu, Daniel Henrique Barboza, Eric Auger, qemu-s390x,
Jason Herne, Cédric Le Goater, David Hildenbrand,
Alex Bennée, Harsh Prateek Bora, Nicholas Piggin,
Halil Pasic, Christian Borntraeger
On 3/7/25 10:03, Philippe Mathieu-Daudé wrote:
> Convert the compile time check on the CONFIG_IOMMUFD definition
> by a runtime one by calling iommufd_builtin().
>
> Since the file doesn't use any target-specific knowledge anymore,
> move it to system_ss[] to build it once.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> hw/vfio/ccw.c | 27 +++++++++++++--------------
> hw/vfio/meson.build | 2 +-
> 2 files changed, 14 insertions(+), 15 deletions(-)
>
> diff --git a/hw/vfio/ccw.c b/hw/vfio/ccw.c
> index e5e0d9e3e7e..84d1437a568 100644
> --- a/hw/vfio/ccw.c
> +++ b/hw/vfio/ccw.c
> @@ -15,7 +15,6 @@
> */
>
> #include "qemu/osdep.h"
> -#include CONFIG_DEVICES /* CONFIG_IOMMUFD */
> #include <linux/vfio.h>
> #include <linux/vfio_ccw.h>
> #include <sys/ioctl.h>
> @@ -650,11 +649,12 @@ static void vfio_ccw_unrealize(DeviceState *dev)
> static const Property vfio_ccw_properties[] = {
> DEFINE_PROP_STRING("sysfsdev", VFIOCCWDevice, vdev.sysfsdev),
> DEFINE_PROP_BOOL("force-orb-pfch", VFIOCCWDevice, force_orb_pfch, false),
> -#ifdef CONFIG_IOMMUFD
> + DEFINE_PROP_CCW_LOADPARM("loadparm", CcwDevice, loadparm),
> +};
> +
> +static const Property vfio_ccw_iommufd_properties[] = {
> DEFINE_PROP_LINK("iommufd", VFIOCCWDevice, vdev.iommufd,
> TYPE_IOMMUFD_BACKEND, IOMMUFDBackend *),
> -#endif
> - DEFINE_PROP_CCW_LOADPARM("loadparm", CcwDevice, loadparm),
> };
>
> static const VMStateDescription vfio_ccw_vmstate = {
> @@ -682,12 +682,10 @@ static void vfio_ccw_instance_init(Object *obj)
> DEVICE(vcdev), true);
> }
>
> -#ifdef CONFIG_IOMMUFD
> static void vfio_ccw_set_fd(Object *obj, const char *str, Error **errp)
> {
> vfio_device_set_fd(&VFIO_CCW(obj)->vdev, str, errp);
> }
> -#endif
>
> static void vfio_ccw_class_init(ObjectClass *klass, void *data)
> {
> @@ -695,9 +693,10 @@ static void vfio_ccw_class_init(ObjectClass *klass, void *data)
> S390CCWDeviceClass *cdc = S390_CCW_DEVICE_CLASS(klass);
>
> device_class_set_props(dc, vfio_ccw_properties);
> -#ifdef CONFIG_IOMMUFD
> - object_class_property_add_str(klass, "fd", NULL, vfio_ccw_set_fd);
> -#endif
> + if (iommufd_builtin()) {
> + device_class_set_props(dc, vfio_ccw_iommufd_properties);
> + object_class_property_add_str(klass, "fd", NULL, vfio_ccw_set_fd);
> + }
> dc->vmsd = &vfio_ccw_vmstate;
> dc->desc = "VFIO-based subchannel assignment";
> set_bit(DEVICE_CATEGORY_MISC, dc->categories);
> @@ -716,11 +715,11 @@ static void vfio_ccw_class_init(ObjectClass *klass, void *data)
> object_class_property_set_description(klass, /* 3.0 */
> "force-orb-pfch",
> "Force unlimited prefetch");
> -#ifdef CONFIG_IOMMUFD
> - object_class_property_set_description(klass, /* 9.0 */
> - "iommufd",
> - "Set host IOMMUFD backend device");
> -#endif
> + if (iommufd_builtin()) {
> + object_class_property_set_description(klass, /* 9.0 */
> + "iommufd",
> + "Set host IOMMUFD backend device");
> + }
> object_class_property_set_description(klass, /* 9.2 */
> "loadparm",
> "Define which devices that can be used for booting");
> diff --git a/hw/vfio/meson.build b/hw/vfio/meson.build
> index 510ebe6d720..bd6e1d999e4 100644
> --- a/hw/vfio/meson.build
> +++ b/hw/vfio/meson.build
> @@ -7,7 +7,6 @@ vfio_ss.add(when: 'CONFIG_PSERIES', if_true: files('spapr.c'))
> vfio_ss.add(when: 'CONFIG_VFIO_PCI', if_true: files(
> 'pci-quirks.c',
> ))
> -vfio_ss.add(when: 'CONFIG_VFIO_CCW', if_true: files('ccw.c'))
> vfio_ss.add(when: 'CONFIG_VFIO_PLATFORM', if_true: files('platform.c'))
>
> specific_ss.add_all(when: 'CONFIG_VFIO', if_true: vfio_ss)
> @@ -26,6 +25,7 @@ system_ss.add(when: ['CONFIG_VFIO', 'CONFIG_IOMMUFD'], if_true: files(
> 'iommufd.c',
> ))
> system_ss.add(when: 'CONFIG_VFIO_AP', if_true: files('ap.c'))
> +system_ss.add(when: 'CONFIG_VFIO_CCW', if_true: files('ccw.c'))
> system_ss.add(when: 'CONFIG_VFIO_PCI', if_true: files(
> 'display.c',
> 'pci.c',
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
^ permalink raw reply [flat|nested] 57+ messages in thread
* Re: [PATCH 14/14] hw/vfio/platform: Check CONFIG_IOMMUFD at runtime using iommufd_builtin
2025-03-07 18:03 ` [PATCH 14/14] hw/vfio/platform: Check CONFIG_IOMMUFD at runtime using iommufd_builtin Philippe Mathieu-Daudé
@ 2025-03-07 19:20 ` Pierrick Bouvier
2025-03-07 20:48 ` Richard Henderson
1 sibling, 0 replies; 57+ messages in thread
From: Pierrick Bouvier @ 2025-03-07 19:20 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, qemu-devel
Cc: Alex Williamson, Igor Mammedov, qemu-ppc, Thomas Huth,
Richard Henderson, Tony Krowiak, Ilya Leoshkevich, kvm, Yi Liu,
Paolo Bonzini, Zhenzhong Duan, Matthew Rosato, Eric Farman,
Peter Xu, Daniel Henrique Barboza, Eric Auger, qemu-s390x,
Jason Herne, Cédric Le Goater, David Hildenbrand,
Alex Bennée, Harsh Prateek Bora, Nicholas Piggin,
Halil Pasic, Christian Borntraeger
On 3/7/25 10:03, Philippe Mathieu-Daudé wrote:
> Convert the compile time check on the CONFIG_IOMMUFD definition
> by a runtime one by calling iommufd_builtin().
>
> Since the file doesn't use any target-specific knowledge anymore,
> move it to system_ss[] to build it once.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> hw/vfio/platform.c | 25 ++++++++++++-------------
> hw/vfio/meson.build | 2 +-
> 2 files changed, 13 insertions(+), 14 deletions(-)
>
> diff --git a/hw/vfio/platform.c b/hw/vfio/platform.c
> index 67bc57409c1..265c550b747 100644
> --- a/hw/vfio/platform.c
> +++ b/hw/vfio/platform.c
> @@ -15,7 +15,6 @@
> */
>
> #include "qemu/osdep.h"
> -#include CONFIG_DEVICES /* CONFIG_IOMMUFD */
> #include "qapi/error.h"
> #include <sys/ioctl.h>
> #include <linux/vfio.h>
> @@ -637,10 +636,11 @@ static const Property vfio_platform_dev_properties[] = {
> DEFINE_PROP_UINT32("mmap-timeout-ms", VFIOPlatformDevice,
> mmap_timeout, 1100),
> DEFINE_PROP_BOOL("x-irqfd", VFIOPlatformDevice, irqfd_allowed, true),
> -#ifdef CONFIG_IOMMUFD
> +};
> +
> +static const Property vfio_platform_dev_iommufd_properties[] = {
> DEFINE_PROP_LINK("iommufd", VFIOPlatformDevice, vbasedev.iommufd,
> TYPE_IOMMUFD_BACKEND, IOMMUFDBackend *),
> -#endif
> };
>
> static void vfio_platform_instance_init(Object *obj)
> @@ -652,12 +652,10 @@ static void vfio_platform_instance_init(Object *obj)
> DEVICE(vdev), false);
> }
>
> -#ifdef CONFIG_IOMMUFD
> static void vfio_platform_set_fd(Object *obj, const char *str, Error **errp)
> {
> vfio_device_set_fd(&VFIO_PLATFORM_DEVICE(obj)->vbasedev, str, errp);
> }
> -#endif
>
> static void vfio_platform_class_init(ObjectClass *klass, void *data)
> {
> @@ -666,9 +664,10 @@ static void vfio_platform_class_init(ObjectClass *klass, void *data)
>
> dc->realize = vfio_platform_realize;
> device_class_set_props(dc, vfio_platform_dev_properties);
> -#ifdef CONFIG_IOMMUFD
> - object_class_property_add_str(klass, "fd", NULL, vfio_platform_set_fd);
> -#endif
> + if (iommufd_builtin()) {
> + device_class_set_props(dc, vfio_platform_dev_iommufd_properties);
> + object_class_property_add_str(klass, "fd", NULL, vfio_platform_set_fd);
> + }
> dc->vmsd = &vfio_platform_vmstate;
> dc->desc = "VFIO-based platform device assignment";
> sbc->connect_irq_notifier = vfio_start_irqfd_injection;
> @@ -692,11 +691,11 @@ static void vfio_platform_class_init(ObjectClass *klass, void *data)
> object_class_property_set_description(klass, /* 2.6 */
> "sysfsdev",
> "Host sysfs path of assigned device");
> -#ifdef CONFIG_IOMMUFD
> - object_class_property_set_description(klass, /* 9.0 */
> - "iommufd",
> - "Set host IOMMUFD backend device");
> -#endif
> + if (iommufd_builtin()) {
> + object_class_property_set_description(klass, /* 9.0 */
> + "iommufd",
> + "Set host IOMMUFD backend device");
> + }
> }
>
> static const TypeInfo vfio_platform_dev_info = {
> diff --git a/hw/vfio/meson.build b/hw/vfio/meson.build
> index bd6e1d999e4..e5010db2c71 100644
> --- a/hw/vfio/meson.build
> +++ b/hw/vfio/meson.build
> @@ -7,7 +7,6 @@ vfio_ss.add(when: 'CONFIG_PSERIES', if_true: files('spapr.c'))
> vfio_ss.add(when: 'CONFIG_VFIO_PCI', if_true: files(
> 'pci-quirks.c',
> ))
> -vfio_ss.add(when: 'CONFIG_VFIO_PLATFORM', if_true: files('platform.c'))
>
> specific_ss.add_all(when: 'CONFIG_VFIO', if_true: vfio_ss)
>
> @@ -26,6 +25,7 @@ system_ss.add(when: ['CONFIG_VFIO', 'CONFIG_IOMMUFD'], if_true: files(
> ))
> system_ss.add(when: 'CONFIG_VFIO_AP', if_true: files('ap.c'))
> system_ss.add(when: 'CONFIG_VFIO_CCW', if_true: files('ccw.c'))
> +system_ss.add(when: 'CONFIG_VFIO_PLATFORM', if_true: files('platform.c'))
> system_ss.add(when: 'CONFIG_VFIO_PCI', if_true: files(
> 'display.c',
> 'pci.c',
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
^ permalink raw reply [flat|nested] 57+ messages in thread
* Re: [PATCH 01/14] hw/vfio/common: Include missing 'system/tcg.h' header
2025-03-07 18:03 ` [PATCH 01/14] hw/vfio/common: Include missing 'system/tcg.h' header Philippe Mathieu-Daudé
2025-03-07 19:14 ` Pierrick Bouvier
@ 2025-03-07 19:35 ` Richard Henderson
2025-03-08 17:39 ` Cédric Le Goater
2 siblings, 0 replies; 57+ messages in thread
From: Richard Henderson @ 2025-03-07 19:35 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, qemu-devel
On 3/7/25 10:03, Philippe Mathieu-Daudé wrote:
> Always include necessary headers explicitly, to avoid
> when refactoring unrelated ones:
>
> hw/vfio/common.c:1176:45: error: implicit declaration of function ‘tcg_enabled’;
> 1176 | tcg_enabled() ? DIRTY_CLIENTS_ALL :
> | ^~~~~~~~~~~
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> hw/vfio/common.c | 1 +
> 1 file changed, 1 insertion(+)
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
r~
^ permalink raw reply [flat|nested] 57+ messages in thread
* Re: [PATCH 02/14] hw/vfio/spapr: Do not include <linux/kvm.h>
2025-03-07 18:03 ` [PATCH 02/14] hw/vfio/spapr: Do not include <linux/kvm.h> Philippe Mathieu-Daudé
2025-03-07 19:14 ` Pierrick Bouvier
@ 2025-03-07 19:39 ` Richard Henderson
2025-03-08 17:39 ` Cédric Le Goater
2 siblings, 0 replies; 57+ messages in thread
From: Richard Henderson @ 2025-03-07 19:39 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, qemu-devel
On 3/7/25 10:03, Philippe Mathieu-Daudé wrote:
> <linux/kvm.h> is already include by "system/kvm.h" in the next line.
>
> Signed-off-by: Philippe Mathieu-Daudé<philmd@linaro.org>
> ---
> hw/vfio/spapr.c | 3 ---
> 1 file changed, 3 deletions(-)
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
r~
^ permalink raw reply [flat|nested] 57+ messages in thread
* Re: [PATCH 03/14] hw/vfio: Compile some common objects once
2025-03-07 18:03 ` [PATCH 03/14] hw/vfio: Compile some common objects once Philippe Mathieu-Daudé
2025-03-07 19:15 ` Pierrick Bouvier
@ 2025-03-07 19:40 ` Richard Henderson
2025-03-08 17:39 ` Cédric Le Goater
2 siblings, 0 replies; 57+ messages in thread
From: Richard Henderson @ 2025-03-07 19:40 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, qemu-devel
On 3/7/25 10:03, Philippe Mathieu-Daudé wrote:
> Some files don't rely on any target-specific knowledge
> and can be compiled once:
>
> - helpers.c
> - container-base.c
> - migration.c (removing unnecessary "exec/ram_addr.h")
> - migration-multifd.c
> - cpr.c
>
> Signed-off-by: Philippe Mathieu-Daudé<philmd@linaro.org>
> ---
> hw/vfio/migration.c | 1 -
> hw/vfio/meson.build | 13 ++++++++-----
> 2 files changed, 8 insertions(+), 6 deletions(-)
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
r~
^ permalink raw reply [flat|nested] 57+ messages in thread
* Re: [PATCH 04/14] hw/vfio: Compile more objects once
2025-03-07 18:03 ` [PATCH 04/14] hw/vfio: Compile more " Philippe Mathieu-Daudé
2025-03-07 19:15 ` Pierrick Bouvier
@ 2025-03-07 19:40 ` Richard Henderson
2025-03-08 17:45 ` Cédric Le Goater
2 siblings, 0 replies; 57+ messages in thread
From: Richard Henderson @ 2025-03-07 19:40 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, qemu-devel
On 3/7/25 10:03, Philippe Mathieu-Daudé wrote:
> These files depend on the VFIO symbol in their Kconfig
> definition. They don't rely on target specific definitions,
> move them to system_ss[] to build them once.
>
> Signed-off-by: Philippe Mathieu-Daudé<philmd@linaro.org>
> ---
> hw/vfio/meson.build | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
r~
^ permalink raw reply [flat|nested] 57+ messages in thread
* Re: [PATCH 05/14] hw/vfio: Compile iommufd.c once
2025-03-07 18:03 ` [PATCH 05/14] hw/vfio: Compile iommufd.c once Philippe Mathieu-Daudé
2025-03-07 19:16 ` Pierrick Bouvier
@ 2025-03-07 19:41 ` Richard Henderson
2025-03-08 17:45 ` Cédric Le Goater
2 siblings, 0 replies; 57+ messages in thread
From: Richard Henderson @ 2025-03-07 19:41 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, qemu-devel
On 3/7/25 10:03, Philippe Mathieu-Daudé wrote:
> Removing unused "exec/ram_addr.h" header allow to compile
> iommufd.c once for all targets.
>
> Signed-off-by: Philippe Mathieu-Daudé<philmd@linaro.org>
> ---
> hw/vfio/iommufd.c | 1 -
> hw/vfio/meson.build | 6 +++---
> 2 files changed, 3 insertions(+), 4 deletions(-)
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
r~
^ permalink raw reply [flat|nested] 57+ messages in thread
* Re: [PATCH 07/14] hw/vfio: Compile display.c once
2025-03-07 18:03 ` [PATCH 07/14] hw/vfio: Compile display.c once Philippe Mathieu-Daudé
2025-03-07 19:17 ` Pierrick Bouvier
@ 2025-03-07 19:42 ` Richard Henderson
2025-03-08 17:46 ` Cédric Le Goater
2 siblings, 0 replies; 57+ messages in thread
From: Richard Henderson @ 2025-03-07 19:42 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, qemu-devel
On 3/7/25 10:03, Philippe Mathieu-Daudé wrote:
> display.c doesn't rely on target specific definitions,
> move it to system_ss[] to build it once.
>
> Signed-off-by: Philippe Mathieu-Daudé<philmd@linaro.org>
> ---
> hw/vfio/meson.build | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
^ permalink raw reply [flat|nested] 57+ messages in thread
* Re: [PATCH 08/14] system/kvm: Expose kvm_irqchip_[add,remove]_change_notifier()
2025-03-07 18:03 ` [PATCH 08/14] system/kvm: Expose kvm_irqchip_[add, remove]_change_notifier() Philippe Mathieu-Daudé
2025-03-07 19:17 ` [PATCH 08/14] system/kvm: Expose kvm_irqchip_[add,remove]_change_notifier() Pierrick Bouvier
@ 2025-03-07 20:09 ` Richard Henderson
2025-03-08 22:18 ` Philippe Mathieu-Daudé
1 sibling, 1 reply; 57+ messages in thread
From: Richard Henderson @ 2025-03-07 20:09 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, qemu-devel
On 3/7/25 10:03, Philippe Mathieu-Daudé wrote:
> Currently kvm_irqchip_add_irqfd_notifier() and
> kvm_irqchip_remove_irqfd_notifier() are only declared on
> target specific code. There is not particular reason to,
> as their prototypes don't use anything target related.
>
> Move their declaration with common prototypes, and
> implement their stub.
The description is not accurate, because the new stubs are
*not* for the functions whose declaration you move.
This feels like two different changes.
r~
^ permalink raw reply [flat|nested] 57+ messages in thread
* Re: [PATCH 09/14] hw/vfio/pci: Convert CONFIG_KVM check to runtime one
2025-03-07 18:03 ` [PATCH 09/14] hw/vfio/pci: Convert CONFIG_KVM check to runtime one Philippe Mathieu-Daudé
2025-03-07 19:18 ` Pierrick Bouvier
@ 2025-03-07 20:11 ` Richard Henderson
2025-03-08 17:46 ` Cédric Le Goater
2 siblings, 0 replies; 57+ messages in thread
From: Richard Henderson @ 2025-03-07 20:11 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, qemu-devel
On 3/7/25 10:03, Philippe Mathieu-Daudé wrote:
> Use the runtime kvm_enabled() helper to check whether
> KVM is available or not.
>
> Signed-off-by: Philippe Mathieu-Daudé<philmd@linaro.org>
> ---
> hw/vfio/pci.c | 19 +++++++++----------
> 1 file changed, 9 insertions(+), 10 deletions(-)
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
r~
^ permalink raw reply [flat|nested] 57+ messages in thread
* Re: [PATCH 10/14] system/iommufd: Introduce iommufd_builtin() helper
2025-03-07 18:03 ` [PATCH 10/14] system/iommufd: Introduce iommufd_builtin() helper Philippe Mathieu-Daudé
2025-03-07 19:18 ` Pierrick Bouvier
@ 2025-03-07 20:33 ` Richard Henderson
2025-03-08 7:48 ` Philippe Mathieu-Daudé
1 sibling, 1 reply; 57+ messages in thread
From: Richard Henderson @ 2025-03-07 20:33 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, qemu-devel; +Cc: Alex Williamson
On 3/7/25 10:03, Philippe Mathieu-Daudé wrote:
> iommufd_builtin() can be used to check at runtime whether
> the IOMMUFD feature is built in a qemu-system binary.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> docs/devel/vfio-iommufd.rst | 2 +-
> include/system/iommufd.h | 8 ++++++++
> 2 files changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/docs/devel/vfio-iommufd.rst b/docs/devel/vfio-iommufd.rst
> index 3d1c11f175e..08882094eee 100644
> --- a/docs/devel/vfio-iommufd.rst
> +++ b/docs/devel/vfio-iommufd.rst
> @@ -88,7 +88,7 @@ Step 2: configure QEMU
> ----------------------
>
> Interactions with the ``/dev/iommu`` are abstracted by a new iommufd
> -object (compiled in with the ``CONFIG_IOMMUFD`` option).
> +object (which availability can be checked at runtime using ``iommufd_builtin()``).
>
> Any QEMU device (e.g. VFIO device) wishing to use ``/dev/iommu`` must
> be linked with an iommufd object. It gets a new optional property
> diff --git a/include/system/iommufd.h b/include/system/iommufd.h
> index cbab75bfbf6..ce459254025 100644
> --- a/include/system/iommufd.h
> +++ b/include/system/iommufd.h
> @@ -63,4 +63,12 @@ bool iommufd_backend_get_dirty_bitmap(IOMMUFDBackend *be, uint32_t hwpt_id,
> Error **errp);
>
> #define TYPE_HOST_IOMMU_DEVICE_IOMMUFD TYPE_HOST_IOMMU_DEVICE "-iommufd"
> +
> +static inline bool iommufd_builtin(void)
> +{
> + bool ambig = false;
> +
> + return object_resolve_path_type("", TYPE_IOMMUFD_BACKEND, &ambig) || ambig;
> +}
> +
> #endif
Interesting solution.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
r~
^ permalink raw reply [flat|nested] 57+ messages in thread
* Re: [PATCH 11/14] hw/vfio/pci: Check CONFIG_IOMMUFD at runtime using iommufd_builtin()
2025-03-07 18:03 ` [PATCH 11/14] hw/vfio/pci: Check CONFIG_IOMMUFD at runtime using iommufd_builtin() Philippe Mathieu-Daudé
2025-03-07 19:19 ` Pierrick Bouvier
@ 2025-03-07 20:35 ` Richard Henderson
1 sibling, 0 replies; 57+ messages in thread
From: Richard Henderson @ 2025-03-07 20:35 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, qemu-devel
On 3/7/25 10:03, Philippe Mathieu-Daudé wrote:
> Convert the compile time check on the CONFIG_IOMMUFD definition
> by a runtime one by calling iommufd_builtin().
>
> Since the file doesn't use any target-specific knowledge anymore,
> move it to system_ss[] to build it once.
>
> Signed-off-by: Philippe Mathieu-Daudé<philmd@linaro.org>
> ---
> hw/vfio/pci.c | 38 ++++++++++++++++++--------------------
> hw/vfio/meson.build | 2 +-
> 2 files changed, 19 insertions(+), 21 deletions(-)
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
r~
^ permalink raw reply [flat|nested] 57+ messages in thread
* Re: [PATCH 12/14] hw/vfio/ap: Check CONFIG_IOMMUFD at runtime using iommufd_builtin()
2025-03-07 18:03 ` [PATCH 12/14] hw/vfio/ap: " Philippe Mathieu-Daudé
2025-03-07 19:19 ` Pierrick Bouvier
@ 2025-03-07 20:42 ` Richard Henderson
2025-03-07 21:08 ` Philippe Mathieu-Daudé
1 sibling, 1 reply; 57+ messages in thread
From: Richard Henderson @ 2025-03-07 20:42 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, qemu-devel
On 3/7/25 10:03, Philippe Mathieu-Daudé wrote:
> Convert the compile time check on the CONFIG_IOMMUFD definition
> by a runtime one by calling iommufd_builtin().
>
> Since the file doesn't use any target-specific knowledge anymore,
> move it to system_ss[] to build it once.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> target/s390x/kvm/kvm_s390x.h | 2 +-
> hw/vfio/ap.c | 27 +++++++++++++--------------
> hw/vfio/meson.build | 2 +-
> 3 files changed, 15 insertions(+), 16 deletions(-)
>
> diff --git a/target/s390x/kvm/kvm_s390x.h b/target/s390x/kvm/kvm_s390x.h
> index 649dae5948a..7b1cce3e60d 100644
> --- a/target/s390x/kvm/kvm_s390x.h
> +++ b/target/s390x/kvm/kvm_s390x.h
> @@ -10,7 +10,7 @@
> #ifndef KVM_S390X_H
> #define KVM_S390X_H
>
> -#include "cpu-qom.h"
> +#include "target/s390x/cpu-qom.h"
>
> struct kvm_s390_irq;
>
> diff --git a/hw/vfio/ap.c b/hw/vfio/ap.c
> index c7ab4ff57ad..832b98532ea 100644
> --- a/hw/vfio/ap.c
> +++ b/hw/vfio/ap.c
> @@ -11,7 +11,6 @@
> */
>
> #include "qemu/osdep.h"
> -#include CONFIG_DEVICES /* CONFIG_IOMMUFD */
> #include <linux/vfio.h>
> #include <sys/ioctl.h>
> #include "qapi/error.h"
> @@ -24,7 +23,7 @@
> #include "qemu/module.h"
> #include "qemu/option.h"
> #include "qemu/config-file.h"
> -#include "kvm/kvm_s390x.h"
> +#include "target/s390x/kvm/kvm_s390x.h"
Do I take from this that this is actually a target-specific device?
Otherwise the two s390x changes are confusing.
Is it built once already, due to only being enabled for qemu-system-s390x?
If so, I question the need to move it out of specific_ss at all.
Anyway, this is two changes -- one for iommufd_builtin and one for meson.build.
r~
^ permalink raw reply [flat|nested] 57+ messages in thread
* Re: [PATCH 13/14] hw/vfio/ccw: Check CONFIG_IOMMUFD at runtime using iommufd_builtin()
2025-03-07 18:03 ` [PATCH 13/14] hw/vfio/ccw: " Philippe Mathieu-Daudé
2025-03-07 19:19 ` Pierrick Bouvier
@ 2025-03-07 20:45 ` Richard Henderson
2025-03-07 21:09 ` Philippe Mathieu-Daudé
1 sibling, 1 reply; 57+ messages in thread
From: Richard Henderson @ 2025-03-07 20:45 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, qemu-devel
On 3/7/25 10:03, Philippe Mathieu-Daudé wrote:
> Convert the compile time check on the CONFIG_IOMMUFD definition
> by a runtime one by calling iommufd_builtin().
>
> Since the file doesn't use any target-specific knowledge anymore,
> move it to system_ss[] to build it once.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> hw/vfio/ccw.c | 27 +++++++++++++--------------
> hw/vfio/meson.build | 2 +-
> 2 files changed, 14 insertions(+), 15 deletions(-)
Again, separate the changes for iommufd_builtin and meson.
This is an s390x specific device; it really can't be shared beyond.
r~
^ permalink raw reply [flat|nested] 57+ messages in thread
* Re: [PATCH 14/14] hw/vfio/platform: Check CONFIG_IOMMUFD at runtime using iommufd_builtin
2025-03-07 18:03 ` [PATCH 14/14] hw/vfio/platform: Check CONFIG_IOMMUFD at runtime using iommufd_builtin Philippe Mathieu-Daudé
2025-03-07 19:20 ` Pierrick Bouvier
@ 2025-03-07 20:48 ` Richard Henderson
1 sibling, 0 replies; 57+ messages in thread
From: Richard Henderson @ 2025-03-07 20:48 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, qemu-devel
On 3/7/25 10:03, Philippe Mathieu-Daudé wrote:
> Convert the compile time check on the CONFIG_IOMMUFD definition
> by a runtime one by calling iommufd_builtin().
>
> Since the file doesn't use any target-specific knowledge anymore,
> move it to system_ss[] to build it once.
>
> Signed-off-by: Philippe Mathieu-Daudé<philmd@linaro.org>
> ---
> hw/vfio/platform.c | 25 ++++++++++++-------------
> hw/vfio/meson.build | 2 +-
> 2 files changed, 13 insertions(+), 14 deletions(-)
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
r~
^ permalink raw reply [flat|nested] 57+ messages in thread
* Re: [PATCH 12/14] hw/vfio/ap: Check CONFIG_IOMMUFD at runtime using iommufd_builtin()
2025-03-07 20:42 ` Richard Henderson
@ 2025-03-07 21:08 ` Philippe Mathieu-Daudé
0 siblings, 0 replies; 57+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-03-07 21:08 UTC (permalink / raw)
To: Richard Henderson, qemu-devel
On 7/3/25 21:42, Richard Henderson wrote:
> On 3/7/25 10:03, Philippe Mathieu-Daudé wrote:
>> Convert the compile time check on the CONFIG_IOMMUFD definition
>> by a runtime one by calling iommufd_builtin().
>>
>> Since the file doesn't use any target-specific knowledge anymore,
>> move it to system_ss[] to build it once.
>>
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>> ---
>> target/s390x/kvm/kvm_s390x.h | 2 +-
>> hw/vfio/ap.c | 27 +++++++++++++--------------
>> hw/vfio/meson.build | 2 +-
>> 3 files changed, 15 insertions(+), 16 deletions(-)
>>
>> diff --git a/target/s390x/kvm/kvm_s390x.h b/target/s390x/kvm/kvm_s390x.h
>> index 649dae5948a..7b1cce3e60d 100644
>> --- a/target/s390x/kvm/kvm_s390x.h
>> +++ b/target/s390x/kvm/kvm_s390x.h
>> @@ -10,7 +10,7 @@
>> #ifndef KVM_S390X_H
>> #define KVM_S390X_H
>> -#include "cpu-qom.h"
>> +#include "target/s390x/cpu-qom.h"
>> struct kvm_s390_irq;
>> diff --git a/hw/vfio/ap.c b/hw/vfio/ap.c
>> index c7ab4ff57ad..832b98532ea 100644
>> --- a/hw/vfio/ap.c
>> +++ b/hw/vfio/ap.c
>> @@ -11,7 +11,6 @@
>> */
>> #include "qemu/osdep.h"
>> -#include CONFIG_DEVICES /* CONFIG_IOMMUFD */
>> #include <linux/vfio.h>
>> #include <sys/ioctl.h>
>> #include "qapi/error.h"
>> @@ -24,7 +23,7 @@
>> #include "qemu/module.h"
>> #include "qemu/option.h"
>> #include "qemu/config-file.h"
>> -#include "kvm/kvm_s390x.h"
>> +#include "target/s390x/kvm/kvm_s390x.h"
>
> Do I take from this that this is actually a target-specific device?
> Otherwise the two s390x changes are confusing.
> Is it built once already, due to only being enabled for qemu-system-s390x?
> If so, I question the need to move it out of specific_ss at all.
While it happens to be built once, we need to remove specific_ss[]
to be sure everything eventually link, right?
More generally, I'd rather to remove CONFIG_DEVICES altogether.
> Anyway, this is two changes -- one for iommufd_builtin and one for
> meson.build.
OK.
^ permalink raw reply [flat|nested] 57+ messages in thread
* Re: [PATCH 13/14] hw/vfio/ccw: Check CONFIG_IOMMUFD at runtime using iommufd_builtin()
2025-03-07 20:45 ` Richard Henderson
@ 2025-03-07 21:09 ` Philippe Mathieu-Daudé
0 siblings, 0 replies; 57+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-03-07 21:09 UTC (permalink / raw)
To: Richard Henderson, qemu-devel
On 7/3/25 21:45, Richard Henderson wrote:
> On 3/7/25 10:03, Philippe Mathieu-Daudé wrote:
>> Convert the compile time check on the CONFIG_IOMMUFD definition
>> by a runtime one by calling iommufd_builtin().
>>
>> Since the file doesn't use any target-specific knowledge anymore,
>> move it to system_ss[] to build it once.
>>
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>> ---
>> hw/vfio/ccw.c | 27 +++++++++++++--------------
>> hw/vfio/meson.build | 2 +-
>> 2 files changed, 14 insertions(+), 15 deletions(-)
>
> Again, separate the changes for iommufd_builtin and meson.
> This is an s390x specific device; it really can't be shared beyond.
I wouldn't be surprised if someone try to emulate a s390x+riscv
machine *and* use VFIO, human creativity is limitless!
^ permalink raw reply [flat|nested] 57+ messages in thread
* Re: [PATCH 06/14] system: Declare qemu_[min/max]rampagesize() in 'system/hostmem.h'
2025-03-07 18:03 ` [PATCH 06/14] system: Declare qemu_[min/max]rampagesize() in 'system/hostmem.h' Philippe Mathieu-Daudé
2025-03-07 19:16 ` Pierrick Bouvier
@ 2025-03-07 21:12 ` Philippe Mathieu-Daudé
1 sibling, 0 replies; 57+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-03-07 21:12 UTC (permalink / raw)
To: qemu-devel
Cc: Alex Williamson, Igor Mammedov, qemu-ppc, Thomas Huth,
Richard Henderson, Tony Krowiak, Ilya Leoshkevich, kvm, Yi Liu,
Paolo Bonzini, Zhenzhong Duan, Matthew Rosato, Eric Farman,
Peter Xu, Pierrick Bouvier, Daniel Henrique Barboza, Eric Auger,
qemu-s390x, Jason Herne, Cédric Le Goater, David Hildenbrand,
Alex Bennée, Harsh Prateek Bora, Nicholas Piggin,
Halil Pasic, Christian Borntraeger
On 7/3/25 19:03, Philippe Mathieu-Daudé wrote:
> Both qemu_minrampagesize() and qemu_maxrampagesize() are
> related to host memory backends. Move their prototype
> declaration to "system/hostmem.h".
qemu_minrampagesize()
-> find_min_backend_pagesize()
-> object_dynamic_cast(obj, TYPE_MEMORY_BACKEND)
qemu_maxrampagesize()
-> find_max_backend_pagesize()
-> object_dynamic_cast(obj, TYPE_MEMORY_BACKEND)
Having:
include/system/hostmem.h:23:#define TYPE_MEMORY_BACKEND "memory-backend"
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> include/exec/ram_addr.h | 3 ---
> include/system/hostmem.h | 3 +++
> hw/ppc/spapr_caps.c | 1 +
> hw/s390x/s390-virtio-ccw.c | 1 +
> hw/vfio/spapr.c | 1 +
> 5 files changed, 6 insertions(+), 3 deletions(-)
^ permalink raw reply [flat|nested] 57+ messages in thread
* Re: [PATCH 10/14] system/iommufd: Introduce iommufd_builtin() helper
2025-03-07 20:33 ` Richard Henderson
@ 2025-03-08 7:48 ` Philippe Mathieu-Daudé
0 siblings, 0 replies; 57+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-03-08 7:48 UTC (permalink / raw)
To: Richard Henderson, qemu-devel; +Cc: Alex Williamson
On 7/3/25 21:33, Richard Henderson wrote:
> On 3/7/25 10:03, Philippe Mathieu-Daudé wrote:
>> iommufd_builtin() can be used to check at runtime whether
>> the IOMMUFD feature is built in a qemu-system binary.
>>
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>> ---
>> docs/devel/vfio-iommufd.rst | 2 +-
>> include/system/iommufd.h | 8 ++++++++
>> 2 files changed, 9 insertions(+), 1 deletion(-)
>>
>> diff --git a/docs/devel/vfio-iommufd.rst b/docs/devel/vfio-iommufd.rst
>> index 3d1c11f175e..08882094eee 100644
>> --- a/docs/devel/vfio-iommufd.rst
>> +++ b/docs/devel/vfio-iommufd.rst
>> @@ -88,7 +88,7 @@ Step 2: configure QEMU
>> ----------------------
>> Interactions with the ``/dev/iommu`` are abstracted by a new iommufd
>> -object (compiled in with the ``CONFIG_IOMMUFD`` option).
>> +object (which availability can be checked at runtime using
>> ``iommufd_builtin()``).
>> Any QEMU device (e.g. VFIO device) wishing to use ``/dev/iommu`` must
>> be linked with an iommufd object. It gets a new optional property
>> diff --git a/include/system/iommufd.h b/include/system/iommufd.h
>> index cbab75bfbf6..ce459254025 100644
>> --- a/include/system/iommufd.h
>> +++ b/include/system/iommufd.h
>> @@ -63,4 +63,12 @@ bool
>> iommufd_backend_get_dirty_bitmap(IOMMUFDBackend *be, uint32_t hwpt_id,
>> Error **errp);
>> #define TYPE_HOST_IOMMU_DEVICE_IOMMUFD TYPE_HOST_IOMMU_DEVICE "-
>> iommufd"
>> +
>> +static inline bool iommufd_builtin(void)
>> +{
>> + bool ambig = false;
>> +
>> + return object_resolve_path_type("", TYPE_IOMMUFD_BACKEND, &ambig)
>> || ambig;
>> +}
>> +
>> #endif
>
> Interesting solution.
Actually this isn't appropriate as this checks for an *instance*, while
we only want the *class*.
I'll respin a different approach.
^ permalink raw reply [flat|nested] 57+ messages in thread
* Re: [PATCH 01/14] hw/vfio/common: Include missing 'system/tcg.h' header
2025-03-07 18:03 ` [PATCH 01/14] hw/vfio/common: Include missing 'system/tcg.h' header Philippe Mathieu-Daudé
2025-03-07 19:14 ` Pierrick Bouvier
2025-03-07 19:35 ` Richard Henderson
@ 2025-03-08 17:39 ` Cédric Le Goater
2 siblings, 0 replies; 57+ messages in thread
From: Cédric Le Goater @ 2025-03-08 17:39 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, qemu-devel
Cc: Alex Williamson, Igor Mammedov, qemu-ppc, Thomas Huth,
Richard Henderson, Tony Krowiak, Ilya Leoshkevich, kvm, Yi Liu,
Paolo Bonzini, Zhenzhong Duan, Matthew Rosato, Eric Farman,
Peter Xu, Pierrick Bouvier, Daniel Henrique Barboza, Eric Auger,
qemu-s390x, Jason Herne, David Hildenbrand, Alex Bennée,
Harsh Prateek Bora, Nicholas Piggin, Halil Pasic,
Christian Borntraeger
On 3/7/25 19:03, Philippe Mathieu-Daudé wrote:
> Always include necessary headers explicitly, to avoid
> when refactoring unrelated ones:
>
> hw/vfio/common.c:1176:45: error: implicit declaration of function ‘tcg_enabled’;
> 1176 | tcg_enabled() ? DIRTY_CLIENTS_ALL :
> | ^~~~~~~~~~~
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Thanks,
C.
> ---
> hw/vfio/common.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/hw/vfio/common.c b/hw/vfio/common.c
> index 7a4010ef4ee..b1596b6bf64 100644
> --- a/hw/vfio/common.c
> +++ b/hw/vfio/common.c
> @@ -42,6 +42,7 @@
> #include "migration/misc.h"
> #include "migration/blocker.h"
> #include "migration/qemu-file.h"
> +#include "system/tcg.h"
> #include "system/tpm.h"
>
> VFIODeviceList vfio_device_list =
^ permalink raw reply [flat|nested] 57+ messages in thread
* Re: [PATCH 02/14] hw/vfio/spapr: Do not include <linux/kvm.h>
2025-03-07 18:03 ` [PATCH 02/14] hw/vfio/spapr: Do not include <linux/kvm.h> Philippe Mathieu-Daudé
2025-03-07 19:14 ` Pierrick Bouvier
2025-03-07 19:39 ` Richard Henderson
@ 2025-03-08 17:39 ` Cédric Le Goater
2 siblings, 0 replies; 57+ messages in thread
From: Cédric Le Goater @ 2025-03-08 17:39 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, qemu-devel
Cc: Alex Williamson, Igor Mammedov, qemu-ppc, Thomas Huth,
Richard Henderson, Tony Krowiak, Ilya Leoshkevich, kvm, Yi Liu,
Paolo Bonzini, Zhenzhong Duan, Matthew Rosato, Eric Farman,
Peter Xu, Pierrick Bouvier, Daniel Henrique Barboza, Eric Auger,
qemu-s390x, Jason Herne, David Hildenbrand, Alex Bennée,
Harsh Prateek Bora, Nicholas Piggin, Halil Pasic,
Christian Borntraeger
On 3/7/25 19:03, Philippe Mathieu-Daudé wrote:
> <linux/kvm.h> is already include by "system/kvm.h" in the next line.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Thanks,
C.
> ---
> hw/vfio/spapr.c | 3 ---
> 1 file changed, 3 deletions(-)
>
> diff --git a/hw/vfio/spapr.c b/hw/vfio/spapr.c
> index ad4c499eafe..9b5ad05bb1c 100644
> --- a/hw/vfio/spapr.c
> +++ b/hw/vfio/spapr.c
> @@ -11,9 +11,6 @@
> #include "qemu/osdep.h"
> #include <sys/ioctl.h>
> #include <linux/vfio.h>
> -#ifdef CONFIG_KVM
> -#include <linux/kvm.h>
> -#endif
> #include "system/kvm.h"
> #include "exec/address-spaces.h"
>
^ permalink raw reply [flat|nested] 57+ messages in thread
* Re: [PATCH 03/14] hw/vfio: Compile some common objects once
2025-03-07 18:03 ` [PATCH 03/14] hw/vfio: Compile some common objects once Philippe Mathieu-Daudé
2025-03-07 19:15 ` Pierrick Bouvier
2025-03-07 19:40 ` Richard Henderson
@ 2025-03-08 17:39 ` Cédric Le Goater
2 siblings, 0 replies; 57+ messages in thread
From: Cédric Le Goater @ 2025-03-08 17:39 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, qemu-devel
Cc: Alex Williamson, Igor Mammedov, qemu-ppc, Thomas Huth,
Richard Henderson, Tony Krowiak, Ilya Leoshkevich, kvm, Yi Liu,
Paolo Bonzini, Zhenzhong Duan, Matthew Rosato, Eric Farman,
Peter Xu, Pierrick Bouvier, Daniel Henrique Barboza, Eric Auger,
qemu-s390x, Jason Herne, David Hildenbrand, Alex Bennée,
Harsh Prateek Bora, Nicholas Piggin, Halil Pasic,
Christian Borntraeger
On 3/7/25 19:03, Philippe Mathieu-Daudé wrote:
> Some files don't rely on any target-specific knowledge
> and can be compiled once:
>
> - helpers.c
> - container-base.c
> - migration.c (removing unnecessary "exec/ram_addr.h")
> - migration-multifd.c
> - cpr.c
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Thanks,
C.
> ---
> hw/vfio/migration.c | 1 -
> hw/vfio/meson.build | 13 ++++++++-----
> 2 files changed, 8 insertions(+), 6 deletions(-)
>
> diff --git a/hw/vfio/migration.c b/hw/vfio/migration.c
> index 416643ddd69..fbff46cfc35 100644
> --- a/hw/vfio/migration.c
> +++ b/hw/vfio/migration.c
> @@ -27,7 +27,6 @@
> #include "qapi/error.h"
> #include "qapi/qapi-events-vfio.h"
> #include "exec/ramlist.h"
> -#include "exec/ram_addr.h"
> #include "pci.h"
> #include "trace.h"
> #include "hw/hw.h"
> diff --git a/hw/vfio/meson.build b/hw/vfio/meson.build
> index 260d65febd6..8e376cfcbf8 100644
> --- a/hw/vfio/meson.build
> +++ b/hw/vfio/meson.build
> @@ -1,12 +1,7 @@
> vfio_ss = ss.source_set()
> vfio_ss.add(files(
> - 'helpers.c',
> 'common.c',
> - 'container-base.c',
> 'container.c',
> - 'migration.c',
> - 'migration-multifd.c',
> - 'cpr.c',
> ))
> vfio_ss.add(when: 'CONFIG_PSERIES', if_true: files('spapr.c'))
> vfio_ss.add(when: 'CONFIG_IOMMUFD', if_true: files(
> @@ -25,3 +20,11 @@ vfio_ss.add(when: 'CONFIG_VFIO_AP', if_true: files('ap.c'))
> vfio_ss.add(when: 'CONFIG_VFIO_IGD', if_true: files('igd.c'))
>
> specific_ss.add_all(when: 'CONFIG_VFIO', if_true: vfio_ss)
> +
> +system_ss.add(when: 'CONFIG_VFIO', if_true: files(
> + 'helpers.c',
> + 'container-base.c',
> + 'migration.c',
> + 'migration-multifd.c',
> + 'cpr.c',
> +))
^ permalink raw reply [flat|nested] 57+ messages in thread
* Re: [PATCH 04/14] hw/vfio: Compile more objects once
2025-03-07 18:03 ` [PATCH 04/14] hw/vfio: Compile more " Philippe Mathieu-Daudé
2025-03-07 19:15 ` Pierrick Bouvier
2025-03-07 19:40 ` Richard Henderson
@ 2025-03-08 17:45 ` Cédric Le Goater
2 siblings, 0 replies; 57+ messages in thread
From: Cédric Le Goater @ 2025-03-08 17:45 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, qemu-devel
Cc: Alex Williamson, Igor Mammedov, qemu-ppc, Thomas Huth,
Richard Henderson, Tony Krowiak, Ilya Leoshkevich, kvm, Yi Liu,
Paolo Bonzini, Zhenzhong Duan, Matthew Rosato, Eric Farman,
Peter Xu, Pierrick Bouvier, Daniel Henrique Barboza, Eric Auger,
qemu-s390x, Jason Herne, David Hildenbrand, Alex Bennée,
Harsh Prateek Bora, Nicholas Piggin, Halil Pasic,
Christian Borntraeger
On 3/7/25 19:03, Philippe Mathieu-Daudé wrote:
> These files depend on the VFIO symbol in their Kconfig
> definition. They don't rely on target specific definitions,
> move them to system_ss[] to build them once.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Thanks,
C.
> ---
> hw/vfio/meson.build | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/hw/vfio/meson.build b/hw/vfio/meson.build
> index 8e376cfcbf8..2972c6ff8de 100644
> --- a/hw/vfio/meson.build
> +++ b/hw/vfio/meson.build
> @@ -14,13 +14,13 @@ vfio_ss.add(when: 'CONFIG_VFIO_PCI', if_true: files(
> ))
> vfio_ss.add(when: 'CONFIG_VFIO_CCW', if_true: files('ccw.c'))
> vfio_ss.add(when: 'CONFIG_VFIO_PLATFORM', if_true: files('platform.c'))
> -vfio_ss.add(when: 'CONFIG_VFIO_XGMAC', if_true: files('calxeda-xgmac.c'))
> -vfio_ss.add(when: 'CONFIG_VFIO_AMD_XGBE', if_true: files('amd-xgbe.c'))
> vfio_ss.add(when: 'CONFIG_VFIO_AP', if_true: files('ap.c'))
> -vfio_ss.add(when: 'CONFIG_VFIO_IGD', if_true: files('igd.c'))
>
> specific_ss.add_all(when: 'CONFIG_VFIO', if_true: vfio_ss)
>
> +system_ss.add(when: 'CONFIG_VFIO_XGMAC', if_true: files('calxeda-xgmac.c'))
> +system_ss.add(when: 'CONFIG_VFIO_AMD_XGBE', if_true: files('amd-xgbe.c'))
> +system_ss.add(when: 'CONFIG_VFIO_IGD', if_true: files('igd.c'))
> system_ss.add(when: 'CONFIG_VFIO', if_true: files(
> 'helpers.c',
> 'container-base.c',
^ permalink raw reply [flat|nested] 57+ messages in thread
* Re: [PATCH 05/14] hw/vfio: Compile iommufd.c once
2025-03-07 18:03 ` [PATCH 05/14] hw/vfio: Compile iommufd.c once Philippe Mathieu-Daudé
2025-03-07 19:16 ` Pierrick Bouvier
2025-03-07 19:41 ` Richard Henderson
@ 2025-03-08 17:45 ` Cédric Le Goater
2 siblings, 0 replies; 57+ messages in thread
From: Cédric Le Goater @ 2025-03-08 17:45 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, qemu-devel
Cc: Alex Williamson, Igor Mammedov, qemu-ppc, Thomas Huth,
Richard Henderson, Tony Krowiak, Ilya Leoshkevich, kvm, Yi Liu,
Paolo Bonzini, Zhenzhong Duan, Matthew Rosato, Eric Farman,
Peter Xu, Pierrick Bouvier, Daniel Henrique Barboza, Eric Auger,
qemu-s390x, Jason Herne, David Hildenbrand, Alex Bennée,
Harsh Prateek Bora, Nicholas Piggin, Halil Pasic,
Christian Borntraeger
On 3/7/25 19:03, Philippe Mathieu-Daudé wrote:
> Removing unused "exec/ram_addr.h" header allow to compile
> iommufd.c once for all targets.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Thanks,
C.
> ---
> hw/vfio/iommufd.c | 1 -
> hw/vfio/meson.build | 6 +++---
> 2 files changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/hw/vfio/iommufd.c b/hw/vfio/iommufd.c
> index df61edffc08..42c8412bbf5 100644
> --- a/hw/vfio/iommufd.c
> +++ b/hw/vfio/iommufd.c
> @@ -25,7 +25,6 @@
> #include "qemu/cutils.h"
> #include "qemu/chardev_open.h"
> #include "pci.h"
> -#include "exec/ram_addr.h"
>
> static int iommufd_cdev_map(const VFIOContainerBase *bcontainer, hwaddr iova,
> ram_addr_t size, void *vaddr, bool readonly)
> diff --git a/hw/vfio/meson.build b/hw/vfio/meson.build
> index 2972c6ff8de..fea6dbe88cd 100644
> --- a/hw/vfio/meson.build
> +++ b/hw/vfio/meson.build
> @@ -4,9 +4,6 @@ vfio_ss.add(files(
> 'container.c',
> ))
> vfio_ss.add(when: 'CONFIG_PSERIES', if_true: files('spapr.c'))
> -vfio_ss.add(when: 'CONFIG_IOMMUFD', if_true: files(
> - 'iommufd.c',
> -))
> vfio_ss.add(when: 'CONFIG_VFIO_PCI', if_true: files(
> 'display.c',
> 'pci-quirks.c',
> @@ -28,3 +25,6 @@ system_ss.add(when: 'CONFIG_VFIO', if_true: files(
> 'migration-multifd.c',
> 'cpr.c',
> ))
> +system_ss.add(when: ['CONFIG_VFIO', 'CONFIG_IOMMUFD'], if_true: files(
> + 'iommufd.c',
> +))
^ permalink raw reply [flat|nested] 57+ messages in thread
* Re: [PATCH 07/14] hw/vfio: Compile display.c once
2025-03-07 18:03 ` [PATCH 07/14] hw/vfio: Compile display.c once Philippe Mathieu-Daudé
2025-03-07 19:17 ` Pierrick Bouvier
2025-03-07 19:42 ` Richard Henderson
@ 2025-03-08 17:46 ` Cédric Le Goater
2 siblings, 0 replies; 57+ messages in thread
From: Cédric Le Goater @ 2025-03-08 17:46 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, qemu-devel
Cc: Alex Williamson, Igor Mammedov, qemu-ppc, Thomas Huth,
Richard Henderson, Tony Krowiak, Ilya Leoshkevich, kvm, Yi Liu,
Paolo Bonzini, Zhenzhong Duan, Matthew Rosato, Eric Farman,
Peter Xu, Pierrick Bouvier, Daniel Henrique Barboza, Eric Auger,
qemu-s390x, Jason Herne, David Hildenbrand, Alex Bennée,
Harsh Prateek Bora, Nicholas Piggin, Halil Pasic,
Christian Borntraeger
On 3/7/25 19:03, Philippe Mathieu-Daudé wrote:
> display.c doesn't rely on target specific definitions,
> move it to system_ss[] to build it once.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Thanks,
C.
> ---
> hw/vfio/meson.build | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/hw/vfio/meson.build b/hw/vfio/meson.build
> index fea6dbe88cd..96e342aa8cb 100644
> --- a/hw/vfio/meson.build
> +++ b/hw/vfio/meson.build
> @@ -5,7 +5,6 @@ vfio_ss.add(files(
> ))
> vfio_ss.add(when: 'CONFIG_PSERIES', if_true: files('spapr.c'))
> vfio_ss.add(when: 'CONFIG_VFIO_PCI', if_true: files(
> - 'display.c',
> 'pci-quirks.c',
> 'pci.c',
> ))
> @@ -28,3 +27,6 @@ system_ss.add(when: 'CONFIG_VFIO', if_true: files(
> system_ss.add(when: ['CONFIG_VFIO', 'CONFIG_IOMMUFD'], if_true: files(
> 'iommufd.c',
> ))
> +system_ss.add(when: 'CONFIG_VFIO_PCI', if_true: files(
> + 'display.c',
> +))
^ permalink raw reply [flat|nested] 57+ messages in thread
* Re: [PATCH 09/14] hw/vfio/pci: Convert CONFIG_KVM check to runtime one
2025-03-07 18:03 ` [PATCH 09/14] hw/vfio/pci: Convert CONFIG_KVM check to runtime one Philippe Mathieu-Daudé
2025-03-07 19:18 ` Pierrick Bouvier
2025-03-07 20:11 ` Richard Henderson
@ 2025-03-08 17:46 ` Cédric Le Goater
2 siblings, 0 replies; 57+ messages in thread
From: Cédric Le Goater @ 2025-03-08 17:46 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, qemu-devel
Cc: Alex Williamson, Igor Mammedov, qemu-ppc, Thomas Huth,
Richard Henderson, Tony Krowiak, Ilya Leoshkevich, kvm, Yi Liu,
Paolo Bonzini, Zhenzhong Duan, Matthew Rosato, Eric Farman,
Peter Xu, Pierrick Bouvier, Daniel Henrique Barboza, Eric Auger,
qemu-s390x, Jason Herne, David Hildenbrand, Alex Bennée,
Harsh Prateek Bora, Nicholas Piggin, Halil Pasic,
Christian Borntraeger
On 3/7/25 19:03, Philippe Mathieu-Daudé wrote:
> Use the runtime kvm_enabled() helper to check whether
> KVM is available or not.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Thanks,
C.
> ---
> hw/vfio/pci.c | 19 +++++++++----------
> 1 file changed, 9 insertions(+), 10 deletions(-)
>
> diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c
> index fdbc15885d4..9872884ff8a 100644
> --- a/hw/vfio/pci.c
> +++ b/hw/vfio/pci.c
> @@ -118,8 +118,13 @@ static void vfio_intx_eoi(VFIODevice *vbasedev)
>
> static bool vfio_intx_enable_kvm(VFIOPCIDevice *vdev, Error **errp)
> {
> -#ifdef CONFIG_KVM
> - int irq_fd = event_notifier_get_fd(&vdev->intx.interrupt);
> + int irq_fd;
> +
> + if (!kvm_enabled()) {
> + return true;
> + }
> +
> + irq_fd = event_notifier_get_fd(&vdev->intx.interrupt);
>
> if (vdev->no_kvm_intx || !kvm_irqfds_enabled() ||
> vdev->intx.route.mode != PCI_INTX_ENABLED ||
> @@ -171,16 +176,13 @@ fail_irqfd:
> fail:
> qemu_set_fd_handler(irq_fd, vfio_intx_interrupt, NULL, vdev);
> vfio_unmask_single_irqindex(&vdev->vbasedev, VFIO_PCI_INTX_IRQ_INDEX);
> +
> return false;
> -#else
> - return true;
> -#endif
> }
>
> static void vfio_intx_disable_kvm(VFIOPCIDevice *vdev)
> {
> -#ifdef CONFIG_KVM
> - if (!vdev->intx.kvm_accel) {
> + if (!kvm_enabled() || !vdev->intx.kvm_accel) {
> return;
> }
>
> @@ -211,7 +213,6 @@ static void vfio_intx_disable_kvm(VFIOPCIDevice *vdev)
> vfio_unmask_single_irqindex(&vdev->vbasedev, VFIO_PCI_INTX_IRQ_INDEX);
>
> trace_vfio_intx_disable_kvm(vdev->vbasedev.name);
> -#endif
> }
>
> static void vfio_intx_update(VFIOPCIDevice *vdev, PCIINTxRoute *route)
> @@ -278,7 +279,6 @@ static bool vfio_intx_enable(VFIOPCIDevice *vdev, Error **errp)
> vdev->intx.pin = pin - 1; /* Pin A (1) -> irq[0] */
> pci_config_set_interrupt_pin(vdev->pdev.config, pin);
>
> -#ifdef CONFIG_KVM
> /*
> * Only conditional to avoid generating error messages on platforms
> * where we won't actually use the result anyway.
> @@ -287,7 +287,6 @@ static bool vfio_intx_enable(VFIOPCIDevice *vdev, Error **errp)
> vdev->intx.route = pci_device_route_intx_to_irq(&vdev->pdev,
> vdev->intx.pin);
> }
> -#endif
>
> ret = event_notifier_init(&vdev->intx.interrupt, 0);
> if (ret) {
^ permalink raw reply [flat|nested] 57+ messages in thread
* Re: [PATCH 00/14] hw/vfio: Build various objects once
2025-03-07 18:03 [PATCH 00/14] hw/vfio: Build various objects once Philippe Mathieu-Daudé
` (13 preceding siblings ...)
2025-03-07 18:03 ` [PATCH 14/14] hw/vfio/platform: Check CONFIG_IOMMUFD at runtime using iommufd_builtin Philippe Mathieu-Daudé
@ 2025-03-08 17:48 ` Cédric Le Goater
2025-03-08 20:37 ` BALATON Zoltan
2025-03-08 22:31 ` Philippe Mathieu-Daudé
14 siblings, 2 replies; 57+ messages in thread
From: Cédric Le Goater @ 2025-03-08 17:48 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, qemu-devel
Cc: Alex Williamson, Igor Mammedov, qemu-ppc, Thomas Huth,
Richard Henderson, Tony Krowiak, Ilya Leoshkevich, kvm, Yi Liu,
Paolo Bonzini, Zhenzhong Duan, Matthew Rosato, Eric Farman,
Peter Xu, Pierrick Bouvier, Daniel Henrique Barboza, Eric Auger,
qemu-s390x, Jason Herne, David Hildenbrand, Alex Bennée,
Harsh Prateek Bora, Nicholas Piggin, Halil Pasic,
Christian Borntraeger
Hello,
On 3/7/25 19:03, Philippe Mathieu-Daudé wrote:
> By doing the following changes:
> - Clean some headers up
> - Replace compile-time CONFIG_KVM check by kvm_enabled()
> - Replace compile-time CONFIG_IOMMUFD check by iommufd_builtin()
> we can build less vfio objects.
>
> Philippe Mathieu-Daudé (14):
> hw/vfio/common: Include missing 'system/tcg.h' header
> hw/vfio/spapr: Do not include <linux/kvm.h>
> hw/vfio: Compile some common objects once
> hw/vfio: Compile more objects once
> hw/vfio: Compile iommufd.c once
> system: Declare qemu_[min/max]rampagesize() in 'system/hostmem.h'
> hw/vfio: Compile display.c once
> system/kvm: Expose kvm_irqchip_[add,remove]_change_notifier()
> hw/vfio/pci: Convert CONFIG_KVM check to runtime one
> system/iommufd: Introduce iommufd_builtin() helper
> hw/vfio/pci: Check CONFIG_IOMMUFD at runtime using iommufd_builtin()
> hw/vfio/ap: Check CONFIG_IOMMUFD at runtime using iommufd_builtin()
> hw/vfio/ccw: Check CONFIG_IOMMUFD at runtime using iommufd_builtin()
> hw/vfio/platform: Check CONFIG_IOMMUFD at runtime using
> iommufd_builtin
>
> docs/devel/vfio-iommufd.rst | 2 +-
> include/exec/ram_addr.h | 3 --
> include/system/hostmem.h | 3 ++
> include/system/iommufd.h | 8 +++++
> include/system/kvm.h | 8 ++---
> target/s390x/kvm/kvm_s390x.h | 2 +-
> accel/stubs/kvm-stub.c | 12 ++++++++
> hw/ppc/spapr_caps.c | 1 +
> hw/s390x/s390-virtio-ccw.c | 1 +
> hw/vfio/ap.c | 27 ++++++++---------
> hw/vfio/ccw.c | 27 ++++++++---------
> hw/vfio/common.c | 1 +
> hw/vfio/iommufd.c | 1 -
> hw/vfio/migration.c | 1 -
> hw/vfio/pci.c | 57 +++++++++++++++++-------------------
> hw/vfio/platform.c | 25 ++++++++--------
> hw/vfio/spapr.c | 4 +--
> hw/vfio/meson.build | 33 ++++++++++++---------
> 18 files changed, 117 insertions(+), 99 deletions(-)
>
Patches 1-9 look ok and should be considered for the next PR if
maintainers ack patch 6 and 8.
Some comments,
vfio-amd-xgbe and vfio-calxeda-xgmac should be treated like
vfio-platform, and since vfio-platform was designed for aarch64,
these devices should not be available on arm, ppc, ppc64, riscv*,
loongarch. That said, vfio-platform and devices being deprecated in
the QEMU 10.0 cycle, we could just wait for the removal in QEMU 10.2.
How could we (simply) remove CONFIG_VFIO_IGD in hw/vfio/pci-quirks.c ?
and compile this file only once.
The vfio-pci devices are available in nearly all targets when it
only makes sense to have them in i386, x86_64, aarch64, ppc64,
where they are supported, and also possibly in ppc (tcg) and arm
(tcg) for historical reasons and just because they happen to work.
ppc (tcg) doesn't support MSIs with vfio-pci devices so I don't
think we care much.
Patches 10-14 are wrong because they remove the "iommufd" property of
the "vfio-*" devices. We can't take these.
Thanks,
C.
^ permalink raw reply [flat|nested] 57+ messages in thread
* Re: [PATCH 00/14] hw/vfio: Build various objects once
2025-03-08 17:48 ` [PATCH 00/14] hw/vfio: Build various objects once Cédric Le Goater
@ 2025-03-08 20:37 ` BALATON Zoltan
2025-03-08 22:31 ` Philippe Mathieu-Daudé
1 sibling, 0 replies; 57+ messages in thread
From: BALATON Zoltan @ 2025-03-08 20:37 UTC (permalink / raw)
To: Cédric Le Goater
Cc: Philippe Mathieu-Daudé, qemu-devel, Alex Williamson,
Igor Mammedov, qemu-ppc, Thomas Huth, Richard Henderson,
Tony Krowiak, Ilya Leoshkevich, kvm, Yi Liu, Paolo Bonzini,
Zhenzhong Duan, Matthew Rosato, Eric Farman, Peter Xu,
Pierrick Bouvier, Daniel Henrique Barboza, Eric Auger, qemu-s390x,
Jason Herne, David Hildenbrand, Alex Bennée,
Harsh Prateek Bora, Nicholas Piggin, Halil Pasic,
Christian Borntraeger
[-- Attachment #1: Type: text/plain, Size: 3719 bytes --]
On Sat, 8 Mar 2025, Cédric Le Goater wrote:
> Hello,
>
> On 3/7/25 19:03, Philippe Mathieu-Daudé wrote:
>> By doing the following changes:
>> - Clean some headers up
>> - Replace compile-time CONFIG_KVM check by kvm_enabled()
>> - Replace compile-time CONFIG_IOMMUFD check by iommufd_builtin()
>> we can build less vfio objects.
>>
>> Philippe Mathieu-Daudé (14):
>> hw/vfio/common: Include missing 'system/tcg.h' header
>> hw/vfio/spapr: Do not include <linux/kvm.h>
>> hw/vfio: Compile some common objects once
>> hw/vfio: Compile more objects once
>> hw/vfio: Compile iommufd.c once
>> system: Declare qemu_[min/max]rampagesize() in 'system/hostmem.h'
>> hw/vfio: Compile display.c once
>> system/kvm: Expose kvm_irqchip_[add,remove]_change_notifier()
>> hw/vfio/pci: Convert CONFIG_KVM check to runtime one
>> system/iommufd: Introduce iommufd_builtin() helper
>> hw/vfio/pci: Check CONFIG_IOMMUFD at runtime using iommufd_builtin()
>> hw/vfio/ap: Check CONFIG_IOMMUFD at runtime using iommufd_builtin()
>> hw/vfio/ccw: Check CONFIG_IOMMUFD at runtime using iommufd_builtin()
>> hw/vfio/platform: Check CONFIG_IOMMUFD at runtime using
>> iommufd_builtin
>>
>> docs/devel/vfio-iommufd.rst | 2 +-
>> include/exec/ram_addr.h | 3 --
>> include/system/hostmem.h | 3 ++
>> include/system/iommufd.h | 8 +++++
>> include/system/kvm.h | 8 ++---
>> target/s390x/kvm/kvm_s390x.h | 2 +-
>> accel/stubs/kvm-stub.c | 12 ++++++++
>> hw/ppc/spapr_caps.c | 1 +
>> hw/s390x/s390-virtio-ccw.c | 1 +
>> hw/vfio/ap.c | 27 ++++++++---------
>> hw/vfio/ccw.c | 27 ++++++++---------
>> hw/vfio/common.c | 1 +
>> hw/vfio/iommufd.c | 1 -
>> hw/vfio/migration.c | 1 -
>> hw/vfio/pci.c | 57 +++++++++++++++++-------------------
>> hw/vfio/platform.c | 25 ++++++++--------
>> hw/vfio/spapr.c | 4 +--
>> hw/vfio/meson.build | 33 ++++++++++++---------
>> 18 files changed, 117 insertions(+), 99 deletions(-)
>>
>
> Patches 1-9 look ok and should be considered for the next PR if
> maintainers ack patch 6 and 8.
>
>
> Some comments,
>
> vfio-amd-xgbe and vfio-calxeda-xgmac should be treated like
> vfio-platform, and since vfio-platform was designed for aarch64,
> these devices should not be available on arm, ppc, ppc64, riscv*,
> loongarch. That said, vfio-platform and devices being deprecated in
> the QEMU 10.0 cycle, we could just wait for the removal in QEMU 10.2.
>
> How could we (simply) remove CONFIG_VFIO_IGD in hw/vfio/pci-quirks.c ?
> and compile this file only once.
>
> The vfio-pci devices are available in nearly all targets when it
> only makes sense to have them in i386, x86_64, aarch64, ppc64,
> where they are supported, and also possibly in ppc (tcg) and arm
> (tcg) for historical reasons and just because they happen to work.
> ppc (tcg) doesn't support MSIs with vfio-pci devices so I don't
> think we care much.
Maybe it does not support MSI yet but if it can be fixed I might be
interested later. But I don't know how that should work and what's needed
for it in QEMU. There are ppc machines with PCIe ports (like sam460ex but
I did not implement PCIe on it yet) and some GPUs could be used on those
so having MSI might help or be needed. If it works on the real machine it
could work on QEMU too. Currently people who tried GPU pass through on ppc
told that it works but slow. I don't know the why or how to debug that but
could it be due to missing MSI support? If so we might be interested to
solve that eventually if possible.
Regards,
BALATON Zoltan
^ permalink raw reply [flat|nested] 57+ messages in thread
* Re: [PATCH 08/14] system/kvm: Expose kvm_irqchip_[add,remove]_change_notifier()
2025-03-07 20:09 ` Richard Henderson
@ 2025-03-08 22:18 ` Philippe Mathieu-Daudé
0 siblings, 0 replies; 57+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-03-08 22:18 UTC (permalink / raw)
To: Richard Henderson, qemu-devel
On 7/3/25 21:09, Richard Henderson wrote:
> On 3/7/25 10:03, Philippe Mathieu-Daudé wrote:
>> Currently kvm_irqchip_add_irqfd_notifier() and
>> kvm_irqchip_remove_irqfd_notifier() are only declared on
>> target specific code. There is not particular reason to,
>> as their prototypes don't use anything target related.
>>
>> Move their declaration with common prototypes, and
>> implement their stub.
>
> The description is not accurate, because the new stubs are
> *not* for the functions whose declaration you move.
>
> This feels like two different changes.
Oops. I don't remember why I added the stubs, they are used
in vfio-ap but I can't reproduce a build failure. I'll just
remove them.
^ permalink raw reply [flat|nested] 57+ messages in thread
* Re: [PATCH 00/14] hw/vfio: Build various objects once
2025-03-08 17:48 ` [PATCH 00/14] hw/vfio: Build various objects once Cédric Le Goater
2025-03-08 20:37 ` BALATON Zoltan
@ 2025-03-08 22:31 ` Philippe Mathieu-Daudé
1 sibling, 0 replies; 57+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-03-08 22:31 UTC (permalink / raw)
To: Cédric Le Goater, qemu-devel
Cc: Alex Williamson, Igor Mammedov, qemu-ppc, Thomas Huth,
Richard Henderson, Tony Krowiak, Ilya Leoshkevich, kvm, Yi Liu,
Paolo Bonzini, Zhenzhong Duan, Matthew Rosato, Eric Farman,
Peter Xu, Pierrick Bouvier, Daniel Henrique Barboza, Eric Auger,
qemu-s390x, Jason Herne, David Hildenbrand, Alex Bennée,
Harsh Prateek Bora, Nicholas Piggin, Halil Pasic,
Christian Borntraeger
On 8/3/25 18:48, Cédric Le Goater wrote:
> Hello,
>
> On 3/7/25 19:03, Philippe Mathieu-Daudé wrote:
>> By doing the following changes:
>> - Clean some headers up
>> - Replace compile-time CONFIG_KVM check by kvm_enabled()
>> - Replace compile-time CONFIG_IOMMUFD check by iommufd_builtin()
>> we can build less vfio objects.
>>
>> Philippe Mathieu-Daudé (14):
>> hw/vfio/common: Include missing 'system/tcg.h' header
>> hw/vfio/spapr: Do not include <linux/kvm.h>
>> hw/vfio: Compile some common objects once
>> hw/vfio: Compile more objects once
>> hw/vfio: Compile iommufd.c once
>> system: Declare qemu_[min/max]rampagesize() in 'system/hostmem.h'
>> hw/vfio: Compile display.c once
>> system/kvm: Expose kvm_irqchip_[add,remove]_change_notifier()
>> hw/vfio/pci: Convert CONFIG_KVM check to runtime one
>> system/iommufd: Introduce iommufd_builtin() helper
>> hw/vfio/pci: Check CONFIG_IOMMUFD at runtime using iommufd_builtin()
>> hw/vfio/ap: Check CONFIG_IOMMUFD at runtime using iommufd_builtin()
>> hw/vfio/ccw: Check CONFIG_IOMMUFD at runtime using iommufd_builtin()
>> hw/vfio/platform: Check CONFIG_IOMMUFD at runtime using
>> iommufd_builtin
>>
>> docs/devel/vfio-iommufd.rst | 2 +-
>> include/exec/ram_addr.h | 3 --
>> include/system/hostmem.h | 3 ++
>> include/system/iommufd.h | 8 +++++
>> include/system/kvm.h | 8 ++---
>> target/s390x/kvm/kvm_s390x.h | 2 +-
>> accel/stubs/kvm-stub.c | 12 ++++++++
>> hw/ppc/spapr_caps.c | 1 +
>> hw/s390x/s390-virtio-ccw.c | 1 +
>> hw/vfio/ap.c | 27 ++++++++---------
>> hw/vfio/ccw.c | 27 ++++++++---------
>> hw/vfio/common.c | 1 +
>> hw/vfio/iommufd.c | 1 -
>> hw/vfio/migration.c | 1 -
>> hw/vfio/pci.c | 57 +++++++++++++++++-------------------
>> hw/vfio/platform.c | 25 ++++++++--------
>> hw/vfio/spapr.c | 4 +--
>> hw/vfio/meson.build | 33 ++++++++++++---------
>> 18 files changed, 117 insertions(+), 99 deletions(-)
>>
>
> Patches 1-9 look ok and should be considered for the next PR if
> maintainers ack patch 6 and 8.
OK.
> vfio-amd-xgbe and vfio-calxeda-xgmac should be treated like
> vfio-platform, and since vfio-platform was designed for aarch64,
> these devices should not be available on arm, ppc, ppc64, riscv*,
> loongarch. That said, vfio-platform and devices being deprecated in
> the QEMU 10.0 cycle, we could just wait for the removal in QEMU 10.2.
>
> How could we (simply) remove CONFIG_VFIO_IGD in hw/vfio/pci-quirks.c ?
> and compile this file only once.
>
> The vfio-pci devices are available in nearly all targets when it
> only makes sense to have them in i386, x86_64, aarch64, ppc64,
> where they are supported, and also possibly in ppc (tcg) and arm
> (tcg) for historical reasons and just because they happen to work.
> ppc (tcg) doesn't support MSIs with vfio-pci devices so I don't
> think we care much.
>
> Patches 10-14 are wrong because they remove the "iommufd" property of
> the "vfio-*" devices. We can't take these.
I suppose this is due to the wrong implementation of iommufd_builtin()
I mentioned in patch #10, which check instance but not class.
Thanks!
^ permalink raw reply [flat|nested] 57+ messages in thread
end of thread, other threads:[~2025-03-08 22:32 UTC | newest]
Thread overview: 57+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-07 18:03 [PATCH 00/14] hw/vfio: Build various objects once Philippe Mathieu-Daudé
2025-03-07 18:03 ` [PATCH 01/14] hw/vfio/common: Include missing 'system/tcg.h' header Philippe Mathieu-Daudé
2025-03-07 19:14 ` Pierrick Bouvier
2025-03-07 19:35 ` Richard Henderson
2025-03-08 17:39 ` Cédric Le Goater
2025-03-07 18:03 ` [PATCH 02/14] hw/vfio/spapr: Do not include <linux/kvm.h> Philippe Mathieu-Daudé
2025-03-07 19:14 ` Pierrick Bouvier
2025-03-07 19:39 ` Richard Henderson
2025-03-08 17:39 ` Cédric Le Goater
2025-03-07 18:03 ` [PATCH 03/14] hw/vfio: Compile some common objects once Philippe Mathieu-Daudé
2025-03-07 19:15 ` Pierrick Bouvier
2025-03-07 19:40 ` Richard Henderson
2025-03-08 17:39 ` Cédric Le Goater
2025-03-07 18:03 ` [PATCH 04/14] hw/vfio: Compile more " Philippe Mathieu-Daudé
2025-03-07 19:15 ` Pierrick Bouvier
2025-03-07 19:40 ` Richard Henderson
2025-03-08 17:45 ` Cédric Le Goater
2025-03-07 18:03 ` [PATCH 05/14] hw/vfio: Compile iommufd.c once Philippe Mathieu-Daudé
2025-03-07 19:16 ` Pierrick Bouvier
2025-03-07 19:41 ` Richard Henderson
2025-03-08 17:45 ` Cédric Le Goater
2025-03-07 18:03 ` [PATCH 06/14] system: Declare qemu_[min/max]rampagesize() in 'system/hostmem.h' Philippe Mathieu-Daudé
2025-03-07 19:16 ` Pierrick Bouvier
2025-03-07 21:12 ` Philippe Mathieu-Daudé
2025-03-07 18:03 ` [PATCH 07/14] hw/vfio: Compile display.c once Philippe Mathieu-Daudé
2025-03-07 19:17 ` Pierrick Bouvier
2025-03-07 19:42 ` Richard Henderson
2025-03-08 17:46 ` Cédric Le Goater
2025-03-07 18:03 ` [PATCH 08/14] system/kvm: Expose kvm_irqchip_[add, remove]_change_notifier() Philippe Mathieu-Daudé
2025-03-07 19:17 ` [PATCH 08/14] system/kvm: Expose kvm_irqchip_[add,remove]_change_notifier() Pierrick Bouvier
2025-03-07 20:09 ` Richard Henderson
2025-03-08 22:18 ` Philippe Mathieu-Daudé
2025-03-07 18:03 ` [PATCH 09/14] hw/vfio/pci: Convert CONFIG_KVM check to runtime one Philippe Mathieu-Daudé
2025-03-07 19:18 ` Pierrick Bouvier
2025-03-07 20:11 ` Richard Henderson
2025-03-08 17:46 ` Cédric Le Goater
2025-03-07 18:03 ` [PATCH 10/14] system/iommufd: Introduce iommufd_builtin() helper Philippe Mathieu-Daudé
2025-03-07 19:18 ` Pierrick Bouvier
2025-03-07 20:33 ` Richard Henderson
2025-03-08 7:48 ` Philippe Mathieu-Daudé
2025-03-07 18:03 ` [PATCH 11/14] hw/vfio/pci: Check CONFIG_IOMMUFD at runtime using iommufd_builtin() Philippe Mathieu-Daudé
2025-03-07 19:19 ` Pierrick Bouvier
2025-03-07 20:35 ` Richard Henderson
2025-03-07 18:03 ` [PATCH 12/14] hw/vfio/ap: " Philippe Mathieu-Daudé
2025-03-07 19:19 ` Pierrick Bouvier
2025-03-07 20:42 ` Richard Henderson
2025-03-07 21:08 ` Philippe Mathieu-Daudé
2025-03-07 18:03 ` [PATCH 13/14] hw/vfio/ccw: " Philippe Mathieu-Daudé
2025-03-07 19:19 ` Pierrick Bouvier
2025-03-07 20:45 ` Richard Henderson
2025-03-07 21:09 ` Philippe Mathieu-Daudé
2025-03-07 18:03 ` [PATCH 14/14] hw/vfio/platform: Check CONFIG_IOMMUFD at runtime using iommufd_builtin Philippe Mathieu-Daudé
2025-03-07 19:20 ` Pierrick Bouvier
2025-03-07 20:48 ` Richard Henderson
2025-03-08 17:48 ` [PATCH 00/14] hw/vfio: Build various objects once Cédric Le Goater
2025-03-08 20:37 ` BALATON Zoltan
2025-03-08 22:31 ` Philippe Mathieu-Daudé
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).