QEMU-Devel Archive mirror
 help / color / mirror / Atom feed
From: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
To: qemu-devel@nongnu.org
Subject: Re: [PATCH] hvf: arm: Fix encodings for ID_AA64PFR1_EL1 and debug System registers
Date: Sun, 5 May 2024 15:38:51 +0200	[thread overview]
Message-ID: <1740f591-0b29-4f1d-b4cd-e2b7e579c4fd@linaro.org> (raw)
In-Reply-To: <20240503153453.54389-1-zenghui.yu@linux.dev>

W dniu 3.05.2024 o 17:34, Zenghui Yu pisze:
> We wrongly encoded ID_AA64PFR1_EL1 using {3,0,0,4,2} in hvf_sreg_match[] so
> we fail to get the expected ARMCPRegInfo from cp_regs hash table with the
> wrong key.
> 
> Fix it with the correct encoding {3,0,0,4,1}. With that fixed, the Linux
> guest can properly detect FEAT_SSBS2 on my M1 HW.
> 
> All DBG{B,W}{V,C}R_EL1 registers are also wrongly encoded with op0 == 14.
> It happens to work because HVF_SYSREG(CRn, CRm, 14, op1, op2) equals to
> HVF_SYSREG(CRn, CRm, 2, op1, op2), by definition. But we shouldn't rely on
> it.
> 
> Fixes: a1477da3ddeb ("hvf: Add Apple Silicon support")
> Signed-off-by: Zenghui Yu<zenghui.yu@linux.dev>

If your boot environment allows to run EFI binaries then my ArmCpuInfo 
app [1] can be used to check values of system registers and flags 
present in them.

https://github.com/hrw/edk2-armcpuinfo/releases/tag/v1.2.0

Example header:

ArmCpuInfo v1.2.0

ID_AA64MMFR0_EL1 = 0x0100032310201126
ID_AA64MMFR1_EL1 = 0x0010011010312122
ID_AA64MMFR2_EL1 = 0x1221011112011011
ID_AA64PFR0_EL1  = 0x1201001121112222
ID_AA64PFR1_EL1  = 0x0000000001000121
ID_AA64ISAR0_EL1 = 0x1221111110212120
ID_AA64ISAR1_EL1 = 0x0011111101211052
ID_AA64ISAR2_EL1 = 0x0000000000110000
ID_AA64DFR0_EL1  = 0x1000000010305609
ID_AA64SMFR0_EL1 = 0x80F100FD00000000
ID_AA64ZFR0_EL1  = 0x0110110100110021

Have to finish work on next release - it will show also values of 
MMFR3/4, ISAR3, AFR0/1 and FPFR0 registers.


  parent reply	other threads:[~2024-05-05 13:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-03 15:34 [PATCH] hvf: arm: Fix encodings for ID_AA64PFR1_EL1 and debug System registers Zenghui Yu
2024-05-05 13:18 ` Alexander Graf
2024-05-05 14:31   ` Zenghui Yu
2024-05-05 13:38 ` Marcin Juszkiewicz [this message]
2024-05-07  9:43 ` Peter Maydell

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=1740f591-0b29-4f1d-b4cd-e2b7e579c4fd@linaro.org \
    --to=marcin.juszkiewicz@linaro.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 read-only IMAP folder(s) and NNTP newsgroup(s).