linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: marc.zyngier@arm.com (Marc Zyngier)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 5/5] arm64: KVM: Fix guest dead loop when register accessor returns false
Date: Thu, 28 Jan 2016 10:30:38 +0000	[thread overview]
Message-ID: <1453977038-13516-6-git-send-email-marc.zyngier@arm.com> (raw)
In-Reply-To: <1453977038-13516-1-git-send-email-marc.zyngier@arm.com>

From: Shannon Zhao <shannon.zhao@linaro.org>

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>
---
 arch/arm64/kvm/sys_regs.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/arch/arm64/kvm/sys_regs.c b/arch/arm64/kvm/sys_regs.c
index 4048934..2e90371 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 */
-- 
2.1.4

  parent reply	other threads:[~2016-01-28 10:30 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-28 10:30 [GIT PULL] KVM/ARM updates for 4.5-rc2 Marc Zyngier
2016-01-28 10:30 ` [PATCH 1/5] arm64: KVM: Fix AArch64 guest userspace exception injection Marc Zyngier
2016-01-28 10:30 ` [PATCH 2/5] arm64: KVM: Obey RES0/1 reserved bits when setting CPTR_EL2 Marc Zyngier
2016-01-28 10:30 ` [PATCH 3/5] arm64: KVM: Fix wrong use of the CPSR MODE mask for 32bit guests Marc Zyngier
2016-01-28 10:30 ` [PATCH 4/5] arm64: KVM: Fix comments of the CP handler Marc Zyngier
2016-01-28 10:30 ` Marc Zyngier [this message]
2016-02-08 15:23 ` [GIT PULL] KVM/ARM updates for 4.5-rc2 Paolo Bonzini
2016-02-08 15:31   ` Marc Zyngier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1453977038-13516-6-git-send-email-marc.zyngier@arm.com \
    --to=marc.zyngier@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).