]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - arch/arm64/include/asm/kvm_emulate.h
Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux
[linux.git] / arch / arm64 / include / asm / kvm_emulate.h
index 17e92f05b1fe597ea1c4e833debf7541be0fde79..3ca894ecf699b33693e214479ca196bced5fa0c3 100644 (file)
@@ -99,11 +99,13 @@ static inline void vcpu_set_thumb(struct kvm_vcpu *vcpu)
        *vcpu_cpsr(vcpu) |= COMPAT_PSR_T_BIT;
 }
 
+/*
+ * vcpu_reg should always be passed a register number coming from a
+ * read of ESR_EL2. Otherwise, it may give the wrong result on AArch32
+ * with banked registers.
+ */
 static inline unsigned long *vcpu_reg(const struct kvm_vcpu *vcpu, u8 reg_num)
 {
-       if (vcpu_mode_is_32bit(vcpu))
-               return vcpu_reg32(vcpu, reg_num);
-
        return (unsigned long *)&vcpu_gp_regs(vcpu)->regs.regs[reg_num];
 }