summaryrefslogtreecommitdiffstats
path: root/arch/arm64/kvm/sys_regs.h
diff options
context:
space:
mode:
authorPavel Fedin <p.fedin@samsung.com>2015-12-04 15:03:13 +0300
committerMarc Zyngier <marc.zyngier@arm.com>2015-12-04 16:29:54 +0000
commit2ec5be3dbfdcb672cdafde463a5f2c0bfe522c3d (patch)
tree5172656b0fc303906f951be316cb9a2e902e249e /arch/arm64/kvm/sys_regs.h
parent3fec037d0fb292c4e5b2a7f8d132b5f9d5487ff3 (diff)
downloadlinux-2ec5be3dbfdcb672cdafde463a5f2c0bfe522c3d.tar.bz2
arm64: KVM: Correctly handle zero register in system register accesses
System register accesses also use zero register for Rt == 31, and therefore using it will also result in getting SP value instead. This patch makes them also using new accessors, introduced by the previous patch. Since register value is no longer directly associated with storage inside vCPU context structure, we introduce a dedicated storage for it in struct sys_reg_params. This refactor also gets rid of "massive hack" in kvm_handle_cp_64(). Signed-off-by: Pavel Fedin <p.fedin@samsung.com> Reviewed-by: Marc Zyngier <marc.zyngier@arm.com> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Diffstat (limited to 'arch/arm64/kvm/sys_regs.h')
-rw-r--r--arch/arm64/kvm/sys_regs.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/arm64/kvm/sys_regs.h b/arch/arm64/kvm/sys_regs.h
index 953abfc4b017..dbbb01cfbee9 100644
--- a/arch/arm64/kvm/sys_regs.h
+++ b/arch/arm64/kvm/sys_regs.h
@@ -28,7 +28,7 @@ struct sys_reg_params {
u8 CRn;
u8 CRm;
u8 Op2;
- u8 Rt;
+ u64 regval;
bool is_write;
bool is_aarch32;
bool is_32bit; /* Only valid if is_aarch32 is true */
@@ -79,7 +79,7 @@ static inline bool ignore_write(struct kvm_vcpu *vcpu,
static inline bool read_zero(struct kvm_vcpu *vcpu,
struct sys_reg_params *p)
{
- *vcpu_reg(vcpu, p->Rt) = 0;
+ p->regval = 0;
return true;
}