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/kvm | |
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/kvm')
-rw-r--r-- | arch/arm/kvm/mmio.c | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/arch/arm/kvm/mmio.c b/arch/arm/kvm/mmio.c index 6495c1ca7bfa..0b8f49985b70 100644 --- a/arch/arm/kvm/mmio.c +++ b/arch/arm/kvm/mmio.c | |||
@@ -77,20 +77,9 @@ static int decode_hsr(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa, | |||
77 | return 1; | 77 | return 1; |
78 | } | 78 | } |
79 | 79 | ||
80 | switch ((kvm_vcpu_get_hsr(vcpu) >> 22) & 0x3) { | 80 | len = kvm_vcpu_dabt_get_as(vcpu); |
81 | case 0: | 81 | if (unlikely(len < 0)) |
82 | len = 1; | 82 | return len; |
83 | break; | ||
84 | case 1: | ||
85 | len = 2; | ||
86 | break; | ||
87 | case 2: | ||
88 | len = 4; | ||
89 | break; | ||
90 | default: | ||
91 | kvm_err("Hardware is weird: SAS 0b11 is reserved\n"); | ||
92 | return -EFAULT; | ||
93 | } | ||
94 | 83 | ||
95 | is_write = kvm_vcpu_dabt_iswrite(vcpu); | 84 | is_write = kvm_vcpu_dabt_iswrite(vcpu); |
96 | sign_extend = kvm_vcpu_dabt_issext(vcpu); | 85 | sign_extend = kvm_vcpu_dabt_issext(vcpu); |