diff options
author | Marc Zyngier <marc.zyngier@arm.com> | 2013-05-14 07:11:38 -0400 |
---|---|---|
committer | Christoffer Dall <christoffer.dall@linaro.org> | 2013-06-26 13:50:03 -0400 |
commit | 8734f16fb2aa4ff0bb57ad6532661a38bc8ff957 (patch) | |
tree | e19cfee3ff6878cd868fbe1083d52fe3ddd26bbf /arch | |
parent | dac288f7b38a7439502b77dabcdf8a9a5c4ae721 (diff) |
ARM: KVM: don't special case PC when doing an MMIO
Admitedly, reading a MMIO register to load PC is very weird.
Writing PC to a MMIO register is probably even worse. But
the architecture doesn't forbid any of these, and injecting
a Prefetch Abort is the wrong thing to do anyway.
Remove this check altogether, and let the adventurous guest
wander into LaLaLand if they feel compelled to do so.
Reported-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
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_emulate.h | 5 | ||||
-rw-r--r-- | arch/arm/kvm/mmio.c | 6 |
2 files changed, 0 insertions, 11 deletions
diff --git a/arch/arm/include/asm/kvm_emulate.h b/arch/arm/include/asm/kvm_emulate.h index 82b4babead2c..a464e8d7b6c5 100644 --- a/arch/arm/include/asm/kvm_emulate.h +++ b/arch/arm/include/asm/kvm_emulate.h | |||
@@ -65,11 +65,6 @@ static inline bool vcpu_mode_priv(struct kvm_vcpu *vcpu) | |||
65 | return cpsr_mode > USR_MODE;; | 65 | return cpsr_mode > USR_MODE;; |
66 | } | 66 | } |
67 | 67 | ||
68 | static inline bool kvm_vcpu_reg_is_pc(struct kvm_vcpu *vcpu, int reg) | ||
69 | { | ||
70 | return reg == 15; | ||
71 | } | ||
72 | |||
73 | static inline u32 kvm_vcpu_get_hsr(struct kvm_vcpu *vcpu) | 68 | static inline u32 kvm_vcpu_get_hsr(struct kvm_vcpu *vcpu) |
74 | { | 69 | { |
75 | return vcpu->arch.fault.hsr; | 70 | return vcpu->arch.fault.hsr; |
diff --git a/arch/arm/kvm/mmio.c b/arch/arm/kvm/mmio.c index 72a12f2171b2..b8e06b7a2833 100644 --- a/arch/arm/kvm/mmio.c +++ b/arch/arm/kvm/mmio.c | |||
@@ -86,12 +86,6 @@ static int decode_hsr(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa, | |||
86 | sign_extend = kvm_vcpu_dabt_issext(vcpu); | 86 | sign_extend = kvm_vcpu_dabt_issext(vcpu); |
87 | rt = kvm_vcpu_dabt_get_rd(vcpu); | 87 | rt = kvm_vcpu_dabt_get_rd(vcpu); |
88 | 88 | ||
89 | if (kvm_vcpu_reg_is_pc(vcpu, rt)) { | ||
90 | /* IO memory trying to read/write pc */ | ||
91 | kvm_inject_pabt(vcpu, kvm_vcpu_get_hfar(vcpu)); | ||
92 | return 1; | ||
93 | } | ||
94 | |||
95 | mmio->is_write = is_write; | 89 | mmio->is_write = is_write; |
96 | mmio->phys_addr = fault_ipa; | 90 | mmio->phys_addr = fault_ipa; |
97 | mmio->len = len; | 91 | mmio->len = len; |