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

and

static inline int is_paging(struct kvm_vcpu *vcpu)
{
   return vcpu->arch.cr0 & X86_CR0_PG;
}

If we set vcpu->arch.cr0 = cr0 before calling it then the 2 if  
statements can never be true and we will never call enter_lmode or  
exit_lmode.

Paul

On 6 Feb 2008, at 20:21, Joerg Roedel wrote:

> On Wed, Feb 06, 2008 at 11:02:35AM +0000, Paul Knowles wrote:
>>      mmu_reset_needed |= vcpu->arch.cr0 != sregs->cr0;
>> -    vcpu->arch.cr0 = sregs->cr0;
>>      kvm_x86_ops->set_cr0(vcpu, sregs->cr0);
>
> Why should this fix anything? The vcpu->arch.cr0 is also set in
> kvm_x86_ops->set_cr0() aka vmx_set_cr0() and its not touched on the  
> path
> to it?
> Btw, I think its very likely that you set an invalid guest state with
> your set_sregs ioctl (e.g. an impossible hardware register state).
> Starting a guest in PAE mode is basically working because otherwise  
> live
> migration of PAE guests won't work.
>
> 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/
> _______________________________________________
> kvm-devel mailing list
> kvm-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/kvm-devel


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

Reply via email to