arm64: KVM: VHE: reset PSTATE.PAN on entry to EL2
authorVladimir Murzin <vladimir.murzin@arm.com>
Thu, 1 Sep 2016 14:29:03 +0000 (15:29 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 28 Oct 2016 07:45:26 +0000 (03:45 -0400)
commitaa8f9876b8029372191ca3687d8a188975adc74c
tree5a17b1caac803e06a699cb183b8fd7f61b66b486
parent8790ff414ffcb3868dde6e61b707349138512b4b
arm64: KVM: VHE: reset PSTATE.PAN on entry to EL2

commit cb96408da4e11698674abd04aeac941c1bed2038 upstream.

SCTLR_EL2.SPAN bit controls what happens with the PSTATE.PAN bit on an
exception. However, this bit has no effect on the PSTATE.PAN when
HCR_EL2.E2H or HCR_EL2.TGE is unset. Thus when VHE is used and
exception taken from a guest PSTATE.PAN bit left unchanged and we
continue with a value guest has set.

To address that always reset PSTATE.PAN on entry from EL1.

Fixes: 1f364c8c48a0 ("arm64: VHE: Add support for running Linux in EL2 mode")
Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
Reviewed-by: James Morse <james.morse@arm.com>
Acked-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
[ rebased for v4.7+ ]
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm64/kvm/hyp/entry.S