ARM: KVM: don't special case PC when doing an MMIO
authorMarc Zyngier <marc.zyngier@arm.com>
Tue, 14 May 2013 11:11:38 +0000 (12:11 +0100)
committerChristoffer Dall <christoffer.dall@linaro.org>
Wed, 26 Jun 2013 17:50:03 +0000 (10:50 -0700)
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>
arch/arm/include/asm/kvm_emulate.h
arch/arm/kvm/mmio.c

index 82b4babead2c8b7bff97a2c9b0e3f3fc37ba63f7..a464e8d7b6c58f77c5f57fdda4202587f2331962 100644 (file)
@@ -65,11 +65,6 @@ static inline bool vcpu_mode_priv(struct kvm_vcpu *vcpu)
        return cpsr_mode > USR_MODE;;
 }
 
-static inline bool kvm_vcpu_reg_is_pc(struct kvm_vcpu *vcpu, int reg)
-{
-       return reg == 15;
-}
-
 static inline u32 kvm_vcpu_get_hsr(struct kvm_vcpu *vcpu)
 {
        return vcpu->arch.fault.hsr;
index 72a12f2171b26bba2937e3c288f4bd51f1b5540b..b8e06b7a28331ede0a01ce6aefcb60d7be343f6e 100644 (file)
@@ -86,12 +86,6 @@ static int decode_hsr(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa,
        sign_extend = kvm_vcpu_dabt_issext(vcpu);
        rt = kvm_vcpu_dabt_get_rd(vcpu);
 
-       if (kvm_vcpu_reg_is_pc(vcpu, rt)) {
-               /* IO memory trying to read/write pc */
-               kvm_inject_pabt(vcpu, kvm_vcpu_get_hfar(vcpu));
-               return 1;
-       }
-
        mmio->is_write = is_write;
        mmio->phys_addr = fault_ipa;
        mmio->len = len;