From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:52821) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UNlQN-00084E-K0 for qemu-devel@nongnu.org; Thu, 04 Apr 2013 10:46:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UNlQH-0000Ik-OC for qemu-devel@nongnu.org; Thu, 04 Apr 2013 10:45:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:30646) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UNlQH-0000Hj-EH for qemu-devel@nongnu.org; Thu, 04 Apr 2013 10:45:53 -0400 Message-ID: <515D9214.2000009@redhat.com> Date: Thu, 04 Apr 2013 16:45:40 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1364985128-23772-1-git-send-email-pbonzini@redhat.com> <1364985128-23772-7-git-send-email-pbonzini@redhat.com> <515D89F5.5000504@redhat.com> <515D8D9F.7080602@redhat.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 06/10] elfload: only give abi_long/ulong the alignment specified by the target List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: pmaydell@linaro.org, qemu-devel@nongnu.org, aurelien@aurel32.net Il 04/04/2013 16:37, Peter Maydell ha scritto: >> Regarding the others, none of them are in target-generic places, and >> > none of them affect m68k (ARM only uses non-standard alignment for llong): >> > >> > - linux-user/mips64/syscall.h is correct with target_ulong, and in >> > general MIPS is best left as it is (it often uses uint32_t/uint64_t or >> > target_long/ulong explicitly so that n32 is handled correctly). > Hmm, is this really right? target_ulong before this patch would > have had an explicit alignment attribute, and it no longer does. > So if you're running a mips64 guest on an m68k host then you'll > now get structs with the natural m68k alignment rather than the > desired mips64 alignment... Note that target_ulong and abi_ulong would have different sizes. Better to get alignment wrong on m68k, than size wrong on all platforms. :) Also I think this should not be a problem. These structures have no holes in them, the padding is always written down explicitly and they are accessed (or should be) via copy_from/to_user. > (I can entirely believe that we get this wrong in a lot of > places, and that in theory just about anything in a target_ > struct needs an alignment specifier.) Yes, or more simply just use abi_* types. It doesn't help that potential problems would only show up on m68k. Paolo