From 44f85d3276397cfa2cfa379c61430405dad4e644 Mon Sep 17 00:00:00 2001 From: "Dr. David Alan Gilbert" Date: Wed, 14 Aug 2019 18:55:33 +0100 Subject: [PATCH] memory: Align MemoryRegionSections fields MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20190814175535.2023-2-dgilbert@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/exec/memory.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/exec/memory.h b/include/exec/memory.h index a30245c25a..a1e6d846cc 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@ -495,10 +495,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;