浏览代码

KVM: SVM: Set the 'busy' flag of the TR selector

The busy flag of the TR selector is not set by the hardware. This breaks
migration from amd hosts to intel hosts.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Amit Shah 16 年之前
父节点
当前提交
c0d09828c8
共有 1 个文件被更改,包括 7 次插入0 次删除
  1. 7 0
      arch/x86/kvm/svm.c

+ 7 - 0
arch/x86/kvm/svm.c

@@ -781,6 +781,13 @@ static void svm_get_segment(struct kvm_vcpu *vcpu,
 	if (seg == VCPU_SREG_CS)
 	if (seg == VCPU_SREG_CS)
 		var->g = s->limit > 0xfffff;
 		var->g = s->limit > 0xfffff;
 
 
+	/*
+	 * Work around a bug where the busy flag in the tr selector
+	 * isn't exposed
+	 */
+	if (seg == VCPU_SREG_TR)
+		var->type |= 0x2;
+
 	var->unusable = !var->present;
 	var->unusable = !var->present;
 }
 }