From: eric.auger@linaro.org (Eric Auger)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 3/4] KVM: arm/arm64: check power_off in critical section before VCPU run
Date: Fri, 7 Aug 2015 18:08:32 +0200 [thread overview]
Message-ID: <1438963713-10460-4-git-send-email-eric.auger@linaro.org> (raw)
In-Reply-To: <1438963713-10460-1-git-send-email-eric.auger@linaro.org>
In case KVM_SET_MP_STATE ioctl is called just after we executed the
vcpu_sleep check, we can enter the guest although KVM_MP_STATE_STOPPED
is set. Let's check the power_off state in the critical section,
just before entering the guest.
Signed-off-by: Eric Auger <eric.auger@linaro.org>
Reported-by: Christoffer Dall <christoffer.dall@linaro.org>
---
arch/arm/kvm/arm.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c
index 4f50be3..cc404a8 100644
--- a/arch/arm/kvm/arm.c
+++ b/arch/arm/kvm/arm.c
@@ -555,7 +555,8 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *run)
run->exit_reason = KVM_EXIT_INTR;
}
- if (ret <= 0 || need_new_vmid_gen(vcpu->kvm)) {
+ if (ret <= 0 || need_new_vmid_gen(vcpu->kvm) ||
+ vcpu->arch.power_off) {
local_irq_enable();
kvm_vgic_sync_hwstate(vcpu);
preempt_enable();
--
1.9.1
next prev parent reply other threads:[~2015-08-07 16:08 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-07 16:08 [PATCH v2 0/4] KVM: arm/arm64: guest synchronous halt/resume Eric Auger
2015-08-07 16:08 ` [PATCH v2 1/4] KVM: arm/arm64: rename pause into power_off Eric Auger
2015-08-07 16:08 ` [PATCH v2 2/4] KVM: arm/arm64: check power_off in kvm_arch_vcpu_runnable Eric Auger
2015-08-07 16:08 ` Eric Auger [this message]
2015-08-31 10:12 ` [PATCH v2 3/4] KVM: arm/arm64: check power_off in critical section before VCPU run Christoffer Dall
2015-08-07 16:08 ` [PATCH v2 4/4] KVM: arm/arm64: implement kvm_arm_[halt,resume]_guest Eric Auger
2015-08-31 10:43 ` Christoffer Dall
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=1438963713-10460-4-git-send-email-eric.auger@linaro.org \
--to=eric.auger@linaro.org \
--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).