]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
ARM: KVM: abstract HSR_SRT_{MASK,SHIFT} away
authorMarc Zyngier <marc.zyngier@arm.com>
Tue, 18 Sep 2012 10:28:57 +0000 (11:28 +0100)
committerChristoffer Dall <cdall@cs.columbia.edu>
Wed, 6 Mar 2013 23:48:42 +0000 (15:48 -0800)
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
arch/arm/include/asm/kvm_emulate.h
arch/arm/kvm/mmio.c

index cd9cb874a7ff1c068aa03322f50be3703fe324bb..d548078af4d888ecae8b22cb3c7bcbe3b8859347 100644 (file)
@@ -105,4 +105,9 @@ static inline bool kvm_vcpu_dabt_issext(struct kvm_vcpu *vcpu)
        return kvm_vcpu_get_hsr(vcpu) & HSR_SSE;
 }
 
+static inline int kvm_vcpu_dabt_get_rd(struct kvm_vcpu *vcpu)
+{
+       return (kvm_vcpu_get_hsr(vcpu) & HSR_SRT_MASK) >> HSR_SRT_SHIFT;
+}
+
 #endif /* __ARM_KVM_EMULATE_H__ */
index 058029c2d5040d8f5eeb01066ae426fbdc43ba93..586063d0697a713b001654624bdf4697cf0b8afa 100644 (file)
@@ -94,7 +94,7 @@ static int decode_hsr(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa,
 
        is_write = kvm_vcpu_dabt_iswrite(vcpu);
        sign_extend = kvm_vcpu_dabt_issext(vcpu);
-       rt = (kvm_vcpu_get_hsr(vcpu) & HSR_SRT_MASK) >> HSR_SRT_SHIFT;
+       rt = kvm_vcpu_dabt_get_rd(vcpu);
 
        if (kvm_vcpu_reg_is_pc(vcpu, rt)) {
                /* IO memory trying to read/write pc */