ppc/pnv: fix build dependencies
cover ppc/pnv: fix build dependencies
Building only POWERNV machine without PSERIES machine fails because of a couple of reasons:
- qtest uses rtas function only provided by PSERIES,
- the dependency to PCI Express has been added to XIVE_SPAPR rather than to POWERNV
Laurent Vivier (2):
qtest: Fix rtas dependencies
ppc/pnv: Fix PCI_EXPRESS dependency
hw/ppc/Kconfig | 6 ++++-- qtest.c | 5 +++-- 2 files changed, 7 insertions(+), 4 deletions(-)
Signature · 1 line
2.24.1
PATCH 1/2 qtest: Fix rtas dependencies
qtest "rtas" command is only available with pseries not all ppc64 targets, so if I try to compile only powernv machine, the build fails with:
/usr/bin/ld: qtest.o: in function `qtest_process_command':
.../qtest.c:645: undefined reference to `qtest_rtas_call'
We fix this by enabling rtas command only with pseries machine.
--- qtest.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
qtest.c +3 -2
@@ -27,7 +27,8 @@#include "qemu/error-report.h" #include "qemu/module.h" #include "qemu/cutils.h" -#ifdef TARGET_PPC64 +#include "config-devices.h" +#ifdef CONFIG_PSERIES #include "hw/ppc/spapr_rtas.h" #endif
@@ -628,7 +629,7 @@ static void qtest_process_command(CharBackend *chr, gchar **words)#else qtest_sendf (chr,"OK little\n" );#endif -#ifdef TARGET_PPC64 +#ifdef CONFIG_PSERIES }else if (strcmp (words[0 ],"rtas" ) ==0 ) {uint64_t res, args, ret;unsigned long nargs, nret;
Signature · 1 line
2.24.1
Re: [PATCH 1/2] qtest: Fix rtas dependencies
Quoted 9 lines · Laurent Vivier
qtest "rtas" command is only available with pseries not all ppc64 targets, so if I try to compile only powernv machine, the build fails with:
/usr/bin/ld: qtest.o: in function `qtest_process_command':
.../qtest.c:645: undefined reference to `qtest_rtas_call'We fix this by enabling rtas command only with pseries machine.
Fixes eeddd59f5962 ("tests: add RTAS command in the protocol")
Well, at that point in time CONFIG_PSERIES was not available yet ... so not sure if the "Fixes:" really makes sense here...
But apart from that:
Quoted 29 lines
Signed-off-by Laurent Vivier <[email protected]>--- qtest.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)qtest.c +3
-2@@ -27,7 +27,8 @@#include "qemu/error-report.h" #include "qemu/module.h" #include "qemu/cutils.h" -#ifdef TARGET_PPC64 +#include "config-devices.h" +#ifdef CONFIG_PSERIES #include "hw/ppc/spapr_rtas.h" #endif @@ -628,7 +629,7 @@ static void qtest_process_command(CharBackend *chr, gchar **words)#else qtest_sendf (chr,"OK little\n" );#endif -#ifdef TARGET_PPC64 +#ifdef CONFIG_PSERIES }else if (strcmp (words[0 ],"rtas" ) ==0 ) {uint64_t res, args, ret;unsigned long nargs, nret;
Re: [PATCH 1/2] qtest: Fix rtas dependencies
Quoted 7 lines · Thomas Huth
Quoted 6 lines · Laurent Vivier
qtest "rtas" command is only available with pseries not all ppc64 targets, so if I try to compile only powernv machine, the build fails with:
/usr/bin/ld: qtest.o: in function `qtest_process_command':
.../qtest.c:645: undefined reference to `qtest_rtas_call'
Quoted 6 lines
Quoted 3 lines
We fix this by enabling rtas command only with pseries machine.
Fixes eeddd59f5962 ("tests: add RTAS command in the protocol")Well, at that point in time
CONFIG_PSERIESwas not available yet ... so not sure if the "Fixes:" really makes sense here...
You are right, but I think it's interesting to show the dependency we have between patches.
Quoted 3 lines
But apart from that:
Reviewed-by Thomas Huth <[email protected]>
Thank you!
Laurent
PATCH 2/2 ppc/pnv: Fix PCI_EXPRESS dependency
In reply to Laurent VivierWhen PHB4 bridge has been added, the dependencies to PCIE_PORT has been added to XIVE_SPAPR and indirectly to PSERIES.
The build of the PowerNV machine is fine while we also build the PSERIES machine.
If we disable the PSERIES machine, the PowerNV build fails because the PCI Express files are not built:
/usr/bin/ld: hw/ppc/pnv.o: in function `pnv_chip_power8_pic_print_info':.../hw/ppc/pnv.c:623: undefined reference to pnv_phb3_msi_pic_print_info' /usr/bin/ld: hw/ppc/pnv.o: in function pnv_chip_power9_pic_print_info':.../hw/ppc/pnv.c:639: undefined reference to `pnv_phb4_pic_print_info'/usr/bin/ld: ../hw/usb/hcd-ehci-pci.o: in function `usb_ehci_pci_write_config':.../hw/usb/hcd-ehci-pci.c:129: undefined reference to pci_default_write_config' /usr/bin/ld: ../hw/usb/hcd-ehci-pci.o: in function usb_ehci_pci_realize':.../hw/usb/hcd-ehci-pci.c:68: undefined reference to pci_allocate_irq' /usr/bin/ld: .../hw/usb/hcd-ehci-pci.c:72: undefined reference to pci_register_bar' /usr/bin/ld: ../hw/usb/hcd-ehci-pci.o:(.data.rel+0x50): undefined reference to `vmstate_pci_device'
This patch fixes the problem by adding needed dependencies to POWERNV.
--- hw/ppc/Kconfig | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
hw/ppc/Kconfig +4 -2
@@ -29,6 +29,10 @@ config POWERNV select XICS select XIVE select FDT_PPC + select PCI + select PCI_EXPRESS + select MSI_NONBROKEN + select PCIE_PORT config PPC405 bool
@@ -135,8 +139,6 @@ config XIVE_SPAPR default y depends on PSERIES select XIVE - select PCI - select PCIE_PORT config XIVE_KVM bool
Signature · 1 line
2.24.1
Re: [PATCH 2/2] ppc/pnv: Fix PCI_EXPRESS dependency
Quoted 31 lines · On Wed, 5 Feb 2020 21:41:15 +0100 Laurent Vivier <[email protected]> wrote:
When PHB4 bridge has been added, the dependencies to
PCIE_PORThas been added toXIVE_SPAPRand indirectly to PSERIES.
The build of the PowerNV machine is fine while we also build the PSERIES machine.
If we disable the PSERIES machine, the PowerNV build fails because the PCI Express files are not built:
/usr/bin/ld:hw/ppc/pnv.o: in function `pnv_chip_power8_pic_print_info':.../hw/ppc/pnv.c:623: undefined reference topnv_phb3_msi_pic_print_info' /usr/bin/ld: hw/ppc/pnv.o: in functionpnv_chip_power9_pic_print_info':.../hw/ppc/pnv.c:639: undefined reference to `pnv_phb4_pic_print_info'/usr/bin/ld:../hw/usb/hcd-ehci-pci.o: in function `usb_ehci_pci_write_config':.../hw/usb/hcd-ehci-pci.c:129: undefined reference topci_default_write_config' /usr/bin/ld: ../hw/usb/hcd-ehci-pci.o: in functionusb_ehci_pci_realize':.../hw/usb/hcd-ehci-pci.c:68: undefined reference topci_allocate_irq' /usr/bin/ld: .../hw/usb/hcd-ehci-pci.c:72: undefined reference topci_register_bar'/usr/bin/ld: ../hw/usb/hcd-ehci-pci.o:(.data.rel+0x50): undefined reference to `vmstate_pci_device'This patch fixes the problem by adding needed dependencies to POWERNV.
Fixes 4f9924c4d4cf ("ppc/pnv: Add models for POWER9 PHB4 PCIe Host bridge")Signed-off-by Laurent Vivier <[email protected]>--- hw/ppc/Kconfig | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)hw/ppc/Kconfig +0
-0
hw/ppc/Kconfig config POWERNV · line 32
Quoted 4 lines
hw/ppc/Kconfig +1
-0@@ -29,6 +29,10 @@ config POWERNV select XICS select XIVE select FDT_PPC + select PCI
Is it needed since PCI_EXPRESS already selects PCI in hw/pci/Kconfig ?
Apart from that:
Quoted 15 lines
hw/ppc/Kconfig +3
-2+ select PCI_EXPRESS + select MSI_NONBROKEN + select PCIE_PORT config PPC405 bool@@ -135,8 +139,6 @@ config XIVE_SPAPR default y depends on PSERIES select XIVE - select PCI - select PCIE_PORT config XIVE_KVM bool
Re: [PATCH 2/2] ppc/pnv: Fix PCI_EXPRESS dependency
Quoted 29 lines · Greg Kurz
Quoted 26 lines · On Wed, 5 Feb 2020 21:41:15 +0100 Laurent Vivier <[email protected]> wrote:
When PHB4 bridge has been added, the dependencies to
PCIE_PORThas been added toXIVE_SPAPRand indirectly to PSERIES.
The build of the PowerNV machine is fine while we also build the PSERIES machine.
If we disable the PSERIES machine, the PowerNV build fails because the PCI Express files are not built:
/usr/bin/ld:hw/ppc/pnv.o: in function `pnv_chip_power8_pic_print_info':.../hw/ppc/pnv.c:623: undefined reference topnv_phb3_msi_pic_print_info' /usr/bin/ld: hw/ppc/pnv.o: in functionpnv_chip_power9_pic_print_info':.../hw/ppc/pnv.c:639: undefined reference to `pnv_phb4_pic_print_info'/usr/bin/ld:../hw/usb/hcd-ehci-pci.o: in function `usb_ehci_pci_write_config':.../hw/usb/hcd-ehci-pci.c:129: undefined reference topci_default_write_config' /usr/bin/ld: ../hw/usb/hcd-ehci-pci.o: in functionusb_ehci_pci_realize':.../hw/usb/hcd-ehci-pci.c:68: undefined reference topci_allocate_irq' /usr/bin/ld: .../hw/usb/hcd-ehci-pci.c:72: undefined reference topci_register_bar'/usr/bin/ld: ../hw/usb/hcd-ehci-pci.o:(.data.rel+0x50): undefined reference to `vmstate_pci_device'This patch fixes the problem by adding needed dependencies to POWERNV.
Fixes 4f9924c4d4cf ("ppc/pnv: Add models for POWER9 PHB4 PCIe Host bridge")Signed-off-by Laurent Vivier <[email protected]>--- hw/ppc/Kconfig | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
Quoted 12 lines
hw/ppc/Kconfig config POWERNV · line 32
Quoted 9 lines
hw/ppc/Kconfig +1
-0@@ -29,6 +29,10 @@ config POWERNV select XICS select XIVE select FDT_PPC + select PCIIs it needed since
PCI_EXPRESSalready selects PCI in hw/pci/Kconfig ?
You are right, and PCIE_PORT is not needed too, because PCIE_PORT is default to 'y' if PCI_DEVICES.
Quoted 20 lines
Apart from that:
Reviewed-by Greg Kurz <[email protected]>Quoted 15 lines
hw/ppc/Kconfig +3
-2+ select PCI_EXPRESS + select MSI_NONBROKEN + select PCIE_PORT config PPC405 bool@@ -135,8 +139,6 @@ config XIVE_SPAPR default y depends on PSERIES select XIVE - select PCI - select PCIE_PORT config XIVE_KVM bool
Re: [PATCH 2/2] ppc/pnv: Fix PCI_EXPRESS dependency
Quoted 43 lines · Laurent Vivier
Quoted 29 lines · Greg Kurz
Quoted 26 lines · On Wed, 5 Feb 2020 21:41:15 +0100 Laurent Vivier <[email protected]> wrote:
When PHB4 bridge has been added, the dependencies to
PCIE_PORThas been added toXIVE_SPAPRand indirectly to PSERIES.
The build of the PowerNV machine is fine while we also build the PSERIES machine.
If we disable the PSERIES machine, the PowerNV build fails because the PCI Express files are not built:
/usr/bin/ld:hw/ppc/pnv.o: in function `pnv_chip_power8_pic_print_info':.../hw/ppc/pnv.c:623: undefined reference topnv_phb3_msi_pic_print_info' /usr/bin/ld: hw/ppc/pnv.o: in functionpnv_chip_power9_pic_print_info':.../hw/ppc/pnv.c:639: undefined reference to `pnv_phb4_pic_print_info'/usr/bin/ld:../hw/usb/hcd-ehci-pci.o: in function `usb_ehci_pci_write_config':.../hw/usb/hcd-ehci-pci.c:129: undefined reference topci_default_write_config' /usr/bin/ld: ../hw/usb/hcd-ehci-pci.o: in functionusb_ehci_pci_realize':.../hw/usb/hcd-ehci-pci.c:68: undefined reference topci_allocate_irq' /usr/bin/ld: .../hw/usb/hcd-ehci-pci.c:72: undefined reference topci_register_bar'/usr/bin/ld: ../hw/usb/hcd-ehci-pci.o:(.data.rel+0x50): undefined reference to `vmstate_pci_device'This patch fixes the problem by adding needed dependencies to POWERNV.
Fixes 4f9924c4d4cf ("ppc/pnv: Add models for POWER9 PHB4 PCIe Host bridge")Signed-off-by Laurent Vivier <[email protected]>--- hw/ppc/Kconfig | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)Quoted 12 lines
hw/ppc/Kconfig config POWERNV · line 32
Quoted 9 lines
hw/ppc/Kconfig +1
-0@@ -29,6 +29,10 @@ config POWERNV select XICS select XIVE select FDT_PPC + select PCIIs it needed since
PCI_EXPRESSalready selects PCI in hw/pci/Kconfig ?
Quoted 2 lines
You are right, and
PCIE_PORTis not needed too, becausePCIE_PORTis default to 'y' ifPCI_DEVICES.
If it's a hard requirement for linking, then it is needed here. Try to compile after running "configure --without-default-devices" to see whether you've got all dependencies really right.
Thomas