From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HY3w5-0001my-WF for qemu-devel@nongnu.org; Sun, 01 Apr 2007 13:33:50 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HY3w4-0001mC-Gd for qemu-devel@nongnu.org; Sun, 01 Apr 2007 13:33:49 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HY3w4-0001m9-Bd for qemu-devel@nongnu.org; Sun, 01 Apr 2007 13:33:48 -0400 Received: from farad.aurel32.net ([82.232.2.251] helo=mail.aurel32.net) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1HY3t7-00018q-D6 for qemu-devel@nongnu.org; Sun, 01 Apr 2007 13:30:45 -0400 Message-ID: <460FEC40.60001@aurel32.net> Date: Sun, 01 Apr 2007 19:30:40 +0200 From: Aurelien Jarno MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH][SPARC] mem_address_not_aligned trap for unaligned PC References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Blue Swirl Cc: qemu-devel@nongnu.org Blue Swirl a écrit : >> According to the SPARCv8 and SPARCv9 manuals, the jmpl, rett and return >> instructions should generate a mem_address_not_aligned trap if either >> of the low-order two bits of the target address is nonzero. > > This is true, but in that case alignment should be enforced for loads ands > stores as well. The checks also incur a performance penalty for little > advantage. Maybe the checks should be enabled only with a compile/run-time > option. > I also have a patch for load/store, but openbios is doing a few unaligned memory accesses, so the patch can't be used until openbios is fixed. I haven't made any benchmark, but the performance penality is probably very small. If you look at softmmu_template.h, you will see that it only adds a if test, while the whole function is already a few dozen of lines long. I would really like to see the QEMU having the same behaviour as real hardware, this allow for example debugging SIGBUS problems in a program without having real hardware. -- .''`. Aurelien Jarno | GPG: 1024D/F1BCDB73 : :' : Debian developer | Electrical Engineer `. `' aurel32@debian.org | aurelien@aurel32.net `- people.debian.org/~aurel32 | www.aurel32.net