提交 8eae9570 编写于 作者: G Gioh Kim 提交者: Paolo Bonzini

KVM: SVM: ignore type when setting segment registers

Commit 19bca6ab ("KVM: SVM: Fix cross vendor migration issue with
unusable bit") added checking type when setting unusable.
So unusable can be set if present is 0 OR type is 0.
According to the AMD processor manual, long mode ignores the type value
in segment descriptor. And type can be 0 if it is read-only data segment.
Therefore type value is not related to unusable flag.

This patch is based on linux-next v4.12.0-rc3.
Signed-off-by: NGioh Kim <gi-oh.kim@profitbricks.com>
Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
上级 cbf71279
...@@ -1807,7 +1807,7 @@ static void svm_get_segment(struct kvm_vcpu *vcpu, ...@@ -1807,7 +1807,7 @@ static void svm_get_segment(struct kvm_vcpu *vcpu,
* AMD's VMCB does not have an explicit unusable field, so emulate it * AMD's VMCB does not have an explicit unusable field, so emulate it
* for cross vendor migration purposes by "not present" * for cross vendor migration purposes by "not present"
*/ */
var->unusable = !var->present || (var->type == 0); var->unusable = !var->present;
switch (seg) { switch (seg) {
case VCPU_SREG_TR: case VCPU_SREG_TR:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册