diff options
author | Jan H. Schönherr <jschoenh@amazon.de> | 2017-09-05 18:27:19 -0400 |
---|---|---|
committer | Radim Krčmář <rkrcmar@redhat.com> | 2017-09-13 10:40:23 -0400 |
commit | a05950009f50ca971a1d616655d01628177bd2e3 (patch) | |
tree | 011af08d77e91bafc4f933ddc7a56ae730504fe7 | |
parent | 49a8afca386ee1775519a4aa80f8e121bd227dd4 (diff) |
KVM: x86: Fix handling of pending signal on uninitialized AP
KVM API says that KVM_RUN will return with -EINTR when a signal is
pending. However, if a vCPU is in KVM_MP_STATE_UNINITIALIZED, then
the return value is unconditionally -EAGAIN.
Copy over some code from vcpu_run(), so that the case of a pending
signal results in the expected return value.
Signed-off-by: Jan H. Schönherr <jschoenh@amazon.de>
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
-rw-r--r-- | arch/x86/kvm/x86.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 6069af86da3b..b27f7f0020e3 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c | |||
@@ -7235,6 +7235,11 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) | |||
7235 | kvm_apic_accept_events(vcpu); | 7235 | kvm_apic_accept_events(vcpu); |
7236 | kvm_clear_request(KVM_REQ_UNHALT, vcpu); | 7236 | kvm_clear_request(KVM_REQ_UNHALT, vcpu); |
7237 | r = -EAGAIN; | 7237 | r = -EAGAIN; |
7238 | if (signal_pending(current)) { | ||
7239 | r = -EINTR; | ||
7240 | vcpu->run->exit_reason = KVM_EXIT_INTR; | ||
7241 | ++vcpu->stat.signal_exits; | ||
7242 | } | ||
7238 | goto out; | 7243 | goto out; |
7239 | } | 7244 | } |
7240 | 7245 | ||