aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndre Przywara <andre.przywara@amd.com>2009-04-28 06:45:43 -0400
committerAvi Kivity <avi@redhat.com>2009-06-10 04:48:51 -0400
commitb586eb0253083795e58dcbe76665410d4676dc08 (patch)
tree7582e2f8df4828ff7de15ed68f379d75ed0bd08d
parent9b5843ddd20557b77c73ddbcc814a8c816bf3d3a (diff)
KVM: SVM: Fix cross vendor migration issue in segment segment descriptor
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>
-rw-r--r--arch/x86/kvm/svm.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
index 63503782935d..e3ea98290f9b 100644
--- a/arch/x86/kvm/svm.c
+++ b/arch/x86/kvm/svm.c
@@ -803,6 +803,15 @@ static void svm_get_segment(struct kvm_vcpu *vcpu,
803 if (!var->unusable) 803 if (!var->unusable)
804 var->type |= 0x1; 804 var->type |= 0x1;
805 break; 805 break;
806 case VCPU_SREG_SS:
807 /* On AMD CPUs sometimes the DB bit in the segment
808 * descriptor is left as 1, although the whole segment has
809 * been made unusable. Clear it here to pass an Intel VMX
810 * entry check when cross vendor migrating.
811 */
812 if (var->unusable)
813 var->db = 0;
814 break;
806 } 815 }
807} 816}
808 817