From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joerg Roedel Subject: Re: [PATCH] Fix to kvm_arch_vcpu_ioctl_set_sregs so that set_cr0 works properly Date: Thu, 7 Feb 2008 11:32:43 +0100 Message-ID: <20080207103243.GI12094@8bytes.org> References: <1DF02D2D-98D0-4695-A4A5-724A12616142@transitive.com> <20080206202142.GB6344@8bytes.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org To: Paul Knowles Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org On Thu, Feb 07, 2008 at 08:55:59AM +0000, Paul Knowles wrote: > Hi Joerg > > The problem is this block of code in set_cr0 > > #ifdef CONFIG_X86_64 > if (vcpu->arch.shadow_efer & EFER_LME) { > if (!is_paging(vcpu) && (cr0 & X86_CR0_PG)) > enter_lmode(vcpu); > if (is_paging(vcpu) && !(cr0 & X86_CR0_PG)) > exit_lmode(vcpu); > } > #endif Hmm, the stuff that is done in enter_lmode() is also done in vmx_set_efer() (except for the TSS fixup). I am still pretty sure it should work without your fix (also because it will likely break SVM with Nested Paging). Have you set EFER.LME *and* EFER.LMA when you called set_sregs? Joerg ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/