diff options
author | Marc Zyngier <marc.zyngier@arm.com> | 2012-09-18 06:36:16 -0400 |
---|---|---|
committer | Christoffer Dall <cdall@cs.columbia.edu> | 2013-03-06 18:48:42 -0500 |
commit | 78abfcde49e0e454cabf8e56cd4c1591752e2706 (patch) | |
tree | 52a67b34e5038808f5d46243867c10cee6ac20e0 /arch | |
parent | d0adf747c9caa8b01d0c1f987e306b7c6aaa5a04 (diff) |
ARM: KVM: abstract (and fix) external abort detection away
Bit 8 is cache maintenance, bit 9 is external abort.
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Christoffer Dall <cdall@cs.columbia.edu>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/include/asm/kvm_arm.h | 3 | ||||
-rw-r--r-- | arch/arm/include/asm/kvm_emulate.h | 5 | ||||
-rw-r--r-- | arch/arm/kvm/mmio.c | 2 |
3 files changed, 9 insertions, 1 deletions
diff --git a/arch/arm/include/asm/kvm_arm.h b/arch/arm/include/asm/kvm_arm.h index 7c3d813e15df..990764e89489 100644 --- a/arch/arm/include/asm/kvm_arm.h +++ b/arch/arm/include/asm/kvm_arm.h | |||
@@ -211,4 +211,7 @@ | |||
211 | 211 | ||
212 | #define HSR_HVC_IMM_MASK ((1UL << 16) - 1) | 212 | #define HSR_HVC_IMM_MASK ((1UL << 16) - 1) |
213 | 213 | ||
214 | #define HSR_DABT_CM (1U << 8) | ||
215 | #define HSR_DABT_EA (1U << 9) | ||
216 | |||
214 | #endif /* __ARM_KVM_ARM_H__ */ | 217 | #endif /* __ARM_KVM_ARM_H__ */ |
diff --git a/arch/arm/include/asm/kvm_emulate.h b/arch/arm/include/asm/kvm_emulate.h index d548078af4d8..2d1c5854243b 100644 --- a/arch/arm/include/asm/kvm_emulate.h +++ b/arch/arm/include/asm/kvm_emulate.h | |||
@@ -110,4 +110,9 @@ static inline int kvm_vcpu_dabt_get_rd(struct kvm_vcpu *vcpu) | |||
110 | return (kvm_vcpu_get_hsr(vcpu) & HSR_SRT_MASK) >> HSR_SRT_SHIFT; | 110 | return (kvm_vcpu_get_hsr(vcpu) & HSR_SRT_MASK) >> HSR_SRT_SHIFT; |
111 | } | 111 | } |
112 | 112 | ||
113 | static inline bool kvm_vcpu_dabt_isextabt(struct kvm_vcpu *vcpu) | ||
114 | { | ||
115 | return kvm_vcpu_get_hsr(vcpu) & HSR_DABT_EA; | ||
116 | } | ||
117 | |||
113 | #endif /* __ARM_KVM_EMULATE_H__ */ | 118 | #endif /* __ARM_KVM_EMULATE_H__ */ |
diff --git a/arch/arm/kvm/mmio.c b/arch/arm/kvm/mmio.c index 586063d0697a..e4682a3af313 100644 --- a/arch/arm/kvm/mmio.c +++ b/arch/arm/kvm/mmio.c | |||
@@ -65,7 +65,7 @@ static int decode_hsr(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa, | |||
65 | unsigned long rt, len; | 65 | unsigned long rt, len; |
66 | bool is_write, sign_extend; | 66 | bool is_write, sign_extend; |
67 | 67 | ||
68 | if ((kvm_vcpu_get_hsr(vcpu) >> 8) & 1) { | 68 | if (kvm_vcpu_dabt_isextabt(vcpu)) { |
69 | /* cache operation on I/O addr, tell guest unsupported */ | 69 | /* cache operation on I/O addr, tell guest unsupported */ |
70 | kvm_inject_dabt(vcpu, kvm_vcpu_get_hfar(vcpu)); | 70 | kvm_inject_dabt(vcpu, kvm_vcpu_get_hfar(vcpu)); |
71 | return 1; | 71 | return 1; |