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)
committerChristoffer Dall <christoffer.dall@linaro.org>
Thu, 2 Oct 2014 15:17:59 +0000 (17:17 +0200)
commitebd362b7533b7866928c9bca7727c48558aedbd2
tree524c2c48fe6be2c668087b031d6c0c4cb0fd1708
parentce7fc7403b536adb6b0871f3e4d07a4da08ad63b
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>
(cherry picked from commit 1bbd80549810637b7381ab0649ba7c7d62f1342a)
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
arch/arm64/include/asm/kvm_asm.h
arch/arm64/kvm/hyp.S
arch/arm64/kvm/sys_regs.c