From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: Re: [PATCH RESEND] KVM: when entering real mode align segment base to 16 bytes Date: Mon, 27 Dec 2010 16:58:43 +0200 Message-ID: <20101227145842.GO2231@redhat.com> References: <20101227130110.GK2231@redhat.com> <4D18A101.90407@redhat.com> <20101227143727.GN2231@redhat.com> <4D18A8CC.7010500@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: mtosatti@redhat.com, kvm@vger.kernel.org To: Avi Kivity Return-path: Received: from mx1.redhat.com ([209.132.183.28]:31708 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753978Ab0L0O6o (ORCPT ); Mon, 27 Dec 2010 09:58:44 -0500 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id oBREwiFX019872 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 27 Dec 2010 09:58:44 -0500 Content-Disposition: inline In-Reply-To: <4D18A8CC.7010500@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Mon, Dec 27, 2010 at 04:55:08PM +0200, Avi Kivity wrote: > On 12/27/2010 04:37 PM, Gleb Natapov wrote: > >> What's the scenario here? And what segment is involved? if it's fs > >> or gs, or maybe ss, I can see it working out, but hardly otherwise. > >> > >The scenario is older Seabios that lefts DS segment unaligned during > >switch to real mode in int1587 function (copy extended memory). > > > > Did it not use %ds then? > It restores %ds before first use. There can be other guests of course that try to use %ds in protected mode. We can distinguish one from the other. > What about switching back to protected mode? I see we do restore the > base, so it can continue to use the segment. I guess this isn't an > issue for 1587. > Correct. 1587 does not return to protected mode again. -- Gleb.