]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
KVM: SVM: Fix cross vendor migration issue in segment segment descriptor
authorAndre Przywara <andre.przywara@amd.com>
Tue, 28 Apr 2009 10:45:43 +0000 (12:45 +0200)
committerAvi Kivity <avi@redhat.com>
Tue, 5 May 2009 18:35:44 +0000 (21:35 +0300)
On AMD CPUs sometimes the DB bit in the stack segment
descriptor is left as 1, although the whole segment has
been made unusable. Clear it here to pass an Intel VMX
entry check when cross vendor migrating.

Signed-off-by: Andre Przywara <andre.przywara@amd.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
arch/x86/kvm/svm.c

index 1647e81696aad8d91f97816db6dec938b4a569c8..61453e6becbd238355748c1c45945e0e0ee542a1 100644 (file)
@@ -804,6 +804,15 @@ static void svm_get_segment(struct kvm_vcpu *vcpu,
                if (!var->unusable)
                        var->type |= 0x1;
                break;
+       case VCPU_SREG_SS:
+               /* On AMD CPUs sometimes the DB bit in the segment
+                * descriptor is left as 1, although the whole segment has
+                * been made unusable. Clear it here to pass an Intel VMX
+                * entry check when cross vendor migrating.
+                */
+               if (var->unusable)
+                       var->db = 0;
+               break;
        }
 }