]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
memory: Align MemoryRegionSections fields
authorDr. David Alan Gilbert <dgilbert@redhat.com>
Wed, 14 Aug 2019 17:55:33 +0000 (18:55 +0100)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Tue, 12 Nov 2019 22:23:49 +0000 (16:23 -0600)
MemoryRegionSection includes an Int128 'size' field;
on some platforms the compiler causes an alignment of this to
a 128bit boundary, leaving 8 bytes of dead space.
This deadspace can be filled with junk.

Move the size field to the top avoiding unnecessary alignment.

Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20190814175535.2023-2-dgilbert@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
(cherry picked from commit 44f85d3276397cfa2cfa379c61430405dad4e644)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
include/exec/memory.h

index bb0961ddb96788539e7138d4f5b3c94562f35c5d..e28d79cc592f776d822c9a82176a48c20d6f43e0 100644 (file)
@@ -487,10 +487,10 @@ static inline FlatView *address_space_to_flatview(AddressSpace *as)
  * @nonvolatile: this section is non-volatile
  */
 struct MemoryRegionSection {
+    Int128 size;
     MemoryRegion *mr;
     FlatView *fv;
     hwaddr offset_within_region;
-    Int128 size;
     hwaddr offset_within_address_space;
     bool readonly;
     bool nonvolatile;