From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:59407) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SrXqi-0006rK-HN for qemu-devel@nongnu.org; Wed, 18 Jul 2012 13:15:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SrXqe-0005o4-Pr for qemu-devel@nongnu.org; Wed, 18 Jul 2012 13:15:44 -0400 Received: from mail-bk0-f45.google.com ([209.85.214.45]:53974) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SrXqe-0005nr-J6 for qemu-devel@nongnu.org; Wed, 18 Jul 2012 13:15:40 -0400 Received: by bkcji1 with SMTP id ji1so1500792bkc.4 for ; Wed, 18 Jul 2012 10:15:39 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <5006E44D.6020600@weilnetz.de> References: <500657F2.1080703@ozlabs.ru> <5006E44D.6020600@weilnetz.de> Date: Wed, 18 Jul 2012 18:15:39 +0100 Message-ID: From: Peter Maydell Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] qemu in full emulation on win32 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Weil Cc: Alexey Kardashevskiy , qemu-devel@nongnu.org, Hannes Reinecke , Paolo Bonzini , David Gibson , Richard Henderson On 18 July 2012 17:29, Stefan Weil wrote: > Am 18.07.2012 10:01, schrieb Peter Maydell: >> I think this struct should use QEMU_PACKED, which will >> ensure that it is packed to GCC rules rather than MS >> rules. >> >> We also seem to have let a pile of new uses of attribute((packed)) >> slip in in hw/mfi.h. Those are probably bugs too. > They are bugs (for w32 / w64 hosts). I just sent a patch to fix them. > > Some more which I did not fix are in the TCG debugger interface. > Maybe those also need to be fixed for w32 / w64, but that needs > more tests and reading of the debugger interface documentation. > Maybe Richard Henderson knows whether they should use QEMU_PACKED, > too. So, I think none of these structs will get actually used on Windows, because they're ELF structure layouts which only get used on hosts with ELF support. However I think it would be nice to use QEMU_PACKED for consistency. We can clearly straightforwardly switch the DebugInfo struct in tcg/tcg.c to use QEMU_PACKED. The remaining cases are all the same, in tcg/*/tcg-target.c: typedef struct { uint32_t len __attribute__((aligned((sizeof(void *))))); uint32_t cie_offset; tcg_target_long func_start __attribute__((packed)); tcg_target_long func_len __attribute__((packed)); uint8_t def_cfa[4]; uint8_t reg_ofs[14]; } DebugFrameFDE; I think we can just remove the packed attributes from the struct member fields and apply QEMU_PACKED to the whole struct: I don't think this will change any of the alignment or packing in the not-windows case. (It's not clear to me why the alignment attribute is applied to the len field rather than to the whole struct, but we don't need to change that I guess.) -- PMM