hw/ppc/Kconfig: Imply VFIO_PCI
PATCH 1/1 hw/ppc/Kconfig: Imply VFIO_PCI
When the legacy and iommufd backends were introduced, a set of common vfio-pci routines were exported in pci.c for both backends to use :
vfio_pci_pre_reset
vfio_pci_get_pci_hot_reset_info
vfio_pci_host_match
vfio_pci_post_reset
This introduced a build failure on PPC when --without-default-devices is use because VFIO is always selected in ppc/Kconfig but VFIO_PCI is not.
Use an 'imply VFIO_PCI' in ppc/Kconfig and bypass compilation of the VFIO EEH hooks routines defined in hw/ppc/spapr_pci_vfio.c with CONFIG_VFIO_PCI.
--- hw/ppc/spapr_pci_vfio.c | 36 ++++++++++++++++++++++++++++++++++++ hw/ppc/Kconfig | 2 +- 2 files changed, 37 insertions(+), 1 deletion(-)
hw/ppc/spapr_pci_vfio.c +36 -0
@@ -26,10 +26,12 @@#include "hw/pci/pci_device.h" #include "hw/vfio/vfio-common.h" #include "qemu/error-report.h" +#include CONFIG_DEVICES /* CONFIG_VFIO_PCI */ /* * Interfaces for IBM EEH (Enhanced Error Handling) */ +#ifdef CONFIG_VFIO_PCI static bool vfio_eeh_container_ok (VFIOContainer *container) {/*
@@ -314,3 +316,37 @@ int spapr_phb_vfio_eeh_configure(SpaprPhbState *sphb) return RTAS_OUT_SUCCESS; } + +#else + +bool spapr_phb_eeh_available (SpaprPhbState *sphb) +{ +return false; +} + +void spapr_phb_vfio_reset (DeviceState *qdev) +{ +} + +int spapr_phb_vfio_eeh_set_option (SpaprPhbState *sphb, +unsigned int addr,int option) +{ +return RTAS_OUT_NOT_SUPPORTED ; +} + +int spapr_phb_vfio_eeh_get_state (SpaprPhbState *sphb,int *state) +{ +return RTAS_OUT_NOT_SUPPORTED ; +} + +int spapr_phb_vfio_eeh_reset (SpaprPhbState *sphb,int option) +{ +return RTAS_OUT_NOT_SUPPORTED ; +} + +int spapr_phb_vfio_eeh_configure (SpaprPhbState *sphb) +{ +return RTAS_OUT_NOT_SUPPORTED ; +} + +#endif /* CONFIG_VFIO_PCI */
hw/ppc/Kconfig +1 -1
@@ -3,11 +3,11 @@ config PSERIES imply PCI_DEVICES imply TEST_DEVICES imply VIRTIO_VGA + imply VFIO_PCI if LINUX # needed by spapr_pci_vfio.c select NVDIMM select DIMM select PCI select SPAPR_VSCSI - select VFIO if LINUX # needed by spapr_pci_vfio.c select XICS select XIVE select MSI_NONBROKEN
Signature · 1 line
2.42.0
Quoted 16 lines · Cédric Le Goater
When the legacy and iommufd backends were introduced, a set of common vfio-pci routines were exported in
pci.cfor both backends to use :
vfio_pci_pre_reset
vfio_pci_get_pci_hot_reset_info
vfio_pci_host_match
vfio_pci_post_resetThis introduced a build failure on PPC when --without-default-devices is use because VFIO is always selected in ppc/Kconfig but
VFIO_PCIis not.Use an 'imply
VFIO_PCI' in ppc/Kconfig and bypass compilation of the VFIO EEH hooks routines defined inhw/ppc/spapr_pci_vfio.cwithCONFIG_VFIO_PCI.
Quoted 6 lines
Signed-off-by Zhenzhong Duan <[email protected]>Signed-off-by Cédric Le Goater <[email protected]>--- hw/ppc/spapr_pci_vfio.c | 36 ++++++++++++++++++++++++++++++++++++ hw/ppc/Kconfig | 2 +- 2 files changed, 37 insertions(+), 1 deletion(-)
Thanks for reworking it without adding more stubs :)
Quoted 24 lines · Philippe Mathieu-Daudé
Quoted 16 lines · Cédric Le Goater
When the legacy and iommufd backends were introduced, a set of common vfio-pci routines were exported in
pci.cfor both backends to use :
vfio_pci_pre_reset
vfio_pci_get_pci_hot_reset_info
vfio_pci_host_match
vfio_pci_post_resetThis introduced a build failure on PPC when --without-default-devices is use because VFIO is always selected in ppc/Kconfig but
VFIO_PCIis not.Use an 'imply
VFIO_PCI' in ppc/Kconfig and bypass compilation of the VFIO EEH hooks routines defined inhw/ppc/spapr_pci_vfio.cwithCONFIG_VFIO_PCI.Quoted 6 lines
Signed-off-by Zhenzhong Duan <[email protected]>Signed-off-by Cédric Le Goater <[email protected]>---
hw/ppc/spapr_pci_vfio.c| 36 ++++++++++++++++++++++++++++++++++++ hw/ppc/Kconfig | 2 +-2 files changed, 37 insertions(+), 1 deletion(-)
Quoted 3 lines
Reviewed-by Philippe Mathieu-Daudé <[email protected]>Thanks for reworking it without adding more stubs :)
yeah. no problem. It is simpler that way.
Thanks,
C.
Cédric Le Goater
AppliedQuoted 12 lines · Cédric Le Goater
When the legacy and iommufd backends were introduced, a set of common vfio-pci routines were exported in
pci.cfor both backends to use :
vfio_pci_pre_reset
vfio_pci_get_pci_hot_reset_info
vfio_pci_host_match
vfio_pci_post_resetThis introduced a build failure on PPC when --without-default-devices is use because VFIO is always selected in ppc/Kconfig but
VFIO_PCIis not.
Quoted 6 lines
Use an 'imply
VFIO_PCI' in ppc/Kconfig and bypass compilation of the VFIO EEH hooks routines defined inhw/ppc/spapr_pci_vfio.cwithCONFIG_VFIO_PCI.Signed-off-by Zhenzhong Duan <[email protected]>Signed-off-by Cédric Le Goater <[email protected]>
Applied to vfio-next.
Thanks,
C.