6a4ef4e5d1
HCR_EL2.TID3 mandates that access from EL1 to a long list of id registers traps to EL2, and QEMU has so far ignored this requirement. This breaks (among other things) KVM guests that have PtrAuth enabled, while the hypervisor doesn't want to expose the feature to its guest. To achieve this, KVM traps the ID registers (ID_AA64ISAR1_EL1 in this case), and masks out the unsupported feature. QEMU not honoring the trap request means that the guest observes that the feature is present in the HW, starts using it, and dies a horrible death when KVM injects an UNDEF, because the feature *really* isn't supported. Do the right thing by trapping to EL2 if HCR_EL2.TID3 is set. Note that this change does not include trapping of the MVFR registers from AArch32 (they are accessed via the VMRS instruction and need to be handled in a different way). Reported-by: Will Deacon <will@kernel.org> Signed-off-by: Marc Zyngier <maz@kernel.org> Tested-by: Will Deacon <will@kernel.org> Message-id: 20191123115618.29230-1-maz@kernel.org [PMM: added missing accessfn line for ID_AA4PFR2_EL1_RESERVED; changed names of access functions to include _tid3] Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
||
---|---|---|
.. | ||
a32-uncond.decode | ||
a32.decode | ||
arch_dump.c | ||
arm_ldst.h | ||
arm-powerctl.c | ||
arm-powerctl.h | ||
arm-semi.c | ||
cpu64.c | ||
cpu-param.h | ||
cpu-qom.h | ||
cpu.c | ||
cpu.h | ||
crypto_helper.c | ||
debug_helper.c | ||
gdbstub64.c | ||
gdbstub.c | ||
helper-a64.c | ||
helper-a64.h | ||
helper-sve.h | ||
helper.c | ||
helper.h | ||
idau.h | ||
internals.h | ||
iwmmxt_helper.c | ||
kvm32.c | ||
kvm64.c | ||
kvm_arm.h | ||
kvm-consts.h | ||
kvm-stub.c | ||
kvm.c | ||
m_helper.c | ||
machine.c | ||
Makefile.objs | ||
monitor.c | ||
neon_helper.c | ||
op_addsub.h | ||
op_helper.c | ||
pauth_helper.c | ||
psci.c | ||
sve_helper.c | ||
sve.decode | ||
t16.decode | ||
t32.decode | ||
tlb_helper.c | ||
trace-events | ||
translate-a64.c | ||
translate-a64.h | ||
translate-sve.c | ||
translate-vfp.inc.c | ||
translate.c | ||
translate.h | ||
vec_helper.c | ||
vfp_helper.c | ||
vfp-uncond.decode | ||
vfp.decode |