From: "Jan Beulich" Subject: Re: [PATCH] xen: Try to work around a BIOS that disables SVM but does not lock it Date: Thu, 08 Mar 2012 10:19:41 +0000 Message-ID: <4F5895CD0200007800077166@nat28.tlf.novell.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: george.dunlap@eu.citrix.com Cc: xen-devel List-Id: xen-devel@lists.xenproject.org >>> On 07.03.12 at 18:59, George Dunlap wrote: > --- a/xen/arch/x86/hvm/svm/svm.c > +++ b/xen/arch/x86/hvm/svm/svm.c > @@ -1145,7 +1145,18 @@ static int svm_cpu_up(void) > rdmsrl(MSR_K8_VM_CR, msr_content); > if ( msr_content & K8_VMCR_SVME_DISABLE ) > { > - printk("CPU%d: AMD SVM Extension is disabled in BIOS.\n", cpu); > + /* Try to re-enable it if we're allowed */ > + if ( !(msr_content & K8_VMCR_SVME_LOCK) ) > + { > + msr_content &= ~K8_VMCR_SVME_DISABLE; > + wrmsrl(MSR_K8_VM_CR, msr_content); > + rdmsrl(MSR_K8_VM_CR, msr_content); > + } > + if ( msr_content & K8_VMCR_SVME_DISABLE ) > + { > + printk("AMD SVM Extension is disabled in BIOS.\n"); > + return 0; Returning success when you weren't able to enable SVM? > + } > return -EINVAL; And failure when it worked? > } > Also, shouldn't overriding of a BIOS setting be gated by a default-off command line option? Jan