aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/x86.c
diff options
context:
space:
mode:
authorMarcelo Tosatti <mtosatti@redhat.com>2009-10-26 14:48:33 -0400
committerAvi Kivity <avi@redhat.com>2009-12-03 02:32:22 -0500
commit7c93be44a4790b0fd9dddf29c5503cf86c105304 (patch)
tree1c7b1d315b9e186b286843c30c54ca8c70f168c0 /arch/x86/kvm/x86.c
parent1655e3a3dc16e21b60d9950e201b38a9894f1bcf (diff)
KVM: VMX: move CR3/PDPTR update to vmx_set_cr3
GUEST_CR3 is updated via kvm_set_cr3 whenever CR3 is modified from outside guest context. Similarly pdptrs are updated via load_pdptrs. Let kvm_set_cr3 perform the update, removing it from the vcpu_run fast path. Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com> Acked-by: Acked-by: Sheng Yang <sheng@linux.intel.com> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm/x86.c')
-rw-r--r--arch/x86/kvm/x86.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index dbddcc2d2c97..719f31eecd3d 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -4591,8 +4591,10 @@ int kvm_arch_vcpu_ioctl_set_sregs(struct kvm_vcpu *vcpu,
4591 4591
4592 mmu_reset_needed |= vcpu->arch.cr4 != sregs->cr4; 4592 mmu_reset_needed |= vcpu->arch.cr4 != sregs->cr4;
4593 kvm_x86_ops->set_cr4(vcpu, sregs->cr4); 4593 kvm_x86_ops->set_cr4(vcpu, sregs->cr4);
4594 if (!is_long_mode(vcpu) && is_pae(vcpu)) 4594 if (!is_long_mode(vcpu) && is_pae(vcpu)) {
4595 load_pdptrs(vcpu, vcpu->arch.cr3); 4595 load_pdptrs(vcpu, vcpu->arch.cr3);
4596 mmu_reset_needed = 1;
4597 }
4596 4598
4597 if (mmu_reset_needed) 4599 if (mmu_reset_needed)
4598 kvm_mmu_reset_context(vcpu); 4600 kvm_mmu_reset_context(vcpu);