qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kurz <groug@kaod.org>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: "Cédric Le Goater" <clg@kaod.org>,
	qemu-ppc@nongnu.org, qemu-devel@nongnu.org,
	"David Gibson" <david@gibson.dropbear.id.au>
Subject: Re: [PATCH] ppc: Fix build with --without-default-devices
Date: Wed, 23 Dec 2020 12:54:51 +0100	[thread overview]
Message-ID: <20201223125451.6ca277b9@bahia.lan> (raw)
In-Reply-To: <7bafab63-659d-a8e9-a2d1-36483b226bf0@redhat.com>

On Wed, 23 Dec 2020 09:55:58 +0100
Paolo Bonzini <pbonzini@redhat.com> wrote:

> On 23/12/20 09:10, Greg Kurz wrote:
> > Linking of the qemu-system-ppc64 fails on a POWER9 host when
> > --without-default-devices is passed to configure:
> > 
> > $ ./configure --without-default-devices \
> >                --target-list=ppc64-softmmu && make
> > 
> > ...
> > 
> > libqemu-ppc64-softmmu.fa.p/hw_ppc_e500.c.o: In function `ppce500_init_mpic_kvm':
> > /home/greg/Work/qemu/qemu-ppc/build/../hw/ppc/e500.c:777: undefined reference to `kvm_openpic_connect_vcpu'
> > libqemu-ppc64-softmmu.fa.p/hw_ppc_spapr_irq.c.o: In function `spapr_irq_check':
> > /home/greg/Work/qemu/qemu-ppc/build/../hw/ppc/spapr_irq.c:189: undefined reference to `xics_kvm_has_broken_disconnect'
> > libqemu-ppc64-softmmu.fa.p/hw_intc_spapr_xive.c.o: In function `spapr_xive_post_load':
> > /home/greg/Work/qemu/qemu-ppc/build/../hw/intc/spapr_xive.c:530: undefined reference to `kvmppc_xive_post_load'
> > 
> > ... and tons of other symbols belonging to the KVM backend of the
> > openpic, XICS and XIVE interrupt controllers.
> > 
> > It turns out that OPENPIC_KVM, XICS_KVM and XIVE_KVM are marked
> > to depend on KVM but this has no effect when minikconf runs in
> > allnoconfig mode. The correct way to express that some configuration
> > A requires some other configuration B to be true is "A select B".
> > 
> > Have OPENPIC, XICS and XIVE to select their KVM counterpart if KVM
> > is set. While here, fix POWERNV to select XIVE and XICS, just like
> > PSERIES, and drop the now useless XIVE related config clauses from
> > hw/ppc/Kconfig.
> > 
> > This went unnoticed so far because CI doesn't test the build with
> > --without-default-devices and KVM enabled on a POWER host.
> > 
> > Signed-off-by: Greg Kurz <groug@kaod.org>
> 
> It is also possible to remove the *_KVM symbols and just use
> 
>      when: ['CONFIG_KVM', 'CONFIG_OPENPIC']
>      when: ['CONFIG_XICS', 'CONFIG_OPENPIC']
>      when: ['CONFIG_XIVE', 'CONFIG_OPENPIC']
> 

Good idea. I'll go for that. And it seems more fixing is need
around --without-default-devices so I'll need to repost anyway,

Thanks for the suggestion !

> in the meson.build files.  Which one is preferrable depends on personal 
> taste, and I do not myself lean in one direction or the other---I 
> mention it just in case _you_ find that one preferrable.
> 
> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
> 
> Thanks!
> 
> Paolo
> 
> > ---
> >   hw/intc/Kconfig |   18 +++++++++++++-----
> >   hw/ppc/Kconfig  |   17 ++---------------
> >   2 files changed, 15 insertions(+), 20 deletions(-)
> > 
> > diff --git a/hw/intc/Kconfig b/hw/intc/Kconfig
> > index 468d548ca771..0a5c080c4f5c 100644
> > --- a/hw/intc/Kconfig
> > +++ b/hw/intc/Kconfig
> > @@ -19,6 +19,7 @@ config ARM_GIC
> >   config OPENPIC
> >       bool
> >       select MSI_NONBROKEN
> > +    select OPENPIC_KVM if KVM
> >   
> >   config APIC
> >       bool
> > @@ -32,21 +33,28 @@ config ARM_GIC_KVM
> >   
> >   config OPENPIC_KVM
> >       bool
> > -    default y
> > -    depends on OPENPIC && KVM
> >   
> >   config XICS
> >       bool
> > -    depends on POWERNV || PSERIES
> > +    select XICS_KVM if KVM
> >   
> >   config XICS_SPAPR
> >       bool
> >       select XICS
> >   
> > +config XIVE
> > +    bool
> > +    select XIVE_KVM if KVM
> > +
> > +config XIVE_SPAPR
> > +    bool
> > +    select XIVE
> > +
> >   config XICS_KVM
> >       bool
> > -    default y
> > -    depends on XICS && KVM
> > +
> > +config XIVE_KVM
> > +    bool
> >   
> >   config ALLWINNER_A10_PIC
> >       bool
> > diff --git a/hw/ppc/Kconfig b/hw/ppc/Kconfig
> > index 982d55f5875c..037d9332e994 100644
> > --- a/hw/ppc/Kconfig
> > +++ b/hw/ppc/Kconfig
> > @@ -31,6 +31,8 @@ config POWERNV
> >       select FDT_PPC
> >       select PCI_EXPRESS
> >       select MSI_NONBROKEN
> > +    select XIVE
> > +    select XICS
> >   
> >   config PPC405
> >       bool
> > @@ -129,21 +131,6 @@ config VIRTEX
> >       select XILINX_ETHLITE
> >       select FDT_PPC
> >   
> > -config XIVE
> > -    bool
> > -    depends on POWERNV || PSERIES
> > -
> > -config XIVE_SPAPR
> > -    bool
> > -    default y
> > -    depends on PSERIES
> > -    select XIVE
> > -
> > -config XIVE_KVM
> > -    bool
> > -    default y
> > -    depends on XIVE_SPAPR && KVM
> > -
> >   # Only used by 64-bit targets
> >   config FW_CFG_PPC
> >       bool
> > 
> > 
> 



      reply	other threads:[~2020-12-23 11:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-23  8:10 [PATCH] ppc: Fix build with --without-default-devices Greg Kurz
2020-12-23  8:55 ` Paolo Bonzini
2020-12-23 11:54   ` Greg Kurz [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201223125451.6ca277b9@bahia.lan \
    --to=groug@kaod.org \
    --cc=clg@kaod.org \
    --cc=david@gibson.dropbear.id.au \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).