]> git.baikalelectronics.ru Git - kernel.git/commit
arm64: KVM: fix 64bit CP15 VM access for 32bit guests
authorMarc Zyngier <marc.zyngier@arm.com>
Fri, 1 Aug 2014 11:00:36 +0000 (12:00 +0100)
committerChristoffer Dall <christoffer.dall@linaro.org>
Fri, 1 Aug 2014 12:05:06 +0000 (14:05 +0200)
commit585d313505d14823c1ddb823637652e64cc16c93
tree87dd96b3da3d826dc06f5d40a4eeb3445af9d18d
parentbede12c1321f132fb34f2046f324b557d99d6bb8
arm64: KVM: fix 64bit CP15 VM access for 32bit guests

Commit 3a8ba289d61f (ARM64: KVM: fix big endian issue in
access_vm_reg for 32bit guest) changed the way we handle CP15
VM accesses, so that all 64bit accesses are done via vcpu_sys_reg.

This looks like a good idea as it solves indianness issues in an
elegant way, except for one small detail: the register index is
doesn't refer to the same array! We end up corrupting some random
data structure instead.

Fix this by reverting to the original code, except for the introduction
of a vcpu_cp15_64_high macro that deals with the endianness thing.

Tested on Juno with 32bit SMP guests.

Cc: Victor Kamensky <victor.kamensky@linaro.org>
Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
arch/arm64/include/asm/kvm_host.h
arch/arm64/kvm/sys_regs.c