qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: Zhuojia Shen <chaosdefinition@hotmail.com>, qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>, qemu-arm@nongnu.org
Subject: Re: [PATCH] target/arm: align exposed ID registers with Linux
Date: Tue, 22 Nov 2022 10:12:26 -0800	[thread overview]
Message-ID: <713de12d-e13f-a061-0019-93e6758fdaa5@linaro.org> (raw)
In-Reply-To: <DS7PR12MB6309CF26249A273C1E2A6AAAAC0D9@DS7PR12MB6309.namprd12.prod.outlook.com>

On 11/21/22 18:48, Zhuojia Shen wrote:
> In CPUID registers exposed to userspace, some registers were missing
> and some fields were not exposed.  This patch aligns exposed ID
> registers and their fields with what Linux exposes currently.
> 
> Specifically, the following new ID registers/fields are exposed to
> userspace:
> 
> ID_AA64PFR1_EL1.BT:       bits 3-0
> ID_AA64PFR1_EL1.MTE:      bits 11-8
> ID_AA64PFR1_EL1.SME:      bits 27-24
> 
> ID_AA64ZFR0_EL1.SVEver:   bits 3-0
> ID_AA64ZFR0_EL1.AES:      bits 7-4
> ID_AA64ZFR0_EL1.BitPerm:  bits 19-16
> ID_AA64ZFR0_EL1.BF16:     bits 23-20
> ID_AA64ZFR0_EL1.SHA3:     bits 35-32
> ID_AA64ZFR0_EL1.SM4:      bits 43-40
> ID_AA64ZFR0_EL1.I8MM:     bits 47-44
> ID_AA64ZFR0_EL1.F32MM:    bits 55-52
> ID_AA64ZFR0_EL1.F64MM:    bits 59-56
> 
> ID_AA64SMFR0_EL1.F32F32:  bit 32
> ID_AA64SMFR0_EL1.B16F32:  bit 34
> ID_AA64SMFR0_EL1.F16F32:  bit 35
> ID_AA64SMFR0_EL1.I8I32:   bits 39-36
> ID_AA64SMFR0_EL1.F64F64:  bit 48
> ID_AA64SMFR0_EL1.I16I64:  bits 55-52
> ID_AA64SMFR0_EL1.FA64:    bit 63
> 
> ID_AA64MMFR0_EL1.ECV:     bits 63-60
> 
> ID_AA64MMFR1_EL1.AFP:     bits 47-44
> 
> ID_AA64MMFR2_EL1.AT:      bits 35-32
> 
> ID_AA64ISAR0_EL1.RNDR:    bits 63-60
> 
> ID_AA64ISAR1_EL1.FRINTTS: bits 35-32
> ID_AA64ISAR1_EL1.BF16:    bits 47-44
> ID_AA64ISAR1_EL1.DGH:     bits 51-48
> ID_AA64ISAR1_EL1.I8MM:    bits 55-52
> 
> ID_AA64ISAR2_EL1.WFxT:    bits 3-0
> ID_AA64ISAR2_EL1.RPRES:   bits 7-4
> ID_AA64ISAR2_EL1.GPA3:    bits 11-8
> ID_AA64ISAR2_EL1.APA3:    bits 15-12
> 
> Signed-off-by: Zhuojia Shen <chaosdefinition@hotmail.com>
> ---
>   target/arm/helper.c | 19 ++++++++++++++-----
>   1 file changed, 14 insertions(+), 5 deletions(-)
> 
> diff --git a/target/arm/helper.c b/target/arm/helper.c
> index d8c8223ec3..ce6fd7a96d 100644
> --- a/target/arm/helper.c
> +++ b/target/arm/helper.c
> @@ -7826,13 +7826,20 @@ void register_cp_regs_for_features(ARMCPU *cpu)
>                 .exported_bits = 0x000f000f00ff0000,
>                 .fixed_bits    = 0x0000000000000011 },
>               { .name = "ID_AA64PFR1_EL1",
> -              .exported_bits = 0x00000000000000f0 },
> +              .exported_bits = 0x000000000f000fff },

Existing, but I think it would be nicer to do this symbolically.  e.g.

    .exported_bits = R_ID_AA64PFR1_BT_MASK |
                     R_ID_AA64PFR1_SBSS_MASK |
                     R_ID_AA64PFR1_MTE_MASK |
                     R_ID_AA64PFR1_SME_MASK,

etc.


r~


  reply	other threads:[~2022-11-22 18:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-22  2:48 [PATCH] target/arm: align exposed ID registers with Linux Zhuojia Shen
2022-11-22 18:12 ` Richard Henderson [this message]
2022-11-22 18:53   ` Zhuojia Shen
2022-11-22 18:26 ` Peter Maydell
2022-11-22 18:46   ` Zhuojia Shen

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=713de12d-e13f-a061-0019-93e6758fdaa5@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=chaosdefinition@hotmail.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@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).