aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/vmx.c
diff options
context:
space:
mode:
authorJoerg Roedel <joerg.roedel@amd.com>2010-09-10 11:30:57 -0400
committerAvi Kivity <avi@redhat.com>2010-10-24 04:52:41 -0400
commitff03a073e715d49b5cfeeec862649b1df2481ae0 (patch)
treefa0642550d0d1af65a4a02def7f1862410a36edc /arch/x86/kvm/vmx.c
parentd47f00a62b2e14b4a811b87bdb9ea1809693a377 (diff)
KVM: MMU: Add kvm_mmu parameter to load_pdptrs function
This function need to be able to load the pdptrs from any mmu context currently in use. So change this function to take an kvm_mmu parameter to fit these needs. As a side effect this patch also moves the cached pdptrs from vcpu_arch into the kvm_mmu struct. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm/vmx.c')
-rw-r--r--arch/x86/kvm/vmx.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index ff7a8d48fd24..1a7691a87178 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -1842,20 +1842,20 @@ static void ept_load_pdptrs(struct kvm_vcpu *vcpu)
1842 return; 1842 return;
1843 1843
1844 if (is_paging(vcpu) && is_pae(vcpu) && !is_long_mode(vcpu)) { 1844 if (is_paging(vcpu) && is_pae(vcpu) && !is_long_mode(vcpu)) {
1845 vmcs_write64(GUEST_PDPTR0, vcpu->arch.pdptrs[0]); 1845 vmcs_write64(GUEST_PDPTR0, vcpu->arch.mmu.pdptrs[0]);
1846 vmcs_write64(GUEST_PDPTR1, vcpu->arch.pdptrs[1]); 1846 vmcs_write64(GUEST_PDPTR1, vcpu->arch.mmu.pdptrs[1]);
1847 vmcs_write64(GUEST_PDPTR2, vcpu->arch.pdptrs[2]); 1847 vmcs_write64(GUEST_PDPTR2, vcpu->arch.mmu.pdptrs[2]);
1848 vmcs_write64(GUEST_PDPTR3, vcpu->arch.pdptrs[3]); 1848 vmcs_write64(GUEST_PDPTR3, vcpu->arch.mmu.pdptrs[3]);
1849 } 1849 }
1850} 1850}
1851 1851
1852static void ept_save_pdptrs(struct kvm_vcpu *vcpu) 1852static void ept_save_pdptrs(struct kvm_vcpu *vcpu)
1853{ 1853{
1854 if (is_paging(vcpu) && is_pae(vcpu) && !is_long_mode(vcpu)) { 1854 if (is_paging(vcpu) && is_pae(vcpu) && !is_long_mode(vcpu)) {
1855 vcpu->arch.pdptrs[0] = vmcs_read64(GUEST_PDPTR0); 1855 vcpu->arch.mmu.pdptrs[0] = vmcs_read64(GUEST_PDPTR0);
1856 vcpu->arch.pdptrs[1] = vmcs_read64(GUEST_PDPTR1); 1856 vcpu->arch.mmu.pdptrs[1] = vmcs_read64(GUEST_PDPTR1);
1857 vcpu->arch.pdptrs[2] = vmcs_read64(GUEST_PDPTR2); 1857 vcpu->arch.mmu.pdptrs[2] = vmcs_read64(GUEST_PDPTR2);
1858 vcpu->arch.pdptrs[3] = vmcs_read64(GUEST_PDPTR3); 1858 vcpu->arch.mmu.pdptrs[3] = vmcs_read64(GUEST_PDPTR3);
1859 } 1859 }
1860 1860
1861 __set_bit(VCPU_EXREG_PDPTR, 1861 __set_bit(VCPU_EXREG_PDPTR,