>-----Original Message----- >From: Duan, Zhenzhong >Sent: Wednesday, November 8, 2023 4:38 PM >Subject: RE: [PATCH v4 00/41] vfio: Adopt iommufd > > > >>-----Original Message----- >>From: Matthew Rosato <mjros...@linux.ibm.com> >>Sent: Wednesday, November 8, 2023 11:27 AM >>Subject: Re: [PATCH v4 00/41] vfio: Adopt iommufd >> >>On 11/7/23 1:28 PM, Cédric Le Goater wrote: >>> On 11/2/23 08:12, Zhenzhong Duan wrote: >>>> Hi, >>>> >>>> Thanks all for giving guides and comments on previous series, here is >>>> the v4 of pure iommufd support part. >>>> >>>> Based on Cédric's suggestion, this series includes an effort to remove >>>> spapr code from container.c, now all spapr functions are moved to spapr.c >>>> or spapr_pci_vfio.c, but there are still a few trival check on >>>> VFIO_SPAPR_TCE_*_IOMMU which I am not sure if deserved to introduce >>many >>>> callbacks and duplicate code just to remove them. Some functions are moved >>>> to spapr.c instead of spapr_pci_vfio.c to avoid compile issue because >>>> spapr_pci_vfio.c is arch specific, or else we need to introduce stub >>>> functions to those spapr functions moved. >>>> >>>> >>>> PATCH 1-5: Move spapr functions to spapr*.c >>>> PATCH 6-20: Abstract out base container >>>> PATCH 21-24: Introduce sparpr container and its specific interface >>> >>> PATCH 6-24 applied to vfio-next : >>> >>> https://github.com/legoater/qemu/commits/vfio-next >>> >>> (with a global s/fucntional/functional/) >>> >>> >>> I also pushed the remaining patches on : >>> >>> https://github.com/legoater/qemu/commits/vfio-8.2 >>> >>> with a slight rework of the IOMMUFD configuration, now done per platform. >>> The VFIO frontend and the 'iommufd' object are only available on x86_64, >>> arm, s390x. > >Thanks Cédric. > >> >>FYI, I first tried this vfio-8.2 branch on s390x but wasn't actually able to >>use the >>iommufd backend (was getting errors like Property 'vfio-pci.iommufd' not >>found) >>so I think something isn't actually enabling IOMMUFD as expected with your >>change... > >It looks CONFIG_IOMMUFD is recognized by Kconfig sub-system but not received >by compiler. I'm still digging how to pass CONFIG_IOMMUFD to compiler.
Need below change to pass CONFIG_IOMMUFD to compiler. diff --git a/hw/vfio/ap.c b/hw/vfio/ap.c index 0a810f8b88..2a3263b51f 100644 --- a/hw/vfio/ap.c +++ b/hw/vfio/ap.c @@ -30,6 +30,7 @@ #include "exec/address-spaces.h" #include "qom/object.h" #include "monitor/monitor.h" +#include CONFIG_DEVICES #define TYPE_VFIO_AP_DEVICE "vfio-ap" diff --git a/hw/vfio/ccw.c b/hw/vfio/ccw.c index a674bd8d6d..08101ad445 100644 --- a/hw/vfio/ccw.c +++ b/hw/vfio/ccw.c @@ -31,6 +31,7 @@ #include "qemu/main-loop.h" #include "qemu/module.h" #include "monitor/monitor.h" +#include CONFIG_DEVICES struct VFIOCCWDevice { S390CCWDevice cdev; diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index d8f658ea47..3121b5f985 100644 --- a/hw/vfio/pci.c +++ b/hw/vfio/pci.c @@ -44,6 +44,7 @@ #include "migration/qemu-file.h" #include "sysemu/iommufd.h" #include "monitor/monitor.h" +#include CONFIG_DEVICES #define TYPE_VFIO_PCI_NOHOTPLUG "vfio-pci-nohotplug" Thanks Zhenzhong