diff options
author | Eric Auger <eric.auger@linaro.org> | 2015-09-25 23:41:16 +0200 |
---|---|---|
committer | Christoffer Dall <christoffer.dall@linaro.org> | 2015-10-22 23:01:46 +0200 |
commit | 101d3da09c953b08c814cd9a0b8605623d640ba0 (patch) | |
tree | 3a2ef254199675f339f4004c4d15b222851f3264 /arch/arm/kvm | |
parent | 4f5f1dc03606e18986b874f899cf86b0a3e4f2a5 (diff) | |
download | op-kernel-dev-101d3da09c953b08c814cd9a0b8605623d640ba0.zip op-kernel-dev-101d3da09c953b08c814cd9a0b8605623d640ba0.tar.gz |
KVM: arm/arm64: check power_off in critical section before VCPU run
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>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
Diffstat (limited to 'arch/arm/kvm')
-rw-r--r-- | arch/arm/kvm/arm.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c index d04deeb..3b3384c 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); |