On 12/30/2010 11:09 AM, Sheng Yang wrote:
> > > if (!(cr0& X86_CR0_PG)) { > > > > /* From paging/starting to nonpaging */ > > vmcs_write32(CPU_BASED_VM_EXEC_CONTROL, > > > > @@ -1937,11 +1936,8 @@ static void ept_update_paging_mode_cr0(unsigned > > long *hw_cr0, > > > > vmcs_read32(CPU_BASED_VM_EXEC_CONTROL)& > > > > ~(CPU_BASED_CR3_LOAD_EXITING | > > > > CPU_BASED_CR3_STORE_EXITING)); > > > > - /* Must fetch cr3 before updating cr0 */ > > - cr3 = kvm_read_cr3(vcpu); > > > > vcpu->arch.cr0 = cr0; > > vmx_set_cr4(vcpu, kvm_read_cr4(vcpu)); > > > > - vmx_set_cr3(vcpu, cr3); > > This is indeed bogus. But what ensures that we'll have the correct > GUEST_CR3 after enabling paging? BTW: What did you find when you added this two lines?
Don't remember... but I can't see how it works without them (though they're wrong - they set the wrong cr3 when !enable_ept).
I'll do some work to disentangle this mess. ->set_cr3() means two different things, sometimes it's the guest visible cr3, sometimes it's the mmu cr3.
-- error compiling committee.c: too many arguments to function -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html