* [PATCH] hw/ppc/Kconfig: Imply VFIO_PCI
@ 2023-11-24 8:06 Cédric Le Goater
2023-11-24 10:10 ` Philippe Mathieu-Daudé
2023-11-28 17:11 ` Cédric Le Goater
0 siblings, 2 replies; 4+ messages in thread
From: Cédric Le Goater @ 2023-11-24 8:06 UTC (permalink / raw)
To: qemu-ppc, qemu-devel
Cc: Paolo Bonzini, Nicholas Piggin, Daniel Henrique Barboza,
Harsh Prateek Bora, David Gibson, Zhenzhong Duan,
Cédric Le Goater
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.
Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
Signed-off-by: Cédric Le Goater <clg@redhat.com>
---
hw/ppc/spapr_pci_vfio.c | 36 ++++++++++++++++++++++++++++++++++++
hw/ppc/Kconfig | 2 +-
2 files changed, 37 insertions(+), 1 deletion(-)
diff --git a/hw/ppc/spapr_pci_vfio.c b/hw/ppc/spapr_pci_vfio.c
index d1d07bec4644da4ae6a99d3357d6d17ff66264de..76b2a3487b5d6f21528e9c301341eb27bc8fec1d 100644
--- a/hw/ppc/spapr_pci_vfio.c
+++ b/hw/ppc/spapr_pci_vfio.c
@@ -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 */
diff --git a/hw/ppc/Kconfig b/hw/ppc/Kconfig
index 56f0475a8e2e46e433d9df02460aec65e26d77a5..44263a58c4d3202afbe8bb44c67701bded855a57 100644
--- a/hw/ppc/Kconfig
+++ b/hw/ppc/Kconfig
@@ -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
--
2.42.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] hw/ppc/Kconfig: Imply VFIO_PCI
2023-11-24 8:06 [PATCH] hw/ppc/Kconfig: Imply VFIO_PCI Cédric Le Goater
@ 2023-11-24 10:10 ` Philippe Mathieu-Daudé
2023-11-24 12:32 ` Cédric Le Goater
2023-11-28 17:11 ` Cédric Le Goater
1 sibling, 1 reply; 4+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-11-24 10:10 UTC (permalink / raw)
To: Cédric Le Goater, qemu-ppc, qemu-devel
Cc: Paolo Bonzini, Nicholas Piggin, Daniel Henrique Barboza,
Harsh Prateek Bora, David Gibson, Zhenzhong Duan
On 24/11/23 09:06, Cédric Le Goater wrote:
> 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.
>
> Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
> Signed-off-by: Cédric Le Goater <clg@redhat.com>
> ---
> hw/ppc/spapr_pci_vfio.c | 36 ++++++++++++++++++++++++++++++++++++
> hw/ppc/Kconfig | 2 +-
> 2 files changed, 37 insertions(+), 1 deletion(-)
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Thanks for reworking it without adding more stubs :)
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] hw/ppc/Kconfig: Imply VFIO_PCI
2023-11-24 10:10 ` Philippe Mathieu-Daudé
@ 2023-11-24 12:32 ` Cédric Le Goater
0 siblings, 0 replies; 4+ messages in thread
From: Cédric Le Goater @ 2023-11-24 12:32 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, qemu-ppc, qemu-devel
Cc: Paolo Bonzini, Nicholas Piggin, Daniel Henrique Barboza,
Harsh Prateek Bora, David Gibson, Zhenzhong Duan
On 11/24/23 11:10, Philippe Mathieu-Daudé wrote:
> On 24/11/23 09:06, Cédric Le Goater wrote:
>> 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.
>>
>> Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
>> Signed-off-by: Cédric Le Goater <clg@redhat.com>
>> ---
>> hw/ppc/spapr_pci_vfio.c | 36 ++++++++++++++++++++++++++++++++++++
>> hw/ppc/Kconfig | 2 +-
>> 2 files changed, 37 insertions(+), 1 deletion(-)
>
> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>
> Thanks for reworking it without adding more stubs :)
yeah. no problem. It is simpler that way.
Thanks,
C.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] hw/ppc/Kconfig: Imply VFIO_PCI
2023-11-24 8:06 [PATCH] hw/ppc/Kconfig: Imply VFIO_PCI Cédric Le Goater
2023-11-24 10:10 ` Philippe Mathieu-Daudé
@ 2023-11-28 17:11 ` Cédric Le Goater
1 sibling, 0 replies; 4+ messages in thread
From: Cédric Le Goater @ 2023-11-28 17:11 UTC (permalink / raw)
To: qemu-ppc, qemu-devel
Cc: Paolo Bonzini, Nicholas Piggin, Daniel Henrique Barboza,
Harsh Prateek Bora, David Gibson, Zhenzhong Duan
On 11/24/23 09:06, Cédric Le Goater wrote:
> 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.
>
> Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
> Signed-off-by: Cédric Le Goater <clg@redhat.com>
Applied to vfio-next.
Thanks,
C.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-11-28 17:11 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-24 8:06 [PATCH] hw/ppc/Kconfig: Imply VFIO_PCI Cédric Le Goater
2023-11-24 10:10 ` Philippe Mathieu-Daudé
2023-11-24 12:32 ` Cédric Le Goater
2023-11-28 17:11 ` Cédric Le Goater
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).