OSDN Git Service

arm64: KVM: Don't generate UNDEF when LORegion feature is present
authorMarc Zyngier <marc.zyngier@arm.com>
Mon, 5 Nov 2018 15:30:26 +0000 (15:30 +0000)
committerChristoffer Dall <christoffer.dall@arm.com>
Fri, 25 Jan 2019 09:42:08 +0000 (10:42 +0100)
commit2292552102b0599ab976072e5609eaf6fb6628f6
treea9c920b5116e2d626e43d367c16911ffe80ccb00
parente08d8d296079e8fd7eefd53f73dcafebd3a5bf9f
arm64: KVM: Don't generate UNDEF when LORegion feature is present

We currently hide the LORegion feature, and generate an UNDEF
if the guest dares using the corresponding registers. This is
a bit extreme, as ARMv8.1 guarantees the feature to be present.

The guest should check the feature register before doing anything,
but we could also give the guest some slack (read "allow the
guest to be a bit stupid").

So instead of unconditionnaly deliver an exception, let's
only do it when the host doesn't support LORegion at all (or
when the feature has been sanitized out), and treat the registers
as RAZ/WI otherwise (with the exception of LORID_EL1 being RO).

Fixes: cc33c4e20185 ("arm64/kvm: Prohibit guest LOR accesses")
Suggested-by: Richard Henderson <richard.henderson@linaro.org>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Christoffer Dall <christoffer.dall@arm.com>
arch/arm64/kvm/sys_regs.c