From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:33346) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ULJ2N-0002OG-GZ for qemu-devel@nongnu.org; Thu, 28 Mar 2013 16:03:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ULJ2H-0001Au-U8 for qemu-devel@nongnu.org; Thu, 28 Mar 2013 16:03:03 -0400 Received: from terminus.zytor.com ([2001:1868:205::10]:58281 helo=mail.zytor.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ULJ2H-00015V-Jw for qemu-devel@nongnu.org; Thu, 28 Mar 2013 16:02:57 -0400 Message-ID: <5154A1C9.6040307@zytor.com> Date: Thu, 28 Mar 2013 13:02:17 -0700 From: "H. Peter Anvin" MIME-Version: 1.0 References: <1362017554-1260-1-git-send-email-hpa@zytor.com> <20130328191533.GA23069@ohm.aurel32.net> In-Reply-To: <20130328191533.GA23069@ohm.aurel32.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC PATCH 1/3] target-i386: Add 486sx, old486, and old486sx CPU models List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Aurelien Jarno Cc: qemu-devel@nongnu.org On 03/28/2013 12:15 PM, Aurelien Jarno wrote: > > This really looks like Linux kernel specific. I haven't been able to > test on a real machine, but the documentation I have found suggest that > without and x87 FPU, the FPU instructions are simply ignored. The common > way to detect an FPU is therefore to initialize registers to a given > value, run fnstsw and fnstcw instructions with the register in arguments > and see if they have been modified. > > The Linux kernel indeed set the initial value of these registers to > 0xffff, but I am not sure all codes are doing the same. > > For me it looks like better to skip such instructions directly in > translate.c. As a bonus it seems easy to do that for all FPU > instructions. > At least *some* real-life CPUs returned 0xffff, at the very least the machines with external buses did (e.g. 386 without 387). I don't have access to a live 486SX so I can test if 486SX behaved differenly. -hpa