From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anthony Liguori Subject: Re: [PATCH 9/9] Allow setting the SVME bit v5 Date: Thu, 30 Oct 2008 15:52:56 -0500 Message-ID: <490A1EA8.6050905@codemonkey.ws> References: <1224522290-11740-1-git-send-email-agraf@suse.de> <1224522290-11740-2-git-send-email-agraf@suse.de> <1224522290-11740-3-git-send-email-agraf@suse.de> <1224522290-11740-4-git-send-email-agraf@suse.de> <1224522290-11740-5-git-send-email-agraf@suse.de> <1224522290-11740-6-git-send-email-agraf@suse.de> <1224522290-11740-7-git-send-email-agraf@suse.de> <1224522290-11740-8-git-send-email-agraf@suse.de> <1224522290-11740-9-git-send-email-agraf@suse.de> <1224522290-11740-10-git-send-email-agraf@suse.de> <490A0822.4030607@codemonkey.ws> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org, joro@8bytes.org, avi@redhat.com To: Alexander Graf Return-path: Received: from yw-out-2324.google.com ([74.125.46.29]:45652 "EHLO yw-out-2324.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753727AbYJ3UxI (ORCPT ); Thu, 30 Oct 2008 16:53:08 -0400 Received: by yw-out-2324.google.com with SMTP id 9so362496ywe.1 for ; Thu, 30 Oct 2008 13:53:07 -0700 (PDT) In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: Alexander Graf wrote: > > On 30.10.2008, at 20:16, Anthony Liguori wrote: >> >> Instead of doing this as a module parameter, we could either avoid >> advertising SVM support in cpuid from userspace or we could disable >> SVM in the BIOS. >> >> I really like the later approach because it gives a better error >> message within the guest. We could also keep the module parameter >> but it would be nice to support disabling SVM in userspace too. > > That's a really good idea. We'd only have to check the MSR value on > EFER set, to know if setting SVME is allowed. That would allow for a > really easy control over the SVM feature on a per-guest basis and from > userspace. And with Gleb's BIOS configuration changes that are now upstream, it's really easy to communicate to the BIOS whether SVM should be enabled. Regards, Anthony LIguori > Cool, > > Alex > >> Regards, >> >> Anthony Liguori >> >>> static void kvm_reput_irq(struct vcpu_svm *svm); >>> static void svm_flush_tlb(struct kvm_vcpu *vcpu); >>> @@ -457,6 +460,9 @@ static __init int svm_hardware_setup(void) >>> if (boot_cpu_has(X86_FEATURE_NX)) >>> kvm_enable_efer_bits(EFER_NX); >>> + if (nested) >>> + kvm_enable_efer_bits(MSR_EFER_SVME_MASK); >>> + >>> for_each_online_cpu(cpu) { >>> r = svm_cpu_init(cpu); >>> if (r) >>> >> >