From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51402) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dFHgq-0000In-5o for qemu-devel@nongnu.org; Mon, 29 May 2017 06:14:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dFHgo-00029h-U6 for qemu-devel@nongnu.org; Mon, 29 May 2017 06:14:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49988) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dFHgo-00029M-OD for qemu-devel@nongnu.org; Mon, 29 May 2017 06:14:18 -0400 Date: Mon, 29 May 2017 11:14:13 +0100 From: "Richard W.M. Jones" Message-ID: <20170529101413.GN16511@redhat.com> References: <1c8f4f4e-65f7-2d12-a391-08781fea651c@landley.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] Commit b2a575a1c652 broke i486 support. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Thomas Huth Cc: Rob Landley , qemu-devel@nongnu.org, Marc =?iso-8859-1?Q?Mar=ED?= , Paolo Bonzini On Mon, May 29, 2017 at 11:22:14AM +0200, Thomas Huth wrote: > On 28.05.2017 07:18, Rob Landley wrote: > > You can't boot a kernel under -cpu 486 since that commit (hangs > > producing no output) because it added a bios image that won't run on > > anything short of pentium II. > > > > You can try the run-emulator.sh script in > > http://landley.net/aboriginal/downloads/binaries/system-image-i486.tar.gz > > before and after that commit to check for yourself. > > Hi Rob, > > thanks for the bug report ... but to make sure that your mail does not > get lost in the high traffic of the qemu-devel mailing list, it might be > a good idea to CC: the people from that commit b2a575a1c652 in this case > (which I've done now). I see in the disassembly use of cmovne (new in Pentium Pro) and bswap (new in 486). [http://cse.unl.edu/~goddard/Courses/CSCE351/IntelArchitecture/InstructionSetSummary.pdf] The cmovne instruction is generated by the compiler (GCC in my case), The following patch removes the cmovne instruction, so it should work on 486 (although I didn't test it). It's not possible to remove bswap without surgery on the inline assembler. --- a/pc-bios/optionrom/Makefile +++ b/pc-bios/optionrom/Makefile @@ -13,6 +13,7 @@ $(call set-vpath, $(SRC_PATH)/pc-bios/optionrom) ifeq ($(lastword $(filter -O%, -O0 $(CFLAGS))),-O0) override CFLAGS += -O2 endif +override CFLAGS += -march=i386 # Drop -fstack-protector and the like QEMU_CFLAGS := $(filter -W%, $(QEMU_CFLAGS)) $(CFLAGS_NOPIE) -ffreestanding Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-builder quickly builds VMs from scratch http://libguestfs.org/virt-builder.1.html