From mboxrd@z Thu Jan 1 00:00:00 1970 From: Josh Triplett Subject: [PATCH] kvm-amd: Auto-load on CPUs with SVM. Date: Wed, 28 Mar 2012 11:32:28 -0700 Message-ID: <20120328183228.GA24889@leaf> References: <20120321063350.GA3468@leaf> <4F72F549.6060407@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Marcelo Tosatti , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Kay Sievers To: Avi Kivity Return-path: Content-Disposition: inline In-Reply-To: <4F72F549.6060407@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org Enable x86 feature-based autoloading for the kvm-amd module on CPUs with X86_FEATURE_SVM. Signed-off-by: Josh Triplett --- On Wed, Mar 28, 2012 at 01:26:01PM +0200, Avi Kivity wrote: > On 03/21/2012 08:33 AM, Josh Triplett wrote: > > Enable x86 feature-based autoloading for the kvm-intel module on CPUs > > with X86_FEATURE_VMX. > > Thanks, applied. As promised, the corresponding patch for kvm-amd. arch/x86/kvm/svm.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index e385214..cd95ea7 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c @@ -22,6 +22,7 @@ #include "x86.h" #include +#include #include #include #include @@ -42,6 +43,12 @@ MODULE_AUTHOR("Qumranet"); MODULE_LICENSE("GPL"); +static const struct x86_cpu_id svm_cpu_id[] = { + X86_FEATURE_MATCH(X86_FEATURE_SVM), + {} +}; +MODULE_DEVICE_TABLE(x86cpu, svm_cpu_id); + #define IOPM_ALLOC_ORDER 2 #define MSRPM_ALLOC_ORDER 1