Patchwork [v2] pc: e820 qemu_cfg tables need to be packed

login
register
mail settings
Submitter Alex Williamson
Date Oct. 15, 2010, 4:08 a.m.
Message ID <20101015040706.3828.71113.stgit@s20.home>
Download mbox | patch
Permalink /patch/67883/
State New
Headers show

Comments

Alex Williamson - Oct. 15, 2010, 4:08 a.m.
We can't let the compiler define the alignment for qemu_cfg data.

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

 v2: Adjust alignment to help non-x86 hosts per Arnd's suggestion

 0.13-stable candidate

 hw/pc.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
Arnd Bergmann - Oct. 15, 2010, 10:20 a.m.
On Friday 15 October 2010, 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>
> ---
> 
>  v2: Adjust alignment to help non-x86 hosts per Arnd's suggestion

Ok, looks good now. Thanks!

	Arnd

Patch

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;