public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: "Joerg Roedel" <joerg.roedel-5C7GfCeVMHo@public.gmane.org>
To: "Avi Kivity" <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: Re: [PATCH 2/2] X86: allow access to EFER in 32bit KVM
Date: Wed, 30 Jan 2008 19:18:05 +0100	[thread overview]
Message-ID: <20080130181805.GR6960@amd.com> (raw)
In-Reply-To: <47A07788.9050604-atKUWr5tajBWk0Htik3J/w@public.gmane.org>

On Wed, Jan 30, 2008 at 03:11:36PM +0200, Avi Kivity wrote:
> Joerg Roedel wrote:
> >This patch makes the EFER register accessible on a 32bit KVM host. This is
> >necessary to boot 32 bit PAE guests under SVM.
> >
> >  
> 
> 
> > static void set_efer(struct kvm_vcpu *vcpu, u64 efer)
> > {
> > 	if (efer & EFER_RESERVED_BITS) {
> >@@ -432,12 +430,19 @@ static void set_efer(struct kvm_vcpu *vcpu, u64 efer)
> > 		return;
> > 	}
> > +#ifdef CONFIG_X86_64
> > 	if (is_paging(vcpu)
> > 	    && (vcpu->arch.shadow_efer & EFER_LME) != (efer & EFER_LME)) {
> > 		printk(KERN_DEBUG "set_efer: #GP, change LME while paging\n");
> > 		kvm_inject_gp(vcpu, 0);
> > 		return;
> > 	}
> >+#else
> >+	if (efer & EFER_LME) {
> >+		printk(KERN_DEBUG "set_efer: #GP, enable longmode on 32bit host\n");
> >+		kvm_inject_gp(vcpu, 0);
> >+	}
> >+#endif
> >  
> 
> We should, in addition, check the various EFER bits against host cpu capabilities (with cpu_has()). This 
> will ensure that any attempt to set an invalid bit will fail.  On Intel cpus that don't have EFER, there are 
> no valid bits, and if we detect that in vmx_set_efer, we can make it work on hosts that don't have EFER.

Ok, makes sense. I will update the patches.

Joerg

-- 
           |           AMD Saxony Limited Liability Company & Co. KG
 Operating |         Wilschdorfer Landstr. 101, 01109 Dresden, Germany
 System    |                  Register Court Dresden: HRA 4896
 Research  |              General Partner authorized to represent:
 Center    |             AMD Saxony LLC (Wilmington, Delaware, US)
           | General Manager of AMD Saxony LLC: Dr. Hans-R. Deppe, Thomas McCoy



-------------------------------------------------------------------------
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/

  parent reply	other threads:[~2008-01-30 18:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-30 12:47 Fix PAE guests on KVM 32 bit host Joerg Roedel
     [not found] ` <1201697269-8705-1-git-send-email-joerg.roedel-5C7GfCeVMHo@public.gmane.org>
2008-01-30 12:47   ` [PATCH 1/2] VMX: unifdef the EFER specific code Joerg Roedel
     [not found]     ` <1201697269-8705-2-git-send-email-joerg.roedel-5C7GfCeVMHo@public.gmane.org>
2008-01-30 13:05       ` Avi Kivity
2008-01-30 12:47   ` [PATCH 2/2] X86: allow access to EFER in 32bit KVM Joerg Roedel
     [not found]     ` <1201697269-8705-3-git-send-email-joerg.roedel-5C7GfCeVMHo@public.gmane.org>
2008-01-30 13:11       ` Avi Kivity
     [not found]         ` <47A07788.9050604-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2008-01-30 18:18           ` Joerg Roedel [this message]
  -- strict thread matches above, loose matches on Subject: below --
2008-01-30 12:41 Fix PAE guests on KVM 32 bit host Joerg-hiXKcy4yTwrP0Z7Jsv878P8+0UxHXcjY, Roedel <joerg.roedel
2008-01-30 12:41 ` [PATCH 1/2] VMX: unifdef the EFER specific code Joerg-hiXKcy4yTwrP0Z7Jsv878P8+0UxHXcjY, Roedel <joerg.roedel
     [not found]   ` <1201696876-8592-2-git-send-email-joerg.roedel-5C7GfCeVMHo@public.gmane.org>
2008-01-30 12:41     ` [PATCH 2/2] X86: allow access to EFER in 32bit KVM Joerg-hiXKcy4yTwrP0Z7Jsv878P8+0UxHXcjY, Roedel <joerg.roedel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080130181805.GR6960@amd.com \
    --to=joerg.roedel-5c7gfcevmho@public.gmane.org \
    --cc=avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org \
    --cc=kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox