From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NljjD-00040p-0X for qemu-devel@nongnu.org; Sun, 28 Feb 2010 09:02:39 -0500 Received: from [199.232.76.173] (port=45833 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NljjC-00040h-Me for qemu-devel@nongnu.org; Sun, 28 Feb 2010 09:02:38 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NljjB-000661-NP for qemu-devel@nongnu.org; Sun, 28 Feb 2010 09:02:38 -0500 Received: from mx20.gnu.org ([199.232.41.8]:64669) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NljjB-00065r-GK for qemu-devel@nongnu.org; Sun, 28 Feb 2010 09:02:37 -0500 Received: from mail.codesourcery.com ([38.113.113.100]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NljjA-0006rG-EL for qemu-devel@nongnu.org; Sun, 28 Feb 2010 09:02:36 -0500 From: Paul Brook Subject: Re: [Qemu-devel] [Bug] qemu-system-ppc: "invalid/unsupported opcode" during debug session Date: Sun, 28 Feb 2010 14:02:33 +0000 References: <4B3A1B9D.7010004@mail.berlios.de> <20100228131830.GJ10291@volta.aurel32.net> In-Reply-To: <20100228131830.GJ10291@volta.aurel32.net> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201002281402.34086.paul@codesourcery.com> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Aurelien Jarno > > invalid/unsupported opcode: 00 - 00 - 00 (00000000) 4800fa44 1 > > I have fixed that in HEAD by stopping the translation just after a trap, > as the instructions might never be executed. > > It is not a full fix, as the OS can actually use any instruction that > always generate a trap (even a memory access) as an instruction barrier > to make sure the following instructions are never executed. This > actually affects all targets, but is unlikely to happen. > > One solution for that would be to only generate an exception for an > unsupported instruction when it is the first instruction of a TB, and > otherwise just end the translation before this instruction. By my reading the code is correct. We end up calling gen_invalid which output code to raise an invalid instruction exception. If earlier code faults at runtime then that code is never executed, and everything is happy. The real bug is that we have debugging printfs enabled by default. Paul