qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Nicholas Piggin" <npiggin@gmail.com>
To: "dan tan" <dantan@linux.vnet.ibm.com>, <qemu-devel@nongnu.org>
Cc: <danielhb413@gmail.com>, <clg@kaod.org>, <qemu-ppc@nongnu.org>
Subject: Re: [PATCH]     ppc/pnv: Add PowerPC Special Purpose Registers (SPRs):
Date: Thu, 18 Jan 2024 12:27:12 +1000	[thread overview]
Message-ID: <CYHH6N9OXRGH.1EJXKKN4KDDAB@wheely> (raw)
In-Reply-To: <20240117223429.2295-2-dantan@linux.vnet.ibm.com>

On Thu Jan 18, 2024 at 8:34 AM AEST, dan tan wrote:
>     The handling of the following SPRs are added -
>         ITV1  (0x375, 885) - noop (not in Power10 ISA)

I can't see where this is defined. Not in P10 user manual AFAIKS?

>         SIER2 (0x2f0, 752) - Sampled Instruction Event Register 2
>         SIER2 (0x2f1, 753) - Sampled Instruction Event Register 3
>         MMCR3 (0x2f2, 754) - Performance Monitor Mode Control Register 3

These are new in POWER10 (ISA 3.1) too.

Thanks,
Nick

>
>     Signed-off-by: dan tan <dantan@linux.vnet.ibm.com>
> ---
>  target/ppc/cpu.h      |  4 ++++
>  target/ppc/cpu_init.c | 17 +++++++++++++++++
>  2 files changed, 21 insertions(+)
>
> diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h
> index f8101ff..de0af02 100644
> --- a/target/ppc/cpu.h
> +++ b/target/ppc/cpu.h
> @@ -1933,6 +1933,9 @@ void ppc_compat_add_property(Object *obj, const char *name,
>  #define SPR_BOOKE_TLB2CFG     (0x2B2)
>  #define SPR_BOOKE_TLB3CFG     (0x2B3)
>  #define SPR_BOOKE_EPR         (0x2BE)
> +#define SPR_POWER_SIER2       (0x2F0)
> +#define SPR_POWER_SIER3       (0x2F1)
> +#define SPR_POWER_MMCR3       (0x2F2)
>  #define SPR_PERF0             (0x300)
>  #define SPR_RCPU_MI_RBA0      (0x300)
>  #define SPR_MPC_MI_CTR        (0x300)
> @@ -2053,6 +2056,7 @@ void ppc_compat_add_property(Object *obj, const char *name,
>  #define SPR_440_INV3          (0x373)
>  #define SPR_440_ITV0          (0x374)
>  #define SPR_440_ITV1          (0x375)
> +#define SPR_ITV1              (0x375)
>  #define SPR_440_ITV2          (0x376)
>  #define SPR_440_ITV3          (0x377)
>  #define SPR_440_CCR1          (0x378)
> diff --git a/target/ppc/cpu_init.c b/target/ppc/cpu_init.c
> index 40fe14a..71c46b2 100644
> --- a/target/ppc/cpu_init.c
> +++ b/target/ppc/cpu_init.c
> @@ -5294,6 +5294,18 @@ static void register_power8_pmu_sup_sprs(CPUPPCState *env)
>                       SPR_NOACCESS, SPR_NOACCESS,
>                       &spr_read_generic, &spr_write_generic,
>                       KVM_REG_PPC_CSIGR, 0x00000000);
> +    spr_register_kvm(env, SPR_POWER_MMCR3, "MMCR3",
> +                     SPR_NOACCESS, SPR_NOACCESS,
> +                     &spr_read_generic, &spr_write_generic,
> +                     KVM_REG_PPC_MMCR3, 0x00000000);
> +    spr_register_kvm(env, SPR_POWER_SIER2, "SIER2",
> +                     SPR_NOACCESS, SPR_NOACCESS,
> +                     &spr_read_generic, &spr_write_generic,
> +                     KVM_REG_PPC_SIER2, 0x00000000);
> +    spr_register_kvm(env, SPR_POWER_SIER3, "SIER3",
> +                     SPR_NOACCESS, SPR_NOACCESS,
> +                     &spr_read_generic, &spr_write_generic,
> +                     KVM_REG_PPC_SIER3, 0x00000000);
>  }
>  
>  static void register_power8_pmu_user_sprs(CPUPPCState *env)
> @@ -5670,6 +5682,11 @@ static void register_power_common_book4_sprs(CPUPPCState *env)
>                   &spr_access_nop, &spr_write_generic,
>                   &spr_access_nop, &spr_write_generic,
>                   0x00000000);
> +    spr_register_hv(env, SPR_ITV1, "ITV1",
> +                 SPR_NOACCESS, SPR_NOACCESS,
> +                 &spr_access_nop, &spr_write_generic,
> +                 &spr_access_nop, &spr_write_generic,
> +                 0x00000000);
>  #endif
>  }
>  



  reply	other threads:[~2024-01-18  2:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-17 22:34 [PATCH] ppc/pnv: Add PowerPC Special Purpose Registers dan tan
2024-01-17 22:34 ` [PATCH] ppc/pnv: Add PowerPC Special Purpose Registers (SPRs): dan tan
2024-01-18  2:27   ` Nicholas Piggin [this message]
2024-01-18  2:23 ` [PATCH] ppc/pnv: Add PowerPC Special Purpose Registers Nicholas Piggin

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=CYHH6N9OXRGH.1EJXKKN4KDDAB@wheely \
    --to=npiggin@gmail.com \
    --cc=clg@kaod.org \
    --cc=danielhb413@gmail.com \
    --cc=dantan@linux.vnet.ibm.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).