aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/svm.c
diff options
context:
space:
mode:
authorJoerg Roedel <joerg.roedel@amd.com>2010-12-03 05:45:53 -0500
committerAvi Kivity <avi@redhat.com>2011-01-12 04:30:29 -0500
commitb2747166dc315b31281fb659a5b8938873d5f1d7 (patch)
tree821bf8d2b1fb1acb3a3254e0e3866522a6d171ae /arch/x86/kvm/svm.c
parentdecdbf6a4c4f5cf14343946031aff24ff815c909 (diff)
KVM: SVM: Add clean-bit for NPT state
This patch implements the clean-bit for all nested paging related state in the vmcb. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm/svm.c')
-rw-r--r--arch/x86/kvm/svm.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
index 748569ef8505..5038201d6f3d 100644
--- a/arch/x86/kvm/svm.c
+++ b/arch/x86/kvm/svm.c
@@ -191,6 +191,7 @@ enum {
191 VMCB_PERM_MAP, /* IOPM Base and MSRPM Base */ 191 VMCB_PERM_MAP, /* IOPM Base and MSRPM Base */
192 VMCB_ASID, /* ASID */ 192 VMCB_ASID, /* ASID */
193 VMCB_INTR, /* int_ctl, int_vector */ 193 VMCB_INTR, /* int_ctl, int_vector */
194 VMCB_NPT, /* npt_en, nCR3, gPAT */
194 VMCB_DIRTY_MAX, 195 VMCB_DIRTY_MAX,
195}; 196};
196 197
@@ -1749,6 +1750,7 @@ static void nested_svm_set_tdp_cr3(struct kvm_vcpu *vcpu,
1749 struct vcpu_svm *svm = to_svm(vcpu); 1750 struct vcpu_svm *svm = to_svm(vcpu);
1750 1751
1751 svm->vmcb->control.nested_cr3 = root; 1752 svm->vmcb->control.nested_cr3 = root;
1753 mark_dirty(svm->vmcb, VMCB_NPT);
1752 force_new_asid(vcpu); 1754 force_new_asid(vcpu);
1753} 1755}
1754 1756
@@ -3555,6 +3557,7 @@ static void set_tdp_cr3(struct kvm_vcpu *vcpu, unsigned long root)
3555 struct vcpu_svm *svm = to_svm(vcpu); 3557 struct vcpu_svm *svm = to_svm(vcpu);
3556 3558
3557 svm->vmcb->control.nested_cr3 = root; 3559 svm->vmcb->control.nested_cr3 = root;
3560 mark_dirty(svm->vmcb, VMCB_NPT);
3558 3561
3559 /* Also sync guest cr3 here in case we live migrate */ 3562 /* Also sync guest cr3 here in case we live migrate */
3560 svm->vmcb->save.cr3 = vcpu->arch.cr3; 3563 svm->vmcb->save.cr3 = vcpu->arch.cr3;