All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kvm-intel: Auto-load on CPUs with VMX.
@ 2012-03-21  6:33 Josh Triplett
  2012-03-21 13:41 ` Avi Kivity
  2012-03-28 11:26 ` Avi Kivity
  0 siblings, 2 replies; 8+ messages in thread
From: Josh Triplett @ 2012-03-21  6:33 UTC (permalink / raw)
  To: Avi Kivity, Marcelo Tosatti, Thomas Gleixner, Ingo Molnar,
	H. Peter Anvin, x86, kvm, linux-kernel

Enable x86 feature-based autoloading for the kvm-intel module on CPUs
with X86_FEATURE_VMX.

Signed-off-by: Josh Triplett <josh@joshtriplett.org>
---

I've tested this and it works correctly.  I can also supply the obvious
equivalent patch for kvm-amd on AMD CPUs with SVM, but I don't have any
such CPUs to test that on.

 arch/x86/kvm/vmx.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 3b4c8d8..bb3bcff 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -27,6 +27,7 @@
 #include <linux/highmem.h>
 #include <linux/sched.h>
 #include <linux/moduleparam.h>
+#include <linux/mod_devicetable.h>
 #include <linux/ftrace_event.h>
 #include <linux/slab.h>
 #include <linux/tboot.h>
@@ -51,6 +52,12 @@
 MODULE_AUTHOR("Qumranet");
 MODULE_LICENSE("GPL");
 
+static const struct x86_cpu_id vmx_cpu_id[] = {
+	X86_FEATURE_MATCH(X86_FEATURE_VMX),
+	{}
+};
+MODULE_DEVICE_TABLE(x86cpu, vmx_cpu_id);
+
 static bool __read_mostly enable_vpid = 1;
 module_param_named(vpid, enable_vpid, bool, 0444);
 
-- 
1.7.9.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2012-04-12  4:09 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-21  6:33 [PATCH] kvm-intel: Auto-load on CPUs with VMX Josh Triplett
2012-03-21 13:41 ` Avi Kivity
2012-03-27 12:25   ` Kay Sievers
2012-03-28 11:26 ` Avi Kivity
2012-03-28 18:32   ` [PATCH] kvm-amd: Auto-load on CPUs with SVM Josh Triplett
2012-03-29  6:33     ` Michael Tokarev
2012-03-29  7:03       ` Josh Triplett
2012-04-12  1:15     ` Marcelo Tosatti

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.