From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57621) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1abBUQ-0006Vl-6c for qemu-devel@nongnu.org; Wed, 02 Mar 2016 13:27:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1abBUL-0000fv-Ay for qemu-devel@nongnu.org; Wed, 02 Mar 2016 13:27:14 -0500 Received: from mail-qg0-x22a.google.com ([2607:f8b0:400d:c04::22a]:36221) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1abBUL-0000fr-6T for qemu-devel@nongnu.org; Wed, 02 Mar 2016 13:27:09 -0500 Received: by mail-qg0-x22a.google.com with SMTP id u110so46983173qge.3 for ; Wed, 02 Mar 2016 10:27:08 -0800 (PST) Sender: Richard Henderson References: <1456931078-21635-1-git-send-email-pbonzini@redhat.com> From: Richard Henderson Message-ID: <56D73079.6010500@twiddle.net> Date: Wed, 2 Mar 2016 10:27:05 -0800 MIME-Version: 1.0 In-Reply-To: <1456931078-21635-1-git-send-email-pbonzini@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH] target-i386: fix addr16 prefix List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , qemu-devel@nongnu.org Cc: hpoussin@reactos.org On 03/02/2016 07:04 AM, Paolo Bonzini wrote: > While ADDSEG will only be false in 16-bit mode for LEA, it can be > false even in other cases when 16-bit addresses are obtained via > the 67h prefix in 32-bit mode. In this case, gen_lea_v_seg forgets > to add a nonzero FS or GS base if CS/DS/ES/SS are all zero. This > case is pretty rare but happens when booting Windows 95/98, and > this patch fixes it. > > The bug is visible since commit d6a291498, but it was introduced > together with gen_lea_v_seg and it probably could be reproduced > with a "addr16 gs movsb" instruction as early as in commit > ca2f29f555805d07fb0b9ebfbbfc4e3656530977. > > Cc: rth@twiddle.net > Reported-by: Hervé Poussineau > Signed-off-by: Paolo Bonzini > --- > target-i386/translate.c | 14 +++++++------- > 1 file changed, 7 insertions(+), 7 deletions(-) Reviewed-by: Richard Henderson It doesn't even seem to be uncommon inside the win98 kernel, once you start looking for that addr16 gs pattern. Thanks, r~