From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joerg Roedel Subject: Re: [PATCH 8/8] SVM: add support for Nested Paging Date: Sun, 27 Jan 2008 10:41:47 +0100 Message-ID: <20080127094147.GA32677@8bytes.org> References: <1201294393-22613-1-git-send-email-joerg.roedel@amd.com> <1201294393-22613-9-git-send-email-joerg.roedel@amd.com> <479C464E.2060009@qumranet.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Avi Kivity Return-path: Content-Disposition: inline In-Reply-To: <479C464E.2060009-atKUWr5tajBWk0Htik3J/w@public.gmane.org> 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 Sun, Jan 27, 2008 at 10:52:30AM +0200, Avi Kivity wrote: > Joerg Roedel wrote: > > This patch contains the SVM architecture dependent changes for KVM to enable > > support for the Nested Paging feature of AMD Barcelona and Phenom processors. > > > > +#ifdef CONFIG_X86_64 > > +static bool npt_enabled = true; > > +#else > > static bool npt_enabled = false; > > +#endif > > > > I think that i386 + pae can also support npt, with no changes, no? > > So we should check CONFIG_X86_PAE, not X86_64. Yes, I think that too. But its completly untested so I disabled it for the first post of this patchset. > > + > > + if (npt_enabled) { > > + /* Setup VMCB for Nested Paging */ > > + control->nested_ctl = 1; > > + control->intercept_exceptions &= ~(1 << PF_VECTOR); > > + control->intercept_cr_read &= ~(INTERCEPT_CR0_MASK| > > + INTERCEPT_CR3_MASK| > > + INTERCEPT_CR4_MASK); > > + control->intercept_cr_write &= ~(INTERCEPT_CR0_MASK| > > + INTERCEPT_CR3_MASK| > > + INTERCEPT_CR4_MASK); > > > > What happens to lazy fpu if we don't trap cr0 changes? > > Perhaps it's worth disabling lazy fpu with npt. It should be implicitly disabled with npt because accesses to cr3 are not intercepted anymore. The svm_set_cr3 function is the only place which disables fpu switching. ------------------------------------------------------------------------- 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/