From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Tosatti Subject: Re: [PATCH] KVM: VMX: Fix host userspace gsbase corruption Date: Tue, 16 Nov 2010 18:07:35 -0200 Message-ID: <20101116200735.GA23712@amt.cnet> References: <1289471846-2055-1-git-send-email-avi@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org To: Avi Kivity Return-path: Received: from mx1.redhat.com ([209.132.183.28]:1551 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755717Ab0KPU27 (ORCPT ); Tue, 16 Nov 2010 15:28:59 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id oAGKSwpH030864 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 16 Nov 2010 15:28:58 -0500 Content-Disposition: inline In-Reply-To: <1289471846-2055-1-git-send-email-avi@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Thu, Nov 11, 2010 at 12:37:26PM +0200, Avi Kivity wrote: > We now use load_gs_index() to load gs safely; unfortunately this also > changes MSR_KERNEL_GS_BASE, which we managed separately. This resulted > in confusion and breakage running 32-bit host userspace on a 64-bit kernel. > > Fix by > - saving guest MSR_KERNEL_GS_BASE before we we reload the host's gs > - doing the host save/load unconditionally, instead of only when in guest > long mode > > Things can be cleaned up further, but this is the minmal fix for now. > > Signed-off-by: Avi Kivity > --- > arch/x86/kvm/vmx.c | 15 +++++++-------- > 1 files changed, 7 insertions(+), 8 deletions(-) Applied, thanks.