qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Dr. David Alan Gilbert (git)" <dgilbert@redhat.com>
To: qemu-devel@nongnu.org, pbonzini@redhat.com, mst@redhat.com
Cc: peter.maydell@linaro.org, maxime.coquelin@redhat.com,
	marcandre.lureau@redhat.com
Subject: [Qemu-devel] [PATCH v2 1/3] memory: Align MemoryRegionSections fields
Date: Wed, 14 Aug 2019 18:55:33 +0100	[thread overview]
Message-ID: <20190814175535.2023-2-dgilbert@redhat.com> (raw)
In-Reply-To: <20190814175535.2023-1-dgilbert@redhat.com>

From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>

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>
---
 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 606250172a..a74a58c289 100644
--- a/include/exec/memory.h
+++ b/include/exec/memory.h
@@ -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;
-- 
2.21.0



WARNING: multiple messages have this Message-ID (diff)
From: "Michael S. Tsirkin" <mst@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
	"Philippe Mathieu-Daudé" <philmd@redhat.com>,
	"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>
Subject: [PULL 1/3] memory: Align MemoryRegionSections fields
Date: Wed, 25 Sep 2019 10:30:10 -0400	[thread overview]
Message-ID: <20190814175535.2023-2-dgilbert@redhat.com> (raw)
Message-ID: <20190925143010.y-8Krww6ql1NLEwvASLyLOdDwnhizrpfPNrI714oPhY@z> (raw)
In-Reply-To: <20190925142910.26529-1-mst@redhat.com>

From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>

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>
---
 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;
-- 
MST



  reply	other threads:[~2019-08-14 17:58 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-14 17:55 [Qemu-devel] [PATCH v2 0/3] Fix MemoryRegionSection alignment and comparison Dr. David Alan Gilbert (git)
2019-08-14 17:55 ` Dr. David Alan Gilbert (git) [this message]
2019-09-25 14:30   ` [PULL 1/3] memory: Align MemoryRegionSections fields Michael S. Tsirkin
2019-08-14 17:55 ` [Qemu-devel] [PATCH v2 2/3] memory: Provide an equality function for MemoryRegionSections Dr. David Alan Gilbert (git)
2019-09-25 14:30   ` [PULL " Michael S. Tsirkin
2019-08-14 17:55 ` [Qemu-devel] [PATCH v2 3/3] vhost: Fix memory region section comparison Dr. David Alan Gilbert (git)
2019-09-25 14:30   ` [PULL " Michael S. Tsirkin
2019-08-15  2:16 ` [Qemu-devel] [PATCH v2 0/3] Fix MemoryRegionSection alignment and comparison no-reply
  -- strict thread matches above, loose matches on Subject: below --
2019-09-25 14:30 [PULL 0/3] vhost: fixes Michael S. Tsirkin
2019-09-27 10:10 ` Peter Maydell

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=20190814175535.2023-2-dgilbert@redhat.com \
    --to=dgilbert@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=maxime.coquelin@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --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).