Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b586eb02 authored by Andre Przywara's avatar Andre Przywara Committed by Avi Kivity
Browse files

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: default avatarAndre Przywara <andre.przywara@amd.com>
Signed-off-by: default avatarAvi Kivity <avi@redhat.com>
parent 9b5843dd
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -803,6 +803,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;
	}
}