From: Andre Przywara Subject: [PATCH 2/2] Fix cross vendor migration issue in segment segment descriptor Date: Tue, 28 Apr 2009 12:45:43 +0200 Message-ID: <1240915543-4021-1-git-send-email-andre.przywara@amd.com> Mime-Version: 1.0 Content-Type: text/plain Cc: kvm@vger.kernel.org, Andre Przywara To: Avi Kivity Return-path: Received: from outbound-sin.frontbridge.com ([207.46.51.80]:32306 "EHLO SG2EHSOBE004.bigfish.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753879AbZD1Kov (ORCPT ); Tue, 28 Apr 2009 06:44:51 -0400 Sender: kvm-owner@vger.kernel.org List-ID: 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: Andre Przywara --- arch/x86/kvm/svm.c | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-) Avi, if possible, push this also to 2.6.30. My cross vendor migration tests do not pass without this, so if you want cross vendor migration in 2.6.30, this is a must. Regards, Andre. diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index 1580464..1227399 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c @@ -831,6 +831,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; } } -- 1.6.1.3