]> Git Repo - linux.git/commitdiff
arm64: KVM: Fix guest dead loop when register accessor returns false
authorShannon Zhao <[email protected]>
Wed, 13 Jan 2016 09:16:41 +0000 (17:16 +0800)
committerMarc Zyngier <[email protected]>
Sun, 24 Jan 2016 21:56:01 +0000 (21:56 +0000)
Currently emulate_cp will return 0 (Handled) no matter what the accessor
returns. If register accessor returns false, it will not skip current PC
while emulate_cp return handled. Then guest will stuck in a dead loop.

Reviewed-by: Marc Zyngier <[email protected]>
Signed-off-by: Shannon Zhao <[email protected]>
Signed-off-by: Marc Zyngier <[email protected]>
arch/arm64/kvm/sys_regs.c

index 4048934bb3a5c906f1125386c5b0c1cab6f0e660..2e90371cfb378b0e064667506a2b74c9275cacfb 100644 (file)
@@ -1007,10 +1007,9 @@ static int emulate_cp(struct kvm_vcpu *vcpu,
                if (likely(r->access(vcpu, params, r))) {
                        /* Skip instruction, since it was emulated */
                        kvm_skip_instr(vcpu, kvm_vcpu_trap_il_is32bit(vcpu));
+                       /* Handled */
+                       return 0;
                }
-
-               /* Handled */
-               return 0;
        }
 
        /* Not handled */
This page took 0.061386 seconds and 4 git commands to generate.