summaryrefslogtreecommitdiffstats
path: root/drivers/kvm/x86.c
diff options
context:
space:
mode:
authorZhang Xiantao2007-12-14 02:35:10 +0100
committerAvi Kivity2008-01-30 16:58:09 +0100
commit1d737c8a68736db36e0aa502ace9da240704c5ae (patch)
treefb3bd80ccd7d0068563791d1ef0db24f035f71f8 /drivers/kvm/x86.c
parentKVM: Portability: Introduce kvm_vcpu_arch (diff)
downloadkernel-qcow2-linux-1d737c8a68736db36e0aa502ace9da240704c5ae.tar.gz
kernel-qcow2-linux-1d737c8a68736db36e0aa502ace9da240704c5ae.tar.xz
kernel-qcow2-linux-1d737c8a68736db36e0aa502ace9da240704c5ae.zip
KVM: Portability: Split mmu-related static inline functions to mmu.h
Since these functions need to know the details of kvm or kvm_vcpu structure, it can't be put in x86.h. Create mmu.h to hold them. Signed-off-by: Zhang Xiantao <xiantao.zhang@intel.com> Acked-by: Carsten Otte <cotte@de.ibm.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'drivers/kvm/x86.c')
-rw-r--r--drivers/kvm/x86.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/kvm/x86.c b/drivers/kvm/x86.c
index 5a2f33a84e4f..60f9722a06ba 100644
--- a/drivers/kvm/x86.c
+++ b/drivers/kvm/x86.c
@@ -19,6 +19,7 @@
#include "x86_emulate.h"
#include "segment_descriptor.h"
#include "irq.h"
+#include "mmu.h"
#include <linux/kvm.h>
#include <linux/fs.h>
@@ -3139,3 +3140,9 @@ int kvm_arch_set_memory_region(struct kvm *kvm,
return 0;
}
+
+int kvm_arch_vcpu_runnable(struct kvm_vcpu *vcpu)
+{
+ return vcpu->arch.mp_state == VCPU_MP_STATE_RUNNABLE
+ || vcpu->arch.mp_state == VCPU_MP_STATE_SIPI_RECEIVED;
+}