linux/arch/arm64
James Morse 7c582bf4ed KVM: arm64: Stop writing aarch32's CSSELR into ACTLR
aarch32 has pairs of registers to access the high and low parts of 64bit
registers. KVM has a union of 64bit sys_regs[] and 32bit copro[]. The
32bit accessors read the high or low part of the 64bit sys_reg[] value
through the union.

Both sys_reg_descs[] and cp15_regs[] list access_csselr() as the accessor
for CSSELR{,_EL1}. access_csselr() is only aware of the 64bit sys_regs[],
and expects r->reg to be 'CSSELR_EL1' in the enum, index 2 of the 64bit
array.

cp15_regs[] uses the 32bit copro[] alias of sys_regs[]. Here CSSELR is
c0_CSSELR which is the same location in sys_reg[]. r->reg is 'c0_CSSELR',
index 4 in the 32bit array.

access_csselr() uses the 32bit r->reg value to access the 64bit array,
so reads and write the wrong value. sys_regs[4], is ACTLR_EL1, which
is subsequently save/restored when we enter the guest.

ACTLR_EL1 is supposed to be read-only for the guest. This register
only affects execution at EL1, and the host's value is restored before
we return to host EL1.

Convert the 32bit register index back to the 64bit version.

Suggested-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: James Morse <james.morse@arm.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20200529150656.7339-2-james.morse@arm.com
2020-06-09 09:04:42 +01:00
..
boot ARM: devicetree updates for v5.7 2020-04-03 15:22:05 -07:00
configs ARM: defconfig updates 2020-04-03 15:15:10 -07:00
crypto crypto: arch/nhpoly1305 - process in explicit 4k chunks 2020-04-30 15:16:59 +10:00
include KVM: arm64: Drop obsolete comment about sys_reg ordering 2020-05-28 13:16:57 +01:00
kernel KVM: arm64: Kill off CONFIG_KVM_ARM_HOST 2020-05-16 15:04:18 +01:00
kvm KVM: arm64: Stop writing aarch32's CSSELR into ACTLR 2020-06-09 09:04:42 +01:00
lib arm64: fix spelling mistake "ca not" -> "cannot" 2020-03-17 18:22:40 +00:00
mm arm64: hugetlb: avoid potential NULL dereference 2020-05-07 09:24:15 +01:00
net
xen arm64: xen: Use modern annotations for assembly functions 2020-01-09 16:09:42 +00:00
Kbuild
Kconfig arm64 fixes: 2020-04-09 11:04:16 -07:00
Kconfig.debug arm64: remove CONFIG_DEBUG_ALIGN_RODATA feature 2020-04-01 21:44:43 +01:00
Kconfig.platforms ARM: SoC updates 2020-04-03 15:02:35 -07:00
Makefile arm64: Always force a branch protection mode when the compiler has one 2020-04-01 21:23:40 +01:00