diff options
author | Shannon Zhao <shannon.zhao@linaro.org> | 2016-01-13 17:16:41 +0800 |
---|---|---|
committer | Marc Zyngier <marc.zyngier@arm.com> | 2016-01-24 21:56:01 +0000 |
commit | 6327f35a2010c06a3bc2bfb14202a38764fb9920 (patch) | |
tree | 7fd516e15925b27b93e2e2584834f62284dbb5c7 /arch/arm64 | |
parent | 7769db905bd2df08e844b645437f4729fc1c4d20 (diff) |
arm64: KVM: Fix guest dead loop when register accessor returns false
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 <marc.zyngier@arm.com>
Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Diffstat (limited to 'arch/arm64')
-rw-r--r-- | arch/arm64/kvm/sys_regs.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/arch/arm64/kvm/sys_regs.c b/arch/arm64/kvm/sys_regs.c index 4048934bb3a5..2e90371cfb37 100644 --- a/arch/arm64/kvm/sys_regs.c +++ b/arch/arm64/kvm/sys_regs.c @@ -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 */ |