arm64: KVM: perform save/restore of PAR_EL1
authorMarc Zyngier <marc.zyngier@arm.com>
Fri, 7 Jun 2013 10:02:34 +0000 (11:02 +0100)
committerMarc Zyngier <marc.zyngier@arm.com>
Fri, 9 Aug 2013 12:19:28 +0000 (13:19 +0100)
commit1bbd80549810637b7381ab0649ba7c7d62f1342a
treebaeef747d13eeb37203e62e9516256ae248a0831
parentc095ba7224d8edc71dcef0d655911399a8bd4a3f
arm64: KVM: perform save/restore of PAR_EL1

Not saving PAR_EL1 is an unfortunate oversight. If the guest
performs an AT* operation and gets scheduled out before reading
the result of the translation from PAREL1, it could become
corrupted by another guest or the host.

Saving this register is made slightly more complicated as KVM also
uses it on the permission fault handling path, leading to an ugly
"stash and restore" sequence. Fortunately, this is already a slow
path so we don't really care. Also, Linux doesn't do any AT*
operation, so Linux guests are not impacted by this bug.

Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
arch/arm64/include/asm/kvm_asm.h
arch/arm64/kvm/hyp.S
arch/arm64/kvm/sys_regs.c