kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] KVM: SVM: ignore type when setting segment registers
@ 2017-05-30 13:24 Gioh Kim
  2017-05-30 15:05 ` Radim Krčmář
  0 siblings, 1 reply; 3+ messages in thread
From: Gioh Kim @ 2017-05-30 13:24 UTC (permalink / raw)
  To: joro, pbonzini, rkrcmar; +Cc: x86, kvm, linux-kernel, Gioh Kim

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>
---
 arch/x86/kvm/svm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
index 183ddb2..a654372 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,
 	 * AMD's VMCB does not have an explicit unusable field, so emulate it
 	 * for cross vendor migration purposes by "not present"
 	 */
-	var->unusable = !var->present || (var->type == 0);
+	var->unusable = !var->present;
 
 	switch (seg) {
 	case VCPU_SREG_TR:
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] KVM: SVM: ignore type when setting segment registers
  2017-05-30 13:24 [PATCH] KVM: SVM: ignore type when setting segment registers Gioh Kim
@ 2017-05-30 15:05 ` Radim Krčmář
  2017-05-30 16:04   ` Paolo Bonzini
  0 siblings, 1 reply; 3+ messages in thread
From: Radim Krčmář @ 2017-05-30 15:05 UTC (permalink / raw)
  To: Gioh Kim; +Cc: joro, pbonzini, x86, kvm, linux-kernel

2017-05-30 15:24+0200, Gioh Kim:
> This patch is based on linux-next v4.12.0-rc3.

(I'd omit this.)

> Signed-off-by: Gioh Kim <gi-oh.kim@profitbricks.com>
> ---

Reviewed-by: Radim Krčmář <rkrcmar@redhat.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] KVM: SVM: ignore type when setting segment registers
  2017-05-30 15:05 ` Radim Krčmář
@ 2017-05-30 16:04   ` Paolo Bonzini
  0 siblings, 0 replies; 3+ messages in thread
From: Paolo Bonzini @ 2017-05-30 16:04 UTC (permalink / raw)
  To: Radim Krčmář, Gioh Kim; +Cc: joro, x86, kvm, linux-kernel



On 30/05/2017 17:05, Radim Krčmář wrote:
> 2017-05-30 15:24+0200, Gioh Kim:
>> This patch is based on linux-next v4.12.0-rc3.
> 
> (I'd omit this.)
> 
>> Signed-off-by: Gioh Kim <gi-oh.kim@profitbricks.com>
>> ---
> 
> Reviewed-by: Radim Krčmář <rkrcmar@redhat.com>

Queued, thanks.

Paolo

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-05-30 16:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-30 13:24 [PATCH] KVM: SVM: ignore type when setting segment registers Gioh Kim
2017-05-30 15:05 ` Radim Krčmář
2017-05-30 16:04   ` Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).