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/ _______________________________________________ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel