Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 372082
b: refs/heads/master
c: 4926d44
h: refs/heads/master
v: v3
  • Loading branch information
Marc Zyngier authored and Christoffer Dall committed Mar 6, 2013
1 parent 1e6c90e commit 3078942
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 23b415d61a80c0c63f43dd2b3a08a1fa0b79b8ea
refs/heads/master: 4926d445eb76bec8ebd71f5ed9e9c94fd738014d
5 changes: 5 additions & 0 deletions trunk/arch/arm/include/asm/kvm_emulate.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,4 +142,9 @@ static inline bool kvm_vcpu_trap_il_is32bit(struct kvm_vcpu *vcpu)
return kvm_vcpu_get_hsr(vcpu) & HSR_IL;
}

static inline u8 kvm_vcpu_trap_get_class(struct kvm_vcpu *vcpu)
{
return kvm_vcpu_get_hsr(vcpu) >> HSR_EC_SHIFT;
}

#endif /* __ARM_KVM_EMULATE_H__ */
4 changes: 2 additions & 2 deletions trunk/arch/arm/kvm/arm.c
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ static bool kvm_condition_valid(struct kvm_vcpu *vcpu)
* catch undefined instructions, and then we won't get past
* the arm_exit_handlers test anyway.
*/
BUG_ON(((kvm_vcpu_get_hsr(vcpu) & HSR_EC) >> HSR_EC_SHIFT) == 0);
BUG_ON(!kvm_vcpu_trap_get_class(vcpu));

/* Top two bits non-zero? Unconditional. */
if (kvm_vcpu_get_hsr(vcpu) >> 30)
Expand Down Expand Up @@ -609,7 +609,7 @@ static int handle_exit(struct kvm_vcpu *vcpu, struct kvm_run *run,
case ARM_EXCEPTION_DATA_ABORT:
case ARM_EXCEPTION_PREF_ABORT:
case ARM_EXCEPTION_HVC:
hsr_ec = (kvm_vcpu_get_hsr(vcpu) & HSR_EC) >> HSR_EC_SHIFT;
hsr_ec = kvm_vcpu_trap_get_class(vcpu);

if (hsr_ec >= ARRAY_SIZE(arm_exit_handlers)
|| !arm_exit_handlers[hsr_ec]) {
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/arm/kvm/mmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@ int kvm_handle_guest_abort(struct kvm_vcpu *vcpu, struct kvm_run *run)
gfn_t gfn;
int ret, idx;

hsr_ec = kvm_vcpu_get_hsr(vcpu) >> HSR_EC_SHIFT;
hsr_ec = kvm_vcpu_trap_get_class(vcpu);
is_iabt = (hsr_ec == HSR_EC_IABT);
fault_ipa = kvm_vcpu_get_fault_ipa(vcpu);

Expand Down

0 comments on commit 3078942

Please sign in to comment.