On Tue, Dec 07, 2010, Avi Kivity wrote about "Re: KVM call minutes for Nov 30":
>...
> All it requires is a 
> kvm_set_cr3() which will load the PDPTEs into the PDPTRs if PAE is 
> enabled.  You may need to order the loading of CR0, CR3, CR4, and EFER 
> to achieve the desired effect.

I did this more explicitly as:

        vmcs_writel(GUEST_CR3, get_vmcs12_fields(vcpu)->guest_cr3);
        vcpu->arch.cr3 = get_vmcs12_fields(vcpu)->guest_cr3;
        load_pdptrs(vcpu, vcpu->arch.walk_mmu, vcpu->arch.cr3);
        vmcs_write64(GUEST_PDPTR0, vcpu->arch.mmu.pdptrs[0]);
        vmcs_write64(GUEST_PDPTR1, vcpu->arch.mmu.pdptrs[1]);
        vmcs_write64(GUEST_PDPTR2, vcpu->arch.mmu.pdptrs[2]);
        vmcs_write64(GUEST_PDPTR3, vcpu->arch.mmu.pdptrs[3]);

I'm still working on trying to simplify this code - I'll indeed try to see if
I can use kvm_set_cr3 instead. Thanks for the suggestion.
However, Even if it works, I have a concern on how nested vmx might brake in
the future if kvm_set_cr3 is changed in some way that is irrelevant to nested.

Nadav.

-- 
Nadav Har'El                        |     Tuesday, Dec  7 2010, 30 Kislev 5771
n...@math.technion.ac.il             |-----------------------------------------
Phone +972-523-790466, ICQ 13349191 |We could wipe out world hunger if we knew
http://nadav.harel.org.il           |how to make AOL's Free CD's edible!
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to