From patchwork Mon May 29 10:14:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Richard W.M. Jones" X-Patchwork-Id: 9753067 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E9E02602B1 for ; Mon, 29 May 2017 10:15:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D8FFB28477 for ; Mon, 29 May 2017 10:15:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CBA872847B; Mon, 29 May 2017 10:15:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 32FE028477 for ; Mon, 29 May 2017 10:15:15 +0000 (UTC) Received: from localhost ([::1]:47929 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dFHhi-0000KR-Er for patchwork-qemu-devel@patchwork.kernel.org; Mon, 29 May 2017 06:15:14 -0400 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 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 055FAC05681A; Mon, 29 May 2017 10:14:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 055FAC05681A Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=rjones@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 055FAC05681A Received: from localhost (unknown [10.36.118.65]) by smtp.corp.redhat.com (Postfix) with ESMTP id 94260179E3; Mon, 29 May 2017 10:14:14 +0000 (UTC) Date: Mon, 29 May 2017 11:14:13 +0100 From: "Richard W.M. Jones" To: Thomas Huth Message-ID: <20170529101413.GN16511@redhat.com> References: <1c8f4f4e-65f7-2d12-a391-08781fea651c@landley.net> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-12-10) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Mon, 29 May 2017 10:14:17 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: Re: [Qemu-devel] Commit b2a575a1c652 broke i486 support. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , Marc =?iso-8859-1?Q?Mar=ED?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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. Rich. --- 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