diff options
-rw-r--r-- | drivers/kvm/kvm_main.c | 3 | ||||
-rw-r--r-- | drivers/kvm/x86.h | 7 |
2 files changed, 8 insertions, 2 deletions
diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c index 0f11046b94fa..70664f020849 100644 --- a/drivers/kvm/kvm_main.c +++ b/drivers/kvm/kvm_main.c | |||
@@ -643,8 +643,7 @@ void kvm_vcpu_block(struct kvm_vcpu *vcpu) | |||
643 | */ | 643 | */ |
644 | while (!kvm_cpu_has_interrupt(vcpu) | 644 | while (!kvm_cpu_has_interrupt(vcpu) |
645 | && !signal_pending(current) | 645 | && !signal_pending(current) |
646 | && vcpu->mp_state != VCPU_MP_STATE_RUNNABLE | 646 | && !kvm_arch_vcpu_runnable(vcpu)) { |
647 | && vcpu->mp_state != VCPU_MP_STATE_SIPI_RECEIVED) { | ||
648 | set_current_state(TASK_INTERRUPTIBLE); | 647 | set_current_state(TASK_INTERRUPTIBLE); |
649 | vcpu_put(vcpu); | 648 | vcpu_put(vcpu); |
650 | schedule(); | 649 | schedule(); |
diff --git a/drivers/kvm/x86.h b/drivers/kvm/x86.h index 4b7acc76bb34..eed796402e3b 100644 --- a/drivers/kvm/x86.h +++ b/drivers/kvm/x86.h | |||
@@ -471,4 +471,11 @@ static inline u32 get_rdx_init_val(void) | |||
471 | #define TSS_IOPB_SIZE (65536 / 8) | 471 | #define TSS_IOPB_SIZE (65536 / 8) |
472 | #define TSS_REDIRECTION_SIZE (256 / 8) | 472 | #define TSS_REDIRECTION_SIZE (256 / 8) |
473 | #define RMODE_TSS_SIZE (TSS_BASE_SIZE + TSS_REDIRECTION_SIZE + TSS_IOPB_SIZE + 1) | 473 | #define RMODE_TSS_SIZE (TSS_BASE_SIZE + TSS_REDIRECTION_SIZE + TSS_IOPB_SIZE + 1) |
474 | |||
475 | static inline int kvm_arch_vcpu_runnable(struct kvm_vcpu *vcpu) | ||
476 | { | ||
477 | return vcpu->mp_state == VCPU_MP_STATE_RUNNABLE | ||
478 | || vcpu->mp_state == VCPU_MP_STATE_SIPI_RECEIVED; | ||
479 | } | ||
480 | |||
474 | #endif | 481 | #endif |