qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: "Cédric Le Goater" <clg@kaod.org>,
	"David Gibson" <david@gibson.dropbear.id.au>
Cc: Alexander Graf <agraf@suse.de>,
	qemu-ppc@nongnu.org, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [RFC PATCH 03/26] target/ppc/POWER9: add POWERPC_EXCP_POWER9
Date: Tue, 11 Jul 2017 07:00:43 +1000	[thread overview]
Message-ID: <1499720443.2865.15.camel@kernel.crashing.org> (raw)
In-Reply-To: <9a7a16a0-f14f-bc65-d503-e2aee028633f@kaod.org>

On Mon, 2017-07-10 at 14:49 +0200, Cédric Le Goater wrote:
> On 07/10/2017 12:26 PM, David Gibson wrote:
> > On Wed, Jul 05, 2017 at 07:13:16PM +0200, Cédric Le Goater wrote:
> > > Prepare ground for the new exception model XIVE of POWER9.
> > 
> > I'm a bit confused by this.  The excp_model is about the CPU core's
> > irq model, not the external irq controller's.
> 
> yes this is true, but the POWER9 CPU is the only criteria we have 
> to distinguish a machine supporting XIVE and XICS from one only 
> supporting XICS.

Why ? I don't understand.

We do want an EXCP_POWER9 for other things, like the fact that we have
a separate interrupt input for hypervisor, with associated vectors
etc...  but that still doesn't relate to what interrupt controller is
there.

> My idea was to use this flag to activate the OV5_XIVE_EXPLOIT bit 
> in ibm,arch-vec-5-platform-support ov5_platform, like this is done
> for the MMU. See spapr_dt_ov5_platform_support()

I disagree, the MMU is in the core, the XIVE isn't. It would be
possibly to make a P9 core if a XICS in theory :-)

> > Now.. I could imagine the POWER9 having a different core model that
> > came along with XIVE, but I can't see this new model being used for
> > anything anywhere in the rest of the series.
> 
> See patch 26. But, maybe, I am taking a shortcut and we need another
> family of flags. 

Or just some kind of enum for the interrupt controller, how do we do
with OpenPIC vs. XICS already ? Old POWER3 had OpenPIC.

