KVM: SVM: Add clean-bit for Segements and CPL
authorJoerg Roedel <joerg.roedel@amd.com>
Fri, 3 Dec 2010 10:45:57 +0000 (11:45 +0100)
committerAvi Kivity <avi@redhat.com>
Wed, 12 Jan 2011 09:30:34 +0000 (11:30 +0200)
This patch implements the clean-bit defined for the cs, ds,
ss, an es segemnts and the current cpl saved in the vmcb.

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
arch/x86/kvm/svm.c

index cbfb2ac8b4da40bc07f1e6d61f8ad859d4a303b8..4db7157c5dea94167220a188d87f67a276a3d67e 100644 (file)
@@ -195,6 +195,7 @@ enum {
        VMCB_CR,         /* CR0, CR3, CR4, EFER */
        VMCB_DR,         /* DR6, DR7 */
        VMCB_DT,         /* GDT, IDT */
+       VMCB_SEG,        /* CS, DS, SS, ES, CPL */
        VMCB_DIRTY_MAX,
 };
 
@@ -1457,6 +1458,7 @@ static void svm_set_segment(struct kvm_vcpu *vcpu,
                        = (svm->vmcb->save.cs.attrib
                           >> SVM_SELECTOR_DPL_SHIFT) & 3;
 
+       mark_dirty(svm->vmcb, VMCB_SEG);
 }
 
 static void update_db_intercept(struct kvm_vcpu *vcpu)