From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KZ9Yd-0005wi-Mx for qemu-devel@nongnu.org; Fri, 29 Aug 2008 15:22:55 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KZ9YZ-0005w2-Au for qemu-devel@nongnu.org; Fri, 29 Aug 2008 15:22:54 -0400 Received: from [199.232.76.173] (port=47794 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KZ9YZ-0005vz-6M for qemu-devel@nongnu.org; Fri, 29 Aug 2008 15:22:51 -0400 Received: from mail.codesourcery.com ([65.74.133.4]:50328) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KZ9YY-0000ef-Kl for qemu-devel@nongnu.org; Fri, 29 Aug 2008 15:22:50 -0400 From: Paul Brook Subject: Re: [Qemu-devel] [sparc64] qemu crashes after the "OpenBIOS for Sparc64" banner is printed Date: Fri, 29 Aug 2008 20:22:46 +0100 References: <48B6A035.2090105@jermar.eu> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200808292022.46951.paul@codesourcery.com> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Blue Swirl , Jakub Jermar > Surprisingly it was moving of do_interrupt to helper.c that caused the > bug. Moving it back to op_helper.c allows Sparc64 to boot. I'm still > trying to understand the real cause of the bug and to find if there is > some other way of fixing this. This kind of voodoo makes me nervous. do_interrupt calls change_pstate, which relies on global register state. Global register state is only valid when called directly from translated code or other code that includes exec.h. You should never call code in op_helper.c from outside that file (or cpu-exec.h). The easy way to enforce this is to put teh declarations for functions defined in op_helper.h in exec.h, not helper.h or cpu.h. Failure to follow this rule results in bugs like the one you've encountered. helper.h is included multiple times, so should really just contain DEF_HELPER statements. Paul