qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v2 RESEND] pc: e820 qemu_cfg tables need to be packed
@ 2010-11-05 21:40 Alex Williamson
  2010-11-07 14:59 ` Blue Swirl
  2010-11-16 22:24 ` Anthony Liguori
  0 siblings, 2 replies; 4+ messages in thread
From: Alex Williamson @ 2010-11-05 21:40 UTC (permalink / raw)
  To: qemu-devel; +Cc: jes.sorensen, alex.williamson

We can't let the compiler define the alignment for qemu_cfg data.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
---

 hw/pc.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/pc.c b/hw/pc.c
index 69b13bf..0264e3d 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -75,12 +75,12 @@ struct e820_entry {
     uint64_t address;
     uint64_t length;
     uint32_t type;
-};
+} __attribute((__packed__, __aligned__(4)));
 
 struct e820_table {
     uint32_t count;
     struct e820_entry entry[E820_NR_ENTRIES];
-};
+} __attribute((__packed__, __aligned__(4)));
 
 static struct e820_table e820_table;
 

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH v2 RESEND] pc: e820 qemu_cfg tables need to be packed
  2010-11-05 21:40 [Qemu-devel] [PATCH v2 RESEND] pc: e820 qemu_cfg tables need to be packed Alex Williamson
@ 2010-11-07 14:59 ` Blue Swirl
  2010-11-10 16:09   ` Alex Williamson
  2010-11-16 22:24 ` Anthony Liguori
  1 sibling, 1 reply; 4+ messages in thread
From: Blue Swirl @ 2010-11-07 14:59 UTC (permalink / raw)
  To: Alex Williamson; +Cc: jes.sorensen, qemu-devel

On Fri, Nov 5, 2010 at 9:40 PM, Alex Williamson
<alex.williamson@redhat.com> wrote:
> We can't let the compiler define the alignment for qemu_cfg data.

Actually, whole e820_table implementation seems to be buggy. The
structure may not be passed directly to fw_cfg interface without
endianness conversions, otherwise the emulation will not work on big
endian host.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH v2 RESEND] pc: e820 qemu_cfg tables need to be packed
  2010-11-07 14:59 ` Blue Swirl
@ 2010-11-10 16:09   ` Alex Williamson
  0 siblings, 0 replies; 4+ messages in thread
From: Alex Williamson @ 2010-11-10 16:09 UTC (permalink / raw)
  To: Blue Swirl; +Cc: jes.sorensen, qemu-devel

On Sun, 2010-11-07 at 14:59 +0000, Blue Swirl wrote:
> On Fri, Nov 5, 2010 at 9:40 PM, Alex Williamson
> <alex.williamson@redhat.com> wrote:
> > We can't let the compiler define the alignment for qemu_cfg data.
> 
> Actually, whole e820_table implementation seems to be buggy. The
> structure may not be passed directly to fw_cfg interface without
> endianness conversions, otherwise the emulation will not work on big
> endian host.

I sent a patch for this a couple days ago:

http://lists.nongnu.org/archive/html/qemu-devel/2010-11/msg00481.html

I think that resolves your concern.  Thanks,

Alex

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH v2 RESEND] pc: e820 qemu_cfg tables need to be packed
  2010-11-05 21:40 [Qemu-devel] [PATCH v2 RESEND] pc: e820 qemu_cfg tables need to be packed Alex Williamson
  2010-11-07 14:59 ` Blue Swirl
@ 2010-11-16 22:24 ` Anthony Liguori
  1 sibling, 0 replies; 4+ messages in thread
From: Anthony Liguori @ 2010-11-16 22:24 UTC (permalink / raw)
  To: Alex Williamson; +Cc: jes.sorensen, qemu-devel

On 11/05/2010 04:40 PM, Alex Williamson wrote:
> We can't let the compiler define the alignment for qemu_cfg data.
>
> Signed-off-by: Alex Williamson<alex.williamson@redhat.com>
>    

Applied.  Thanks.

Regards,

Anthony Liguori
> ---
>
>   hw/pc.c |    4 ++--
>   1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/hw/pc.c b/hw/pc.c
> index 69b13bf..0264e3d 100644
> --- a/hw/pc.c
> +++ b/hw/pc.c
> @@ -75,12 +75,12 @@ struct e820_entry {
>       uint64_t address;
>       uint64_t length;
>       uint32_t type;
> -};
> +} __attribute((__packed__, __aligned__(4)));
>
>   struct e820_table {
>       uint32_t count;
>       struct e820_entry entry[E820_NR_ENTRIES];
> -};
> +} __attribute((__packed__, __aligned__(4)));
>
>   static struct e820_table e820_table;
>
>
>
>
>    

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-11-16 22:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-05 21:40 [Qemu-devel] [PATCH v2 RESEND] pc: e820 qemu_cfg tables need to be packed Alex Williamson
2010-11-07 14:59 ` Blue Swirl
2010-11-10 16:09   ` Alex Williamson
2010-11-16 22:24 ` Anthony Liguori

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).