]> git.baikalelectronics.ru Git - kernel.git/commit
ARM: KVM: perform save/restore of PAR
authorMarc Zyngier <marc.zyngier@arm.com>
Fri, 21 Jun 2013 12:08:46 +0000 (13:08 +0100)
committerChristoffer Dall <christoffer.dall@linaro.org>
Wed, 26 Jun 2013 17:50:04 +0000 (10:50 -0700)
commitfd8b3a278a7beca085d051d582e90e9f43ee1542
tree78f18407f328888685939a1f183beebd349e6cc3
parent5c9c3a2089b549c72d5bdd1c3d99f35c18438b04
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>
arch/arm/include/asm/kvm_asm.h
arch/arm/kvm/coproc.c
arch/arm/kvm/interrupts.S
arch/arm/kvm/interrupts_head.S