From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:35843) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QOF10-0005ga-EB for qemu-devel@nongnu.org; Sun, 22 May 2011 16:12:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QOF0z-0007aq-CB for qemu-devel@nongnu.org; Sun, 22 May 2011 16:12:42 -0400 Received: from mail-ew0-f45.google.com ([209.85.215.45]:51680) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QOF0z-0007ae-56 for qemu-devel@nongnu.org; Sun, 22 May 2011 16:12:41 -0400 Received: by ewy24 with SMTP id 24so1998159ewy.4 for ; Sun, 22 May 2011 13:12:40 -0700 (PDT) From: Max Filippov Date: Mon, 23 May 2011 00:12:34 +0400 References: <1305671572-5899-1-git-send-email-jcmvbkbc@gmail.com> <201105221610.17663.jcmvbkbc@gmail.com> <4DD9406F.9030407@twiddle.net> In-Reply-To: <4DD9406F.9030407@twiddle.net> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201105230012.35944.jcmvbkbc@gmail.com> Subject: Re: [Qemu-devel] [PATCH 21/26] target-xtensa: implement unaligned exception option List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson Cc: qemu-devel@nongnu.org > > There are three alignment possibilities for xtensa: no unaligned > > exception, unaligned exception and hardware alignment. In the first > > case unaligned access silently goes to aligned address. It looks like > > it cannot be done via do_unaligned_access, can it? In the third case > > most unaligned accesses are handled transparently by the hardware. > > But e.g. unaligned access by multiprocessor synchronization > > instructions still cause alignment exception. Do I need to implement > > a different alignment checking mechanism for those unhandled cases? > > Case (1), silently going to an aligned address, should be handled > inside the translator by masking the address before the load. See > the ARM and Alpha targets for examples. This is what gen_load_store_alignment does. > Case (2) and (3) are both handled by using ALIGNED_ONLY. All you > need to do to handle (3) is *not* throw an exception from the > do_unaligned_access function. See how the code is structured > inside softmmu_template.h. > > As for sync insns... You may need to handle it all out-of-line > and check for alignment there. This is also done by gen_load_store_alignment. Does it really worth copying part of this logic to do_unaligned_access just to use ALIGNED_ONLY framework? Thanks. -- Max