diff options
author | Gioh Kim <gi-oh.kim@profitbricks.com> | 2017-05-30 09:24:45 -0400 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2017-05-30 11:17:22 -0400 |
commit | 8eae9570d1d3887487be0b355d12656b46fac226 (patch) | |
tree | 0f93aa49ad7072dca4540278688bbb420c44e708 | |
parent | cbf712792b6e61317b93dd56dd5c0784363c9ac9 (diff) |
KVM: SVM: ignore type when setting segment registers
Commit 19bca6ab75d8 ("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: Gioh Kim <gi-oh.kim@profitbricks.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r-- | arch/x86/kvm/svm.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index 183ddb235fb4..a654372efea1 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c | |||
@@ -1807,7 +1807,7 @@ static void svm_get_segment(struct kvm_vcpu *vcpu, | |||
1807 | * AMD's VMCB does not have an explicit unusable field, so emulate it | 1807 | * AMD's VMCB does not have an explicit unusable field, so emulate it |
1808 | * for cross vendor migration purposes by "not present" | 1808 | * for cross vendor migration purposes by "not present" |
1809 | */ | 1809 | */ |
1810 | var->unusable = !var->present || (var->type == 0); | 1810 | var->unusable = !var->present; |
1811 | 1811 | ||
1812 | switch (seg) { | 1812 | switch (seg) { |
1813 | case VCPU_SREG_TR: | 1813 | case VCPU_SREG_TR: |