aboutsummaryrefslogtreecommitdiff
path: root/drivers/kvm/x86.c
diff options
context:
space:
mode:
authorZhang Xiantao <xiantao.zhang@intel.com>2007-11-15 23:07:47 +0800
committerAvi Kivity <avi@qumranet.com>2008-01-30 17:53:03 +0200
commit018d00d2fef27fc65f2917bec8f72b93615c18e1 (patch)
treef2591e8da457287195e138a62e2d34a8bdfbe14c /drivers/kvm/x86.c
parenta7e6c88a78b7c3d67491bf90b2b95e66437dbdb6 (diff)
KVM: Portability: move KVM_CHECK_EXTENSION
Make KVM_CHECK_EXTENSION code into a function, all archs can define its capability independently. 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.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/kvm/x86.c b/drivers/kvm/x86.c
index bbfa810bf8b..609792637fb 100644
--- a/drivers/kvm/x86.c
+++ b/drivers/kvm/x86.c
@@ -599,6 +599,26 @@ void decache_vcpus_on_cpu(int cpu)
spin_unlock(&kvm_lock);
}
+int kvm_dev_ioctl_check_extension(long ext)
+{
+ int r;
+
+ switch (ext) {
+ case KVM_CAP_IRQCHIP:
+ case KVM_CAP_HLT:
+ case KVM_CAP_MMU_SHADOW_CACHE_CONTROL:
+ case KVM_CAP_USER_MEMORY:
+ case KVM_CAP_SET_TSS_ADDR:
+ r = 1;
+ break;
+ default:
+ r = 0;
+ break;
+ }
+ return r;
+
+}
+
long kvm_arch_dev_ioctl(struct file *filp,
unsigned int ioctl, unsigned long arg)
{