summaryrefslogtreecommitdiffstats
path: root/drivers/kvm/x86.h
diff options
context:
space:
mode:
authorHollis Blanchard <hollisb@us.ibm.com>2007-12-03 23:15:26 +0100
committerAvi Kivity <avi@qumranet.com>2008-01-30 16:53:17 +0100
commit53e0aa7b65ec0d66e34e4d356a641c725cc2e519 (patch)
tree3964471dba10c506407370aefacdfce2cab3086f /drivers/kvm/x86.h
parentKVM: Portability: Stop including x86-specific headers in kvm_main.c (diff)
downloadlinux-53e0aa7b65ec0d66e34e4d356a641c725cc2e519.tar.xz
linux-53e0aa7b65ec0d66e34e4d356a641c725cc2e519.zip
KVM: Portability: Create kvm_arch_vcpu_runnable() function
This abstracts the detail of x86 hlt and INIT modes into a function. Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com> Acked-by: Carsten Otte <cotte@de.ibm.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to '')
-rw-r--r--drivers/kvm/x86.h7
1 files changed, 7 insertions, 0 deletions
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)
#define TSS_IOPB_SIZE (65536 / 8)
#define TSS_REDIRECTION_SIZE (256 / 8)
#define RMODE_TSS_SIZE (TSS_BASE_SIZE + TSS_REDIRECTION_SIZE + TSS_IOPB_SIZE + 1)
+
+static inline int kvm_arch_vcpu_runnable(struct kvm_vcpu *vcpu)
+{
+ return vcpu->mp_state == VCPU_MP_STATE_RUNNABLE
+ || vcpu->mp_state == VCPU_MP_STATE_SIPI_RECEIVED;
+}
+
#endif