[PATCH 04/29] ARM: KVM: abstract HSR_WNR away
Marc Zyngier
marc.zyngier at arm.com
Mon Mar 4 21:42:58 EST 2013
Signed-off-by: Marc Zyngier <marc.zyngier at arm.com>
---
arch/arm/include/asm/kvm_emulate.h | 5 +++++
arch/arm/kvm/mmio.c | 2 +-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/arch/arm/include/asm/kvm_emulate.h b/arch/arm/include/asm/kvm_emulate.h
index 9531535..236fadd 100644
--- a/arch/arm/include/asm/kvm_emulate.h
+++ b/arch/arm/include/asm/kvm_emulate.h
@@ -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__ */
diff --git a/arch/arm/kvm/mmio.c b/arch/arm/kvm/mmio.c
index 41f96e9..7d58cb5 100644
--- a/arch/arm/kvm/mmio.c
+++ b/arch/arm/kvm/mmio.c
@@ -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;
--
1.7.12.4
More information about the linux-arm-kernel
mailing list