]> git.ipfire.org Git - thirdparty/qemu.git/commit
hvf: arm: Fix encodings for ID_AA64PFR1_EL1 and debug System registers
authorZenghui Yu <zenghui.yu@linux.dev>
Thu, 23 May 2024 15:06:19 +0000 (16:06 +0100)
committerMichael Tokarev <mjt@tls.msk.ru>
Thu, 30 May 2024 14:11:59 +0000 (17:11 +0300)
commitc6fe98fe79cede57706c5811e64a5e7f3cae2fc8
tree798068115791830ee8cfc989405f4a92150e793f
parent07f686009f709ad63f95aa6861a8d22682c8d835
hvf: arm: Fix encodings for ID_AA64PFR1_EL1 and debug System registers

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.

Cc: qemu-stable@nongnu.org
Fixes: a1477da3ddeb ("hvf: Add Apple Silicon support")
Signed-off-by: Zenghui Yu <zenghui.yu@linux.dev>
Reviewed-by: Alexander Graf <agraf@csgraf.de>
Message-id: 20240503153453.54389-1-zenghui.yu@linux.dev
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
(cherry picked from commit 19ed42e8adc87a3c739f61608b66a046bb9237e2)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
target/arm/hvf/hvf.c