From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:58472) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SsYmE-00085q-Vg for qemu-devel@nongnu.org; Sat, 21 Jul 2012 08:27:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SsYmD-0004rK-51 for qemu-devel@nongnu.org; Sat, 21 Jul 2012 08:27:18 -0400 Received: from e06smtp12.uk.ibm.com ([195.75.94.108]:39043) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SsYmC-0004qk-T3 for qemu-devel@nongnu.org; Sat, 21 Jul 2012 08:27:17 -0400 Received: from /spool/local by e06smtp12.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sat, 21 Jul 2012 13:27:15 +0100 Received: from d06av03.portsmouth.uk.ibm.com (d06av03.portsmouth.uk.ibm.com [9.149.37.213]) by d06nrmr1407.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q6LCRCOQ983154 for ; Sat, 21 Jul 2012 13:27:13 +0100 Received: from d06av03.portsmouth.uk.ibm.com (localhost.localdomain [127.0.0.1]) by d06av03.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q6LCRCbE004206 for ; Sat, 21 Jul 2012 06:27:12 -0600 From: Stefan Hajnoczi Date: Sat, 21 Jul 2012 13:27:00 +0100 Message-Id: <1342873625-7979-2-git-send-email-stefanha@linux.vnet.ibm.com> In-Reply-To: <1342873625-7979-1-git-send-email-stefanha@linux.vnet.ibm.com> References: <1342873625-7979-1-git-send-email-stefanha@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH 1/6] powerpc pci: fixed packing of ranges[] List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Alexey Kardashevskiy , qemu-devel@nongnu.org, Stefan Hajnoczi From: Alexey Kardashevskiy By default mingw-gcc is trying to pack structures the way to preserve binary compatibility with MS Visual C what leads to incorrect and unexpected padding in the PCI bus ranges property of the sPAPR PHB. The patch replaces __attribute__((packed)) with more strict QEMU_PACKED which actually is __attribute__((gcc_struct, packed)) on Windows. Signed-off-by: Alexey Kardashevskiy Tested-by: Stefan Weil Reviewed-by: Stefan Weil Acked-by: Alexander Graf Signed-off-by: Stefan Hajnoczi --- hw/spapr_pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/spapr_pci.c b/hw/spapr_pci.c index 47ba5ff..b2e4f78 100644 --- a/hw/spapr_pci.c +++ b/hw/spapr_pci.c @@ -418,7 +418,7 @@ int spapr_populate_pci_devices(sPAPRPHBState *phb, uint64_t child; uint64_t parent; uint64_t size; - } __attribute__((packed)) ranges[] = { + } QEMU_PACKED ranges[] = { { cpu_to_be32(b_ss(1)), cpu_to_be64(0), cpu_to_be64(phb->io_win_addr), -- 1.7.10.4