qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
To: Anthony Liguori <aliguori@us.ibm.com>
Cc: Alexey Kardashevskiy <aik@ozlabs.ru>,
	qemu-devel@nongnu.org,
	Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Subject: [Qemu-devel] [PATCH 1/6] powerpc pci: fixed packing of ranges[]
Date: Sat, 21 Jul 2012 13:27:00 +0100	[thread overview]
Message-ID: <1342873625-7979-2-git-send-email-stefanha@linux.vnet.ibm.com> (raw)
In-Reply-To: <1342873625-7979-1-git-send-email-stefanha@linux.vnet.ibm.com>

From: Alexey Kardashevskiy <aik@ozlabs.ru>

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 <aik@ozlabs.ru>
Tested-by: Stefan Weil <sw@weilnetz.de>
Reviewed-by: Stefan Weil <sw@weilnetz.de>
Acked-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
---
 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

  reply	other threads:[~2012-07-21 12:27 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-21 12:26 [Qemu-devel] [PULL 0/6] Trivial patches for 14 to 21 July 2012 Stefan Hajnoczi
2012-07-21 12:27 ` Stefan Hajnoczi [this message]
2012-07-21 12:27 ` [Qemu-devel] [PATCH 2/6] Recognize PCID feature Stefan Hajnoczi
2012-07-21 12:27 ` [Qemu-devel] [PATCH 3/6] Use macro QEMU_PACKED for new packed structures Stefan Hajnoczi
2012-07-21 12:27 ` [Qemu-devel] [PATCH 4/6] cpus.c: Make all_cpu_threads_idle() static Stefan Hajnoczi
2012-07-21 12:27 ` [Qemu-devel] [PATCH 5/6] qdev: Fix Open Firmware comment Stefan Hajnoczi
2012-07-21 12:27 ` [Qemu-devel] [PATCH 6/6] Fix some more Qemus in documentation and help text Stefan Hajnoczi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1342873625-7979-2-git-send-email-stefanha@linux.vnet.ibm.com \
    --to=stefanha@linux.vnet.ibm.com \
    --cc=aik@ozlabs.ru \
    --cc=aliguori@us.ibm.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).