diff options
author | Marc Zyngier <maz@kernel.org> | 2024-02-29 17:54:17 +0300 |
---|---|---|
committer | Oliver Upton <oliver.upton@linux.dev> | 2024-03-01 21:53:47 +0300 |
commit | 9a3bfb27ef65ad41d994765c031ca18217afb058 (patch) | |
tree | 1c227096c7f5ab76f271fcb7abf62726c4701e65 /lib/memory-notifier-error-inject.c | |
parent | 43b3bedb7cc4348f2885a30e960b63b94d1be381 (diff) | |
download | linux-9a3bfb27ef65ad41d994765c031ca18217afb058.tar.xz |
KVM: arm64: Fix TRFCR_EL1/PMSCR_EL1 access in hVHE mode
When running in hVHE mode, EL1 accesses are performed with the EL12
accessor, as we run with HCR_EL2.E2H=1.
Unfortunately, both PMSCR_EL1 and TRFCR_EL1 are used with the
EL1 accessor, meaning that we actually affect the EL2 state. Duh.
Switch to using the {read,write}_sysreg_el1() helpers that will do
the right thing in all circumstances.
Note that the 'Fixes:' tag doesn't represent the point where the bug
was introduced (there is no such point), but the first practical point
where the hVHE feature is usable.
Cc: James Clark <james.clark@arm.com>
Cc: Anshuman Khandual <anshuman.khandual@arm.com>
Fixes: 38cba55008e5 ("KVM: arm64: Force HCR_E2H in guest context when ARM64_KVM_HVHE is set")
Signed-off-by: Marc Zyngier <maz@kernel.org>
Reviewed-by: Oliver Upton <oliver.upton@linux.dev>
Link: https://lore.kernel.org/r/20240229145417.3606279-1-maz@kernel.org
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
Diffstat (limited to 'lib/memory-notifier-error-inject.c')
0 files changed, 0 insertions, 0 deletions