diff options
author | Marc Zyngier <maz@kernel.org> | 2024-03-21 11:54:14 +0000 |
---|---|---|
committer | Oliver Upton <oliver.upton@linux.dev> | 2024-04-01 01:33:29 -0700 |
commit | b3320142f3db9b3f2a23460abd3e22292e1530a5 (patch) | |
tree | 49a808439e6b70ca97493a2c8e9a2bae037c3afc /lib/debugobjects.c | |
parent | 4c36a156738887c1edd78589fe192d757989bcde (diff) |
arm64: Fix early handling of FEAT_E2H0 not being implemented
Commit 3944382fa6f2 introduced checks for the FEAT_E2H0 not being
implemented. However, the check is absolutely wrong and makes a
point it testing a bit that is guaranteed to be zero.
On top of that, the detection happens way too late, after the
init_el2_state has done its job.
This went undetected because the HW this was tested on has E2H being
RAO/WI, and not RES1. However, the bug shows up when run as a nested
guest, where HCR_EL2.E2H is not necessarily set to 1. As a result,
booting the kernel in hVHE mode fails with timer accesses being
cought in a trap loop (which was fun to debug).
Fix the check for ID_AA64MMFR4_EL1.E2H0, and set the HCR_EL2.E2H bit
early so that it can be checked by the rest of the init sequence.
With this, hVHE works again in a NV environment that doesn't have
FEAT_E2H0.
Fixes: 3944382fa6f2 ("arm64: Treat HCR_EL2.E2H as RES1 when ID_AA64MMFR4_EL1.E2H0 is negative")
Signed-off-by: Marc Zyngier <maz@kernel.org>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Link: https://lore.kernel.org/r/20240321115414.3169115-1-maz@kernel.org
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
Diffstat (limited to 'lib/debugobjects.c')
0 files changed, 0 insertions, 0 deletions