From: eric.auger@linaro.org (Eric Auger)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 3/4] KVM: arm/arm64: check power_off in critical section before VCPU run
Date: Fri, 25 Sep 2015 23:41:16 +0200 [thread overview]
Message-ID: <1443217277-13173-4-git-send-email-eric.auger@linaro.org> (raw)
In-Reply-To: <1443217277-13173-1-git-send-email-eric.auger@linaro.org>
In case a vcpu off PSCI call is called just after we executed the
vcpu_sleep check, we can enter the guest although power_off
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>
Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org>
---
v2 -> v3:
- reword commit message
---
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 9d16f76..4eb59e3 100644
--- a/arch/arm/kvm/arm.c
+++ b/arch/arm/kvm/arm.c
@@ -560,7 +560,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_timer_sync_hwstate(vcpu);
kvm_vgic_sync_hwstate(vcpu);
--
1.9.1
next prev parent reply other threads:[~2015-09-25 21:41 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-25 21:41 [PATCH v3 0/4] KVM: arm/arm64: guest synchronous halt/resume Eric Auger
2015-09-25 21:41 ` [PATCH v3 1/4] KVM: arm/arm64: rename pause into power_off Eric Auger
2015-09-25 21:41 ` [PATCH v3 2/4] KVM: arm/arm64: check power_off in kvm_arch_vcpu_runnable Eric Auger
2015-09-25 21:41 ` Eric Auger [this message]
2015-09-25 21:41 ` [PATCH v3 4/4] KVM: arm/arm64: implement kvm_arm_[halt,resume]_guest Eric Auger
2015-10-15 12:17 ` [PATCH v3 0/4] KVM: arm/arm64: guest synchronous halt/resume 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=1443217277-13173-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).