All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] ppc/pnv: fix build dependencies
@ 2020-02-05 20:41 Laurent Vivier
  2020-02-05 20:41 ` [PATCH 1/2] qtest: Fix rtas dependencies Laurent Vivier
  2020-02-05 20:41 ` [PATCH 2/2] ppc/pnv: Fix PCI_EXPRESS dependency Laurent Vivier
  0 siblings, 2 replies; 8+ messages in thread
From: Laurent Vivier @ 2020-02-05 20:41 UTC (permalink / raw)
  To: qemu-devel
  Cc: Laurent Vivier, Thomas Huth, Greg Kurz, qemu-ppc,
	Cédric Le Goater, Paolo Bonzini, David Gibson

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(-)

-- 
2.24.1



^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/2] qtest: Fix rtas dependencies
  2020-02-05 20:41 [PATCH 0/2] ppc/pnv: fix build dependencies Laurent Vivier
@ 2020-02-05 20:41 ` Laurent Vivier
  2020-02-05 20:46   ` Thomas Huth
  2020-02-05 20:41 ` [PATCH 2/2] ppc/pnv: Fix PCI_EXPRESS dependency Laurent Vivier
  1 sibling, 1 reply; 8+ messages in thread
From: Laurent Vivier @ 2020-02-05 20:41 UTC (permalink / raw)
  To: qemu-devel
  Cc: Laurent Vivier, Thomas Huth, Greg Kurz, qemu-ppc,
	Cédric Le Goater, Paolo Bonzini, David Gibson

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")
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
---
 qtest.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/qtest.c b/qtest.c
index 12432f99cf44..587dcbb4b515 100644
--- a/qtest.c
+++ b/qtest.c
@@ -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;
-- 
2.24.1



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/2] ppc/pnv: Fix PCI_EXPRESS dependency
  2020-02-05 20:41 [PATCH 0/2] ppc/pnv: fix build dependencies Laurent Vivier
  2020-02-05 20:41 ` [PATCH 1/2] qtest: Fix rtas dependencies Laurent Vivier
@ 2020-02-05 20:41 ` Laurent Vivier
  2020-02-05 21:20   ` Greg Kurz
  1 sibling, 1 reply; 8+ messages in thread
From: Laurent Vivier @ 2020-02-05 20:41 UTC (permalink / raw)
  To: qemu-devel
  Cc: Laurent Vivier, Thomas Huth, Greg Kurz, qemu-ppc,
	Cédric Le Goater, Paolo Bonzini, David Gibson

When 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.

Fixes: 4f9924c4d4cf ("ppc/pnv: Add models for POWER9 PHB4 PCIe Host bridge")
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
---
 hw/ppc/Kconfig | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/hw/ppc/Kconfig b/hw/ppc/Kconfig
index 354828bf132f..3e11d0b53e11 100644
--- a/hw/ppc/Kconfig
+++ b/hw/ppc/Kconfig
@@ -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
-- 
2.24.1



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2] qtest: Fix rtas dependencies
  2020-02-05 20:41 ` [PATCH 1/2] qtest: Fix rtas dependencies Laurent Vivier
@ 2020-02-05 20:46   ` Thomas Huth
  2020-02-05 20:49     ` Laurent Vivier
  0 siblings, 1 reply; 8+ messages in thread
From: Thomas Huth @ 2020-02-05 20:46 UTC (permalink / raw)
  To: Laurent Vivier, qemu-devel
  Cc: Paolo Bonzini, David Gibson, qemu-ppc, Greg Kurz, Cédric Le Goater

On 05/02/2020 21.41, Laurent Vivier wrote:
> 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:
Reviewed-by: Thomas Huth <thuth@redhat.com>

> Signed-off-by: Laurent Vivier <lvivier@redhat.com>
> ---
>  qtest.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/qtest.c b/qtest.c
> index 12432f99cf44..587dcbb4b515 100644
> --- a/qtest.c
> +++ b/qtest.c
> @@ -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;
> 



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2] qtest: Fix rtas dependencies
  2020-02-05 20:46   ` Thomas Huth
@ 2020-02-05 20:49     ` Laurent Vivier
  0 siblings, 0 replies; 8+ messages in thread
From: Laurent Vivier @ 2020-02-05 20:49 UTC (permalink / raw)
  To: Thomas Huth, qemu-devel
  Cc: Paolo Bonzini, David Gibson, qemu-ppc, Greg Kurz, Cédric Le Goater

On 05/02/2020 21:46, Thomas Huth wrote:
> On 05/02/2020 21.41, Laurent Vivier wrote:
>> 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...

You are right, but I think it's interesting to show the dependency we
have between patches.

> But apart from that:
> Reviewed-by: Thomas Huth <thuth@redhat.com>
> 
Thank you!

Laurent



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/2] ppc/pnv: Fix PCI_EXPRESS dependency
  2020-02-05 20:41 ` [PATCH 2/2] ppc/pnv: Fix PCI_EXPRESS dependency Laurent Vivier
@ 2020-02-05 21:20   ` Greg Kurz
  2020-02-05 23:17     ` Laurent Vivier
  0 siblings, 1 reply; 8+ messages in thread
From: Greg Kurz @ 2020-02-05 21:20 UTC (permalink / raw)
  To: Laurent Vivier
  Cc: Thomas Huth, qemu-devel, qemu-ppc, Cédric Le Goater,
	Paolo Bonzini, David Gibson

On Wed,  5 Feb 2020 21:41:15 +0100
Laurent Vivier <lvivier@redhat.com> wrote:

> When 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.
> 
> Fixes: 4f9924c4d4cf ("ppc/pnv: Add models for POWER9 PHB4 PCIe Host bridge")
> Signed-off-by: Laurent Vivier <lvivier@redhat.com>
> ---
>  hw/ppc/Kconfig | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/hw/ppc/Kconfig b/hw/ppc/Kconfig
> index 354828bf132f..3e11d0b53e11 100644
> --- a/hw/ppc/Kconfig
> +++ b/hw/ppc/Kconfig
> @@ -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:

Reviewed-by: Greg Kurz <groug@kaod.org>

> +    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



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/2] ppc/pnv: Fix PCI_EXPRESS dependency
  2020-02-05 21:20   ` Greg Kurz
@ 2020-02-05 23:17     ` Laurent Vivier
  2020-02-06  6:31       ` Thomas Huth
  0 siblings, 1 reply; 8+ messages in thread
From: Laurent Vivier @ 2020-02-05 23:17 UTC (permalink / raw)
  To: Greg Kurz
  Cc: Thomas Huth, qemu-devel, qemu-ppc, Cédric Le Goater,
	Paolo Bonzini, David Gibson

On 05/02/2020 22:20, Greg Kurz wrote:
> On Wed,  5 Feb 2020 21:41:15 +0100
> Laurent Vivier <lvivier@redhat.com> wrote:
> 
>> When 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.
>>
>> Fixes: 4f9924c4d4cf ("ppc/pnv: Add models for POWER9 PHB4 PCIe Host bridge")
>> Signed-off-by: Laurent Vivier <lvivier@redhat.com>
>> ---
>>  hw/ppc/Kconfig | 6 ++++--
>>  1 file changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/hw/ppc/Kconfig b/hw/ppc/Kconfig
>> index 354828bf132f..3e11d0b53e11 100644
>> --- a/hw/ppc/Kconfig
>> +++ b/hw/ppc/Kconfig
>> @@ -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 ?
> 

You are right, and PCIE_PORT is not needed too, because
PCIE_PORT is default to 'y' if PCI_DEVICES.

> Apart from that:
> 
> Reviewed-by: Greg Kurz <groug@kaod.org>
> 
>> +    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
> 



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/2] ppc/pnv: Fix PCI_EXPRESS dependency
  2020-02-05 23:17     ` Laurent Vivier
@ 2020-02-06  6:31       ` Thomas Huth
  0 siblings, 0 replies; 8+ messages in thread
From: Thomas Huth @ 2020-02-06  6:31 UTC (permalink / raw)
  To: Laurent Vivier, Greg Kurz
  Cc: Paolo Bonzini, David Gibson, qemu-ppc, qemu-devel, Cédric Le Goater

On 06/02/2020 00.17, Laurent Vivier wrote:
> On 05/02/2020 22:20, Greg Kurz wrote:
>> On Wed,  5 Feb 2020 21:41:15 +0100
>> Laurent Vivier <lvivier@redhat.com> wrote:
>>
>>> When 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.
>>>
>>> Fixes: 4f9924c4d4cf ("ppc/pnv: Add models for POWER9 PHB4 PCIe Host bridge")
>>> Signed-off-by: Laurent Vivier <lvivier@redhat.com>
>>> ---
>>>  hw/ppc/Kconfig | 6 ++++--
>>>  1 file changed, 4 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/hw/ppc/Kconfig b/hw/ppc/Kconfig
>>> index 354828bf132f..3e11d0b53e11 100644
>>> --- a/hw/ppc/Kconfig
>>> +++ b/hw/ppc/Kconfig
>>> @@ -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 ?
>>
> 
> You are right, and PCIE_PORT is not needed too, because
> PCIE_PORT is default to 'y' if PCI_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



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-02-06  6:32 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-05 20:41 [PATCH 0/2] ppc/pnv: fix build dependencies Laurent Vivier
2020-02-05 20:41 ` [PATCH 1/2] qtest: Fix rtas dependencies Laurent Vivier
2020-02-05 20:46   ` Thomas Huth
2020-02-05 20:49     ` Laurent Vivier
2020-02-05 20:41 ` [PATCH 2/2] ppc/pnv: Fix PCI_EXPRESS dependency Laurent Vivier
2020-02-05 21:20   ` Greg Kurz
2020-02-05 23:17     ` Laurent Vivier
2020-02-06  6:31       ` Thomas Huth

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.