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 08/10] xics: Handle KVM interrupt presentation from "simple" ICS code
Date: Mon, 18 Feb 2019 10:43:55 +1100	[thread overview]
Message-ID: <20190217234355.GI2765@umbus.fritz.box> (raw)
In-Reply-To: <155023082996.1011724.16237920586343905010.stgit@bahia.lan>

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

On Fri, Feb 15, 2019 at 12:40:30PM +0100, Greg Kurz wrote:
> We want to use the "simple" ICS type in both KVM and non-KVM setups.
> Teach the "simple" ICS how to present interrupts to KVM and adapt
> sPAPR accordingly.
> 
> Signed-off-by: Greg Kurz <groug@kaod.org>

As Cédric points out, not strictly required to accomplish the series'
goals, but I think it's a nice cleanup, so applied.

> ---
>  hw/intc/xics.c        |    5 +++++
>  hw/intc/xics_kvm.c    |    3 +--
>  hw/ppc/spapr_irq.c    |    7 +------
>  include/hw/ppc/xics.h |    2 +-
>  4 files changed, 8 insertions(+), 9 deletions(-)
> 
> diff --git a/hw/intc/xics.c b/hw/intc/xics.c
> index 49401745c410..3009fa747277 100644
> --- a/hw/intc/xics.c
> +++ b/hw/intc/xics.c
> @@ -466,6 +466,11 @@ void ics_simple_set_irq(void *opaque, int srcno, int val)
>  {
>      ICSState *ics = (ICSState *)opaque;
>  
> +    if (kvm_irqchip_in_kernel()) {
> +        ics_kvm_set_irq(ics, srcno, val);
> +        return;
> +    }
> +
>      if (ics->irqs[srcno].flags & XICS_FLAGS_IRQ_LSI) {
>          ics_simple_set_irq_lsi(ics, srcno, val);
>      } else {
> diff --git a/hw/intc/xics_kvm.c b/hw/intc/xics_kvm.c
> index e7b8d4c29ce6..f34eacda03e7 100644
> --- a/hw/intc/xics_kvm.c
> +++ b/hw/intc/xics_kvm.c
> @@ -259,9 +259,8 @@ int ics_set_kvm_state(ICSState *ics)
>      return 0;
>  }
>  
> -void ics_kvm_set_irq(void *opaque, int srcno, int val)
> +void ics_kvm_set_irq(ICSState *ics, int srcno, int val)
>  {
> -    ICSState *ics = opaque;
>      struct kvm_irq_level args;
>      int rc;
>  
> diff --git a/hw/ppc/spapr_irq.c b/hw/ppc/spapr_irq.c
> index e6893df61e76..9f43b7b3bf16 100644
> --- a/hw/ppc/spapr_irq.c
> +++ b/hw/ppc/spapr_irq.c
> @@ -222,13 +222,8 @@ static int spapr_irq_post_load_xics(sPAPRMachineState *spapr, int version_id)
>  static void spapr_irq_set_irq_xics(void *opaque, int srcno, int val)
>  {
>      sPAPRMachineState *spapr = opaque;
> -    MachineState *machine = MACHINE(opaque);
>  
> -    if (kvm_enabled() && machine_kernel_irqchip_allowed(machine)) {
> -        ics_kvm_set_irq(spapr->ics, srcno, val);
> -    } else {
> -        ics_simple_set_irq(spapr->ics, srcno, val);
> -    }
> +    ics_simple_set_irq(spapr->ics, srcno, val);
>  }
>  
>  static void spapr_irq_reset_xics(sPAPRMachineState *spapr, Error **errp)
> diff --git a/include/hw/ppc/xics.h b/include/hw/ppc/xics.h
> index 06e87128f88e..61bd0fb9784f 100644
> --- a/include/hw/ppc/xics.h
> +++ b/include/hw/ppc/xics.h
> @@ -180,7 +180,6 @@ void icp_eoi(ICPState *icp, uint32_t xirr);
>  void ics_simple_write_xive(ICSState *ics, int nr, int server,
>                             uint8_t priority, uint8_t saved_priority);
>  void ics_simple_set_irq(void *opaque, int srcno, int val);
> -void ics_kvm_set_irq(void *opaque, int srcno, int val);
>  
>  void ics_set_irq_type(ICSState *ics, int srcno, bool lsi);
>  void icp_pic_print_info(ICPState *icp, Monitor *mon);
> @@ -201,5 +200,6 @@ void icp_kvm_realize(DeviceState *dev, Error **errp);
>  void ics_get_kvm_state(ICSState *ics);
>  int ics_set_kvm_state(ICSState *ics);
>  void ics_synchronize_state(ICSState *ics);
> +void ics_kvm_set_irq(ICSState *ics, int srcno, int val);
>  
>  #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
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 [this message]
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=20190217234355.GI2765@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).