ARM: KVM: abstract HSR_WNR away
authorMarc Zyngier <marc.zyngier@arm.com>
Tue, 18 Sep 2012 10:12:26 +0000 (11:12 +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>
Signed-off-by: Christoffer Dall <cdall@cs.columbia.edu>
arch/arm/include/asm/kvm_emulate.h
arch/arm/kvm/mmio.c

index ae9119e..a0d76df 100644 (file)
@@ -95,4 +95,9 @@ static inline bool kvm_vcpu_dabt_isvalid(struct kvm_vcpu *vcpu)
        return kvm_vcpu_get_hsr(vcpu) & HSR_ISV;
 }
 
+static inline bool kvm_vcpu_dabt_iswrite(struct kvm_vcpu *vcpu)
+{
+       return kvm_vcpu_get_hsr(vcpu) & HSR_WNR;
+}
+
 #endif /* __ARM_KVM_EMULATE_H__ */
index 41f96e9..7d58cb5 100644 (file)
@@ -92,7 +92,7 @@ static int decode_hsr(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa,
                return -EFAULT;
        }
 
-       is_write = kvm_vcpu_get_hsr(vcpu) & HSR_WNR;
+       is_write = kvm_vcpu_dabt_iswrite(vcpu);
        sign_extend = kvm_vcpu_get_hsr(vcpu) & HSR_SSE;
        rt = (kvm_vcpu_get_hsr(vcpu) & HSR_SRT_MASK) >> HSR_SRT_SHIFT;