diff mbox

[CFT,v3,00/50] NEED_CPU_H / cpu.h / hw/hw.h cleanups

Message ID 573ADCBD.50601@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Thomas Huth May 17, 2016, 8:56 a.m. UTC
On 16.05.2016 18:59, Peter Maydell wrote:
> On 16 May 2016 at 17:53, Peter Maydell <peter.maydell@linaro.org> wrote:
>> ppc64 (this is the ppc64be host in the GCC compile farm if
>> you have an account there):
>>
>> /home/pm215/qemu/hw/intc/xics_kvm.c: In function ‘icp_get_kvm_state’:
>> /home/pm215/qemu/hw/intc/xics_kvm.c:54:12: error: variable ‘reg’ has
>> initializer but incomplete type
>>      struct kvm_one_reg reg = {
>>             ^
>> /home/pm215/qemu/hw/intc/xics_kvm.c:55:9: error: unknown field ‘id’
>> specified in initializer
>>          .id = KVM_REG_PPC_ICP_STATE,
>>          ^
>> /home/pm215/qemu/hw/intc/xics_kvm.c:55:15: error:
>> ‘KVM_REG_PPC_ICP_STATE’ undeclared (first use in this function)
>>          .id = KVM_REG_PPC_ICP_STATE,
>>                ^
>>
>> etc -- looks like missing a kvm include somewhere.
> 
> I logged in by hand to do a -k build; the only other error was:
> /home/pm215/qemu/hw/ppc/spapr_pci.c: In function ‘spapr_phb_realize’:
> /home/pm215/qemu/hw/ppc/spapr_pci.c:1426:5: error: implicit
> declaration of function ‘kvm_enabled’
> [-Werror=implicit-function-declaration]
>      if (kvm_enabled()) {
>      ^
> /home/pm215/qemu/hw/ppc/spapr_pci.c:1426:5: error: nested extern
> declaration of ‘kvm_enabled’ [-Werror=nested-externs]

I've checked the build on our POWER server, too, and I get the same
problems. You can fix it with this patch:


(Note: In xics_kvm.c, the sysemu/kvm.h header file has to be included
before the kvm_ppc.h header file to avoid some other conflicts).

 Thomas

Comments

Paolo Bonzini May 17, 2016, 9:50 a.m. UTC | #1
On 17/05/2016 10:56, Thomas Huth wrote:
> On 16.05.2016 18:59, Peter Maydell wrote:
>> On 16 May 2016 at 17:53, Peter Maydell <peter.maydell@linaro.org> wrote:
>>> ppc64 (this is the ppc64be host in the GCC compile farm if
>>> you have an account there):
>>>
>>> /home/pm215/qemu/hw/intc/xics_kvm.c: In function ‘icp_get_kvm_state’:
>>> /home/pm215/qemu/hw/intc/xics_kvm.c:54:12: error: variable ‘reg’ has
>>> initializer but incomplete type
>>>      struct kvm_one_reg reg = {
>>>             ^
>>> /home/pm215/qemu/hw/intc/xics_kvm.c:55:9: error: unknown field ‘id’
>>> specified in initializer
>>>          .id = KVM_REG_PPC_ICP_STATE,
>>>          ^
>>> /home/pm215/qemu/hw/intc/xics_kvm.c:55:15: error:
>>> ‘KVM_REG_PPC_ICP_STATE’ undeclared (first use in this function)
>>>          .id = KVM_REG_PPC_ICP_STATE,
>>>                ^
>>>
>>> etc -- looks like missing a kvm include somewhere.
>>
>> I logged in by hand to do a -k build; the only other error was:
>> /home/pm215/qemu/hw/ppc/spapr_pci.c: In function ‘spapr_phb_realize’:
>> /home/pm215/qemu/hw/ppc/spapr_pci.c:1426:5: error: implicit
>> declaration of function ‘kvm_enabled’
>> [-Werror=implicit-function-declaration]
>>      if (kvm_enabled()) {
>>      ^
>> /home/pm215/qemu/hw/ppc/spapr_pci.c:1426:5: error: nested extern
>> declaration of ‘kvm_enabled’ [-Werror=nested-externs]
> 
> I've checked the build on our POWER server, too, and I get the same
> problems. You can fix it with this patch:
> 
> diff --git a/hw/intc/xics_kvm.c b/hw/intc/xics_kvm.c
> index 9029d9e..55fd801 100644
> --- a/hw/intc/xics_kvm.c
> +++ b/hw/intc/xics_kvm.c
> @@ -31,6 +31,7 @@
>  #include "cpu.h"
>  #include "hw/hw.h"
>  #include "trace.h"
> +#include "sysemu/kvm.h"
>  #include "hw/ppc/spapr.h"
>  #include "hw/ppc/xics.h"
>  #include "kvm_ppc.h"
> diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c
> index 573e635..d4bcb5a 100644
> --- a/hw/ppc/spapr_pci.c
> +++ b/hw/ppc/spapr_pci.c
> @@ -44,7 +44,7 @@
>  #include "hw/pci/pci_bus.h"
>  #include "hw/ppc/spapr_drc.h"
>  #include "sysemu/device_tree.h"
> -
> +#include "sysemu/kvm.h"
>  #include "hw/vfio/vfio.h"
> 
>  /* Copied from the kernel arch/powerpc/platforms/pseries/msi.c */
> 
> (Note: In xics_kvm.c, the sysemu/kvm.h header file has to be included
> before the kvm_ppc.h header file to avoid some other conflicts).
> 
>  Thomas
> 

Great to know, thanks!

Paolo
diff mbox

Patch

diff --git a/hw/intc/xics_kvm.c b/hw/intc/xics_kvm.c
index 9029d9e..55fd801 100644
--- a/hw/intc/xics_kvm.c
+++ b/hw/intc/xics_kvm.c
@@ -31,6 +31,7 @@ 
 #include "cpu.h"
 #include "hw/hw.h"
 #include "trace.h"
+#include "sysemu/kvm.h"
 #include "hw/ppc/spapr.h"
 #include "hw/ppc/xics.h"
 #include "kvm_ppc.h"
diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c
index 573e635..d4bcb5a 100644
--- a/hw/ppc/spapr_pci.c
+++ b/hw/ppc/spapr_pci.c
@@ -44,7 +44,7 @@ 
 #include "hw/pci/pci_bus.h"
 #include "hw/ppc/spapr_drc.h"
 #include "sysemu/device_tree.h"
-
+#include "sysemu/kvm.h"
 #include "hw/vfio/vfio.h"

 /* Copied from the kernel arch/powerpc/platforms/pseries/msi.c */