arm64: KVM: allows discrimination of AArch32 sysreg access
authorMarc Zyngier <marc.zyngier@arm.com>
Tue, 21 Jan 2014 10:55:17 +0000 (10:55 +0000)
committerChristoffer Dall <christoffer.dall@linaro.org>
Thu, 2 Oct 2014 15:18:33 +0000 (17:18 +0200)
commit96d03922c8cb37a48451b02f95e80cd749266bbe
tree0a26a06f0dcb5f6840920dd572c941e9cdcdbe5b
parentfca920166b7c07b3932b2a8a24916e5002a57900
arm64: KVM: allows discrimination of AArch32 sysreg access

The current handling of AArch32 trapping is slightly less than
perfect, as it is not possible (from a handler point of view)
to distinguish it from an AArch64 access, nor to tell a 32bit
from a 64bit access either.

Fix this by introducing two additional flags:
- is_aarch32: true if the access was made in AArch32 mode
- is_32bit: true if is_aarch32 == true and a MCR/MRC instruction
  was used to perform the access (as opposed to MCRR/MRRC).

This allows a handler to cover all the possible conditions in which
a system register gets trapped.

Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Acked-by: Christoffer Dall <christoffer.dall@linaro.org>
(cherry picked from commit 2072d29c46b73e39b3c6c56c6027af77086f45fd)
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
arch/arm64/kvm/sys_regs.c
arch/arm64/kvm/sys_regs.h