> Thanks,
> 
> C. 
> 
> > > 
> > > Signed-off-by: Cédric Le Goater <clg@kaod.org>
> > > ---
> > >  target/ppc/cpu-qom.h        | 2 ++
> > >  target/ppc/excp_helper.c    | 9 ++++++---
> > >  target/ppc/translate.c      | 3 ++-
> > >  target/ppc/translate_init.c | 2 +-
> > >  4 files changed, 11 insertions(+), 5 deletions(-)
> > > 
> > > diff --git a/target/ppc/cpu-qom.h b/target/ppc/cpu-qom.h
> > > index d0cf6ca2a971..d7b78cf3f71c 100644
> > > --- a/target/ppc/cpu-qom.h
> > > +++ b/target/ppc/cpu-qom.h
> > > @@ -132,6 +132,8 @@ enum powerpc_excp_t {
> > >      POWERPC_EXCP_POWER7,
> > >      /* POWER8 exception model           */
> > >      POWERPC_EXCP_POWER8,
> > > +    /* POWER9 exception model           */
> > > +    POWERPC_EXCP_POWER9,
> > >  };
> > >  
> > >  /*****************************************************************************/
> > > diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c
> > > index 3a9f0861e773..dc7dff36a580 100644
> > > --- a/target/ppc/excp_helper.c
> > > +++ b/target/ppc/excp_helper.c
> > > @@ -148,9 +148,11 @@ static inline void powerpc_excp(PowerPCCPU *cpu, int excp_model, int excp)
> > >       */
> > >  #if defined(TARGET_PPC64)
> > >      if (excp_model == POWERPC_EXCP_POWER7 ||
> > > -        excp_model == POWERPC_EXCP_POWER8) {
> > > +        excp_model == POWERPC_EXCP_POWER8 ||
> > > +        excp_model == POWERPC_EXCP_POWER9) {
> > >          lpes0 = !!(env->spr[SPR_LPCR] & LPCR_LPES0);
> > > -        if (excp_model == POWERPC_EXCP_POWER8) {
> > > +        if (excp_model == POWERPC_EXCP_POWER8 ||
> > > +            excp_model == POWERPC_EXCP_POWER9) {
> > >              ail = (env->spr[SPR_LPCR] & LPCR_AIL) >> LPCR_AIL_SHIFT;
> > >          } else {
> > >              ail = 0;
> > > @@ -651,7 +653,8 @@ static inline void powerpc_excp(PowerPCCPU *cpu, int excp_model, int excp)
> > >          if (!(new_msr & MSR_HVB) && (env->spr[SPR_LPCR] & LPCR_ILE)) {
> > >              new_msr |= (target_ulong)1 << MSR_LE;
> > >          }
> > > -    } else if (excp_model == POWERPC_EXCP_POWER8) {
> > > +    } else if (excp_model == POWERPC_EXCP_POWER8 ||
> > > +               excp_model == POWERPC_EXCP_POWER9) {
> > >          if (new_msr & MSR_HVB) {
> > >              if (env->spr[SPR_HID0] & HID0_HILE) {
> > >                  new_msr |= (target_ulong)1 << MSR_LE;
> > > diff --git a/target/ppc/translate.c b/target/ppc/translate.c
> > > index c0cd64d927c2..2d8c1b9e6836 100644
> > > --- a/target/ppc/translate.c
> > > +++ b/target/ppc/translate.c
> > > @@ -7064,7 +7064,8 @@ void ppc_cpu_dump_state(CPUState *cs, FILE *f, fprintf_function cpu_fprintf,
> > >  
> > >  #if defined(TARGET_PPC64)
> > >      if (env->excp_model == POWERPC_EXCP_POWER7 ||
> > > -        env->excp_model == POWERPC_EXCP_POWER8) {
> > > +        env->excp_model == POWERPC_EXCP_POWER8 ||
> > > +        env->excp_model == POWERPC_EXCP_POWER9) {
> > >          cpu_fprintf(f, "HSRR0 " TARGET_FMT_lx " HSRR1 " TARGET_FMT_lx "\n",
> > >                      env->spr[SPR_HSRR0], env->spr[SPR_HSRR1]);
> > >      }
> > > diff --git a/target/ppc/translate_init.c b/target/ppc/translate_init.c
> > > index 53aff5a7b734..b8c7b8150318 100644
> > > --- a/target/ppc/translate_init.c
> > > +++ b/target/ppc/translate_init.c
> > > @@ -8962,7 +8962,7 @@ POWERPC_FAMILY(POWER9)(ObjectClass *oc, void *data)
> > >      pcc->sps = &POWER7_POWER8_sps;
> > >      pcc->radix_page_info = &POWER9_radix_page_info;
> > >  #endif
> > > -    pcc->excp_model = POWERPC_EXCP_POWER8;
> > > +    pcc->excp_model = POWERPC_EXCP_POWER9;
> > >      pcc->bus_model = PPC_FLAGS_INPUT_POWER7;
> > >      pcc->bfd_mach = bfd_mach_ppc64;
> > >      pcc->flags = POWERPC_FLAG_VRE | POWERPC_FLAG_SE |

  reply	other threads:[~2017-07-10 21:01 UTC|newest]

Thread overview: 122+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-05 17:13 [Qemu-devel] [RFC PATCH 00/26] guest exploitation of the XIVE interrupt controller (POWER9) Cédric Le Goater
2017-07-05 17:13 ` [Qemu-devel] [RFC PATCH 01/26] spapr: introduce the XIVE_EXPLOIT option in CAS Cédric Le Goater
2017-07-05 17:13 ` [Qemu-devel] [RFC PATCH 02/26] spapr: populate device tree depending on XIVE_EXPLOIT option Cédric Le Goater
2017-07-05 17:13 ` [Qemu-devel] [RFC PATCH 03/26] target/ppc/POWER9: add POWERPC_EXCP_POWER9 Cédric Le Goater
2017-07-10 10:26   ` David Gibson
2017-07-10 12:49     ` Cédric Le Goater
2017-07-10 21:00       ` Benjamin Herrenschmidt [this message]
2017-07-11  9:01         ` Cédric Le Goater
2017-07-11 13:27           ` David Gibson
2017-07-11 13:52             ` Cédric Le Goater
2017-07-11 21:20               ` Benjamin Herrenschmidt
2017-07-05 17:13 ` [Qemu-devel] [RFC PATCH 04/26] ppc/xive: introduce a skeleton for the XIVE interrupt controller model Cédric Le Goater
2017-07-19  3:08   ` David Gibson
2017-07-19  3:23     ` David Gibson
2017-07-19  3:56     ` Benjamin Herrenschmidt
2017-07-19  4:01       ` David Gibson
2017-07-19  4:18         ` Benjamin Herrenschmidt
2017-07-19  4:25           ` David Gibson
2017-07-19  4:02     ` Benjamin Herrenschmidt
2017-07-21  7:50       ` David Gibson
2017-07-21  8:21         ` Benjamin Herrenschmidt
2017-07-24  3:28           ` David Gibson
2017-07-24  3:53             ` Alexey Kardashevskiy
2017-07-24  5:04             ` Benjamin Herrenschmidt
2017-07-24  5:38               ` David Gibson
2017-07-24  7:20                 ` Benjamin Herrenschmidt
2017-07-24 10:03                   ` David Gibson
2017-07-25  8:52                     ` Cédric Le Goater
2017-07-25 12:39                       ` David Gibson
2017-07-25 13:48                         ` Cédric Le Goater
2017-07-24 13:00     ` Cédric Le Goater
2017-07-25  1:26       ` [Qemu-devel] [Qemu-ppc] " Alexey Kardashevskiy
2017-07-25  2:17         ` David Gibson
2017-07-05 17:13 ` [Qemu-devel] [RFC PATCH 05/26] ppc/xive: define XIVE internal tables Cédric Le Goater
2017-07-19  3:24   ` David Gibson
2017-07-24 12:52     ` Cédric Le Goater
2017-07-25  2:16       ` David Gibson
2017-07-25 15:54         ` Cédric Le Goater
2017-07-05 17:13 ` [Qemu-devel] [RFC PATCH 06/26] ppc/xive: introduce a XIVE interrupt source model Cédric Le Goater
2017-07-24  4:02   ` David Gibson
2017-07-24  6:00     ` Alexey Kardashevskiy
2017-07-24 15:20       ` Cédric Le Goater
2017-07-25  3:06         ` Alexey Kardashevskiy
2017-07-24 15:13     ` Cédric Le Goater
2017-07-05 17:13 ` [Qemu-devel] [RFC PATCH 07/26] ppc/xive: add MMIO handlers to the XIVE interrupt source Cédric Le Goater
2017-07-24  4:29   ` David Gibson
2017-07-24  8:56     ` Benjamin Herrenschmidt
2017-07-24 15:55     ` Cédric Le Goater
2017-07-25 12:21       ` David Gibson
2017-07-25 15:42         ` Cédric Le Goater
2017-07-24  6:50   ` Alexey Kardashevskiy
2017-07-24 15:39     ` Cédric Le Goater
2017-07-05 17:13 ` [Qemu-devel] [RFC PATCH 08/26] ppc/xive: add flags " Cédric Le Goater
2017-07-24  4:36   ` David Gibson
2017-07-24  7:00     ` Benjamin Herrenschmidt
2017-07-24  9:50       ` David Gibson
2017-07-24 11:07         ` Benjamin Herrenschmidt
2017-07-24 11:47           ` Cédric Le Goater
2017-07-25  4:19             ` David Gibson
2017-07-25  5:49               ` Benjamin Herrenschmidt
2017-07-25  4:18           ` David Gibson
2017-07-25  5:47             ` Benjamin Herrenschmidt
2017-07-25  8:28               ` Cédric Le Goater
2017-07-25 12:24               ` David Gibson
2017-07-25  8:17         ` Cédric Le Goater
2017-07-05 17:13 ` [Qemu-devel] [RFC PATCH 09/26] ppc/xive: add an overall memory region for the ESBs Cédric Le Goater
2017-07-24  4:49   ` David Gibson
2017-07-24  6:09     ` Benjamin Herrenschmidt
2017-07-24  6:39       ` David Gibson
2017-07-24 13:27         ` Cédric Le Goater
2017-07-25  2:19           ` David Gibson
2017-07-24 13:25       ` Cédric Le Goater
2017-07-25  2:19         ` David Gibson
2017-07-25  9:50           ` Cédric Le Goater
2017-07-05 17:13 ` [Qemu-devel] [RFC PATCH 10/26] ppc/xive: record interrupt source MMIO address for hcalls Cédric Le Goater
2017-07-24  5:11   ` David Gibson
2017-07-24 13:45     ` Cédric Le Goater
2017-07-05 17:13 ` [Qemu-devel] [RFC PATCH 11/26] ppc/xics: introduce a print_info() handler to the ICS and ICP objects Cédric Le Goater
2017-07-24  5:13   ` David Gibson
2017-07-24 13:58     ` Cédric Le Goater
2017-07-25 13:26       ` David Gibson
2017-07-05 17:13 ` [Qemu-devel] [RFC PATCH 12/26] ppc/xive: add a print_info() handler for the interrupt source Cédric Le Goater
2017-07-05 17:13 ` [Qemu-devel] [RFC PATCH 13/26] ppc/xive: introduce a XIVE interrupt presenter model Cédric Le Goater
2017-07-24  6:05   ` David Gibson
2017-07-24 14:02     ` Cédric Le Goater
2017-07-05 17:13 ` [Qemu-devel] [RFC PATCH 14/26] ppc/xive: add MMIO handlers to the " Cédric Le Goater
2017-07-24  6:35   ` David Gibson
2017-07-24 14:44     ` Cédric Le Goater
2017-07-25  4:20       ` David Gibson
2017-07-25  9:08         ` Cédric Le Goater
2017-07-25 13:21           ` David Gibson
2017-07-25 15:01             ` Cédric Le Goater
2017-07-26  2:02               ` David Gibson
2017-07-05 17:13 ` [Qemu-devel] [RFC PATCH 15/26] ppc/xive: push EQ data in OS event queues Cédric Le Goater
2017-07-05 17:13 ` [Qemu-devel] [RFC PATCH 16/26] ppc/xive: notify CPU when interrupt priority is more privileged Cédric Le Goater
2017-09-09  7:39   ` Benjamin Herrenschmidt
2017-09-09  8:08     ` Cédric Le Goater
2017-09-09  8:40       ` Benjamin Herrenschmidt
2017-09-09  8:24     ` Cédric Le Goater
2017-07-05 17:13 ` [Qemu-devel] [RFC PATCH 17/26] ppc/xive: add hcalls support Cédric Le Goater
2017-07-24  9:39   ` [Qemu-devel] [Qemu-ppc] " Alexey Kardashevskiy
2017-07-24 14:55     ` Cédric Le Goater
2017-07-25  2:09       ` Alexey Kardashevskiy
2017-07-05 17:13 ` [Qemu-devel] [RFC PATCH 18/26] ppc/xive: add device tree support Cédric Le Goater
2017-07-05 17:13 ` [Qemu-devel] [RFC PATCH 19/26] ppc/xive: introduce a helper to map the XIVE memory regions Cédric Le Goater
2017-07-25  2:54   ` [Qemu-devel] [Qemu-ppc] " Alexey Kardashevskiy
2017-07-25  9:18     ` Cédric Le Goater
2017-07-25 14:16       ` Alexey Kardashevskiy
2017-07-05 17:13 ` [Qemu-devel] [RFC PATCH 20/26] ppc/xive: introduce a helper to create XIVE interrupt source objects Cédric Le Goater
2017-07-05 17:13 ` [Qemu-devel] [RFC PATCH 21/26] ppc/xive: introduce routines to allocate IRQ numbers Cédric Le Goater
2017-07-05 17:13 ` [Qemu-devel] [RFC PATCH 22/26] ppc/xive: create an XIVE interrupt source to handle IPIs Cédric Le Goater
2017-07-05 17:13 ` [Qemu-devel] [RFC PATCH 23/26] spapr: add a XIVE object to the sPAPR machine Cédric Le Goater
2017-07-05 17:13 ` [Qemu-devel] [RFC PATCH 24/26] spapr: include the XIVE interrupt source for IPIs Cédric Le Goater
2017-07-05 17:13 ` [Qemu-devel] [RFC PATCH 25/26] spapr: print the XIVE interrupt source for IPIs in the monitor Cédric Le Goater
2017-07-05 17:13 ` [Qemu-devel] [RFC PATCH 26/26] spapr: force XIVE exploitation mode for POWER9 (HACK) Cédric Le Goater
2017-07-25  2:43   ` [Qemu-devel] [Qemu-ppc] " Alexey Kardashevskiy
2017-07-25  9:20     ` Cédric Le Goater
2017-07-10 10:24 ` [Qemu-devel] [RFC PATCH 00/26] guest exploitation of the XIVE interrupt controller (POWER9) David Gibson
2017-07-10 12:36   ` Cédric Le Goater
2017-07-19  3:00 ` David Gibson
2017-07-19  3:55   ` Benjamin Herrenschmidt
2017-07-24  7:28     ` 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=1499720443.2865.15.camel@kernel.crashing.org \
    --to=benh@kernel.crashing.org \
    --cc=agraf@suse.de \
    --cc=clg@kaod.org \
    --cc=david@gibson.dropbear.id.au \
    --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).