qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Greg Kurz <groug@kaod.org>
Cc: "Cédric Le Goater" <clg@kaod.org>,
	qemu-devel@nongnu.org, qemu-ppc@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 03/10] xics: Handle KVM ICP realize from the common code
Date: Mon, 18 Feb 2019 10:33:46 +1100	[thread overview]
Message-ID: <20190217233346.GD2765@umbus.fritz.box> (raw)
In-Reply-To: <20190215142741.330f478b@bahia.lan>

[-- Attachment #1: Type: text/plain, Size: 4592 bytes --]

On Fri, Feb 15, 2019 at 02:27:41PM +0100, Greg Kurz wrote:
> On Fri, 15 Feb 2019 14:09:53 +0100
> Cédric Le Goater <clg@kaod.org> wrote:
> 
> > On 2/15/19 2:03 PM, Greg Kurz wrote:
> > > On Fri, 15 Feb 2019 13:54:02 +0100
> > > Cédric Le Goater <clg@kaod.org> wrote:
> > >   
> > >> On 2/15/19 12:40 PM, Greg Kurz wrote:  
> > >>> The realization of KVM ICP currently follows the parent_realize logic,
> > >>> which is a bit overkill here. Also we want to get rid of the KVM ICP
> > >>> class. Explicitely call icp_kvm_realize() from the base ICP realize
> > >>> function.
> > >>>
> > >>> Note that ICPStateClass::parent_realize is retained because powernv
> > >>> needs it.
> > >>>
> > >>> Signed-off-by: Greg Kurz <groug@kaod.org>>
> > >>> ---
> > >>>  hw/intc/xics.c        |    8 ++++++++
> > >>>  hw/intc/xics_kvm.c    |   10 +---------
> > >>>  include/hw/ppc/xics.h |    1 +
> > >>>  3 files changed, 10 insertions(+), 9 deletions(-)
> > >>>
> > >>> diff --git a/hw/intc/xics.c b/hw/intc/xics.c
> > >>> index 822d367e6388..acd63ab5e0b9 100644
> > >>> --- a/hw/intc/xics.c
> > >>> +++ b/hw/intc/xics.c
> > >>> @@ -349,6 +349,14 @@ static void icp_realize(DeviceState *dev, Error **errp)
> > >>>          return;
> > >>>      }
> > >>>  
> > >>> +    if (kvm_irqchip_in_kernel()) {
> > >>> +        icp_kvm_realize(dev, &err);    
> > >>
> > >> While we are at changing things, I would prefix all the KVM 
> > >> backends routine with kvmppc_*. so that icp_kvm_realize() 
> > >> becomes kvmppc_icp_realize()
> > >>  
> > > 
> > > Well... kvmppc_* routines have historically been sitting under
> > > target/ppc so I'm not sure we want to use the same prefix
> > > elsewhere...  
> > 
> > Well, they could also be moved there but I think what is important 
> > is that the kvmppc_* routine should be used under the kvm_enabled() 
> > flag. 
> > 
> > Those under target/ppc have and extra dummy stub provided for the 
> > !kvm_enabled() case. 
> > 
> 
> Well, I don't really care but if we go this way (David?), I'd rather do it
> globally in a followup patch.

I concur.  I'm not all that fussed really, and I think it would be
done best as a followup.

> 
> > C.
> > 
> > 
> > 
> > >   
> > >> Apart from that,
> > >>
> > >> Reviewed-by: Cédric Le Goater <clg@kaod.org>
> > >>
> > >> Thanks,
> > >>
> > >> C.
> > >>
> > >>  
> > >>> +        if (err) {
> > >>> +            error_propagate(errp, err);
> > >>> +            return;
> > >>> +        }
> > >>> +    }
> > >>> +
> > >>>      qemu_register_reset(icp_reset_handler, dev);
> > >>>      vmstate_register(NULL, icp->cs->cpu_index, &vmstate_icp_server, icp);
> > >>>  }
> > >>> diff --git a/hw/intc/xics_kvm.c b/hw/intc/xics_kvm.c
> > >>> index 80321e9b75ab..4eebced516b6 100644
> > >>> --- a/hw/intc/xics_kvm.c
> > >>> +++ b/hw/intc/xics_kvm.c
> > >>> @@ -115,11 +115,9 @@ int icp_set_kvm_state(ICPState *icp)
> > >>>      return 0;
> > >>>  }
> > >>>  
> > >>> -static void icp_kvm_realize(DeviceState *dev, Error **errp)
> > >>> +void icp_kvm_realize(DeviceState *dev, Error **errp)
> > >>>  {
> > >>>      ICPState *icp = ICP(dev);
> > >>> -    ICPStateClass *icpc = ICP_GET_CLASS(icp);
> > >>> -    Error *local_err = NULL;
> > >>>      CPUState *cs;
> > >>>      KVMEnabledICP *enabled_icp;
> > >>>      unsigned long vcpu_id;
> > >>> @@ -129,12 +127,6 @@ static void icp_kvm_realize(DeviceState *dev, Error **errp)
> > >>>          abort();
> > >>>      }
> > >>>  
> > >>> -    icpc->parent_realize(dev, &local_err);
> > >>> -    if (local_err) {
> > >>> -        error_propagate(errp, local_err);
> > >>> -        return;
> > >>> -    }
> > >>> -
> > >>>      cs = icp->cs;
> > >>>      vcpu_id = kvm_arch_vcpu_id(cs);
> > >>>  
> > >>> diff --git a/include/hw/ppc/xics.h b/include/hw/ppc/xics.h
> > >>> index e33282a576d0..ab61dc24010a 100644
> > >>> --- a/include/hw/ppc/xics.h
> > >>> +++ b/include/hw/ppc/xics.h
> > >>> @@ -202,5 +202,6 @@ Object *icp_create(Object *cpu, const char *type, XICSFabric *xi,
> > >>>  void icp_get_kvm_state(ICPState *icp);
> > >>>  int icp_set_kvm_state(ICPState *icp);
> > >>>  void icp_synchronize_state(ICPState *icp);
> > >>> +void icp_kvm_realize(DeviceState *dev, Error **errp);
> > >>>  
> > >>>  #endif /* XICS_H */
> > >>>     
> > >>  
> > >   
> > 
> 

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  parent reply	other threads:[~2019-02-18  0:23 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-15 11:39 [Qemu-devel] [PATCH 00/10] xics: Get rid of KVM specific classes Greg Kurz
2019-02-15 11:39 ` [Qemu-devel] [PATCH 01/10] xics: Explicitely call KVM ICP methods from the common code Greg Kurz
2019-02-15 12:49   ` Cédric Le Goater
2019-02-17 23:14   ` David Gibson
2019-02-18 20:10     ` Eric Blake
2019-02-19  5:36       ` David Gibson
2019-02-15 11:39 ` [Qemu-devel] [PATCH 02/10] xics: Handle KVM ICP reset " Greg Kurz
2019-02-15 12:50   ` Cédric Le Goater
2019-02-17 23:32   ` David Gibson
2019-02-15 11:40 ` [Qemu-devel] [PATCH 03/10] xics: Handle KVM ICP realize " Greg Kurz
2019-02-15 12:54   ` Cédric Le Goater
2019-02-15 13:03     ` Greg Kurz
2019-02-15 13:09       ` Cédric Le Goater
2019-02-15 13:27         ` Greg Kurz
2019-02-15 13:35           ` Cédric Le Goater
2019-02-17 23:33           ` David Gibson [this message]
2019-02-15 11:40 ` [Qemu-devel] [PATCH 04/10] spapr/irq: Use the base ICP class for KVM Greg Kurz
2019-02-15 12:54   ` Cédric Le Goater
2019-02-17 23:35   ` David Gibson
2019-02-15 11:40 ` [Qemu-devel] [PATCH 05/10] xics: Drop the KVM ICP class Greg Kurz
2019-02-15 12:55   ` Cédric Le Goater
2019-02-15 13:18     ` Greg Kurz
2019-02-15 13:35       ` Cédric Le Goater
2019-02-15 13:35         ` Greg Kurz
2019-02-17 23:37         ` David Gibson
2019-02-18  7:08           ` Cédric Le Goater
2019-02-15 11:40 ` [Qemu-devel] [PATCH 06/10] xics: Explicitely call KVM ICS methods from the common code Greg Kurz
2019-02-15 12:56   ` Cédric Le Goater
2019-02-17 23:39   ` David Gibson
2019-02-15 11:40 ` [Qemu-devel] [PATCH 07/10] xics: Handle KVM ICS reset from the "simple" ICS code Greg Kurz
2019-02-15 12:57   ` Cédric Le Goater
2019-02-17 23:41   ` David Gibson
2019-02-15 11:40 ` [Qemu-devel] [PATCH 08/10] xics: Handle KVM interrupt presentation from " Greg Kurz
2019-02-15 12:59   ` Cédric Le Goater
2019-02-15 13:25     ` Greg Kurz
2019-02-17 23:43   ` David Gibson
2019-02-15 11:40 ` [Qemu-devel] [PATCH 09/10] spapr/irq: Use the "simple" ICS class for KVM Greg Kurz
2019-02-15 13:02   ` Cédric Le Goater
2019-02-15 13:32     ` Greg Kurz
2019-02-15 13:37       ` Cédric Le Goater
2019-02-17 23:49     ` David Gibson
2019-02-17 23:51   ` David Gibson
2019-02-15 11:40 ` [Qemu-devel] [PATCH 10/10] xics: Drop the KVM ICS class Greg Kurz
2019-02-15 13:02   ` Cédric Le Goater

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=20190217233346.GD2765@umbus.fritz.box \
    --to=david@gibson.dropbear.id.au \
    --cc=clg@kaod.org \
    --cc=groug@kaod.org \
    --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).