diff options
author | Marc Zyngier <marc.zyngier@arm.com> | 2012-09-18 06:43:30 -0400 |
---|---|---|
committer | Christoffer Dall <cdall@cs.columbia.edu> | 2013-03-06 18:48:43 -0500 |
commit | a7123377e7107a5f4f7ae198aa5b5000c9362871 (patch) | |
tree | 01d5091c66213a43e0f28d8db21647782284ed07 /arch/arm/include | |
parent | b37670b0f37d8015d0d428e6a63bd07397430a2f (diff) |
ARM: KVM: abstract SAS decoding away
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Christoffer Dall <cdall@cs.columbia.edu>
Diffstat (limited to 'arch/arm/include')
-rw-r--r-- | arch/arm/include/asm/kvm_emulate.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/arch/arm/include/asm/kvm_emulate.h b/arch/arm/include/asm/kvm_emulate.h index 6b43653865fb..e4a4fc2f9156 100644 --- a/arch/arm/include/asm/kvm_emulate.h +++ b/arch/arm/include/asm/kvm_emulate.h | |||
@@ -120,4 +120,20 @@ static inline bool kvm_vcpu_dabt_iss1tw(struct kvm_vcpu *vcpu) | |||
120 | return kvm_vcpu_get_hsr(vcpu) & HSR_DABT_S1PTW; | 120 | return kvm_vcpu_get_hsr(vcpu) & HSR_DABT_S1PTW; |
121 | } | 121 | } |
122 | 122 | ||
123 | /* Get Access Size from a data abort */ | ||
124 | static inline int kvm_vcpu_dabt_get_as(struct kvm_vcpu *vcpu) | ||
125 | { | ||
126 | switch ((kvm_vcpu_get_hsr(vcpu) >> 22) & 0x3) { | ||
127 | case 0: | ||
128 | return 1; | ||
129 | case 1: | ||
130 | return 2; | ||
131 | case 2: | ||
132 | return 4; | ||
133 | default: | ||
134 | kvm_err("Hardware is weird: SAS 0b11 is reserved\n"); | ||
135 | return -EFAULT; | ||
136 | } | ||
137 | } | ||
138 | |||
123 | #endif /* __ARM_KVM_EMULATE_H__ */ | 139 | #endif /* __ARM_KVM_EMULATE_H__ */ |