summaryrefslogtreecommitdiffstats
path: root/arch/arm/kvm/coproc.c
diff options
context:
space:
mode:
authorMarc Zyngier2013-06-21 14:08:46 +0200
committerChristoffer Dall2013-06-26 19:50:04 +0200
commit6a077e4ab9cbfbf279fb955bae05b03781c97013 (patch)
tree78f18407f328888685939a1f183beebd349e6cc3 /arch/arm/kvm/coproc.c
parentARM: KVM: get rid of S2_PGD_SIZE (diff)
downloadkernel-qcow2-linux-6a077e4ab9cbfbf279fb955bae05b03781c97013.tar.gz
kernel-qcow2-linux-6a077e4ab9cbfbf279fb955bae05b03781c97013.tar.xz
kernel-qcow2-linux-6a077e4ab9cbfbf279fb955bae05b03781c97013.zip
ARM: KVM: perform save/restore of PAR
Not saving PAR is an unfortunate oversight. If the guest performs an AT* operation and gets scheduled out before reading the result of the translation from PAR, 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. [ Slightly tweaked to use an even register as first operand to ldrd and strd operations in interrupts_head.S - Christoffer ] Signed-off-by: Marc Zyngier <marc.zyngier@arm.com> Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
Diffstat (limited to 'arch/arm/kvm/coproc.c')
-rw-r--r--arch/arm/kvm/coproc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/arm/kvm/coproc.c b/arch/arm/kvm/coproc.c
index 8eea97be1ed5..4a5199070430 100644
--- a/arch/arm/kvm/coproc.c
+++ b/arch/arm/kvm/coproc.c
@@ -180,6 +180,10 @@ static const struct coproc_reg cp15_regs[] = {
NULL, reset_unknown, c6_DFAR },
{ CRn( 6), CRm( 0), Op1( 0), Op2( 2), is32,
NULL, reset_unknown, c6_IFAR },
+
+ /* PAR swapped by interrupt.S */
+ { CRn( 7), Op1( 0), is64, NULL, reset_unknown64, c7_PAR },
+
/*
* DC{C,I,CI}SW operations:
*/