From: David Hildenbrand <david@redhat.com>
To: qemu-s390x@nongnu.org
Cc: qemu-devel@nongnu.org, Richard Henderson <rth@twiddle.net>,
Alexander Graf <agraf@suse.de>, Cornelia Huck <cohuck@redhat.com>,
Christian Borntraeger <borntraeger@de.ibm.com>,
Thomas Huth <thuth@redhat.com>,
David Hildenbrand <david@redhat.com>
Subject: [Qemu-devel] [PATCH v1 2/2] s390x/kvm: indicate alignment in legacy_s390_alloc()
Date: Thu, 28 Jun 2018 13:38:17 +0200 [thread overview]
Message-ID: <20180628113817.30814-3-david@redhat.com> (raw)
In-Reply-To: <20180628113817.30814-1-david@redhat.com>
Let's do this for completeness reason, although we don't support e.g.
PCDIMM/NVDIMM, which would use the alignment for placing the memory
region in guest physical memory. But maybe someday we would want to
support something like this - then we don't forget about this if
allowing multiple allocations in legacy_s390_alloc().
Use the same alignment as we would set in qemu_anon_ram_alloc(). Our
fixed address satisfies this alignment (1MB). This implicitly sets the
alignment of the underlying memory region.
Signed-off-by: David Hildenbrand <david@redhat.com>
---
target/s390x/kvm.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/target/s390x/kvm.c b/target/s390x/kvm.c
index bbac3454e3..22e13080a5 100644
--- a/target/s390x/kvm.c
+++ b/target/s390x/kvm.c
@@ -765,6 +765,9 @@ static void *legacy_s390_alloc(size_t size, uint64_t *align, bool shared)
if (mem == MAP_FAILED) {
mem = NULL;
}
+ if (mem && align) {
+ *align = QEMU_VMALLOC_ALIGN;
+ }
return mem;
}
--
2.17.1
next prev parent reply other threads:[~2018-06-28 11:38 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-28 11:38 [Qemu-devel] [PATCH v1 0/2] s390x/kvm: legacy_s390_alloc() fixes David Hildenbrand
2018-06-28 11:38 ` [Qemu-devel] [PATCH v1 1/2] s390x/kvm: legacy_s390_alloc() only supports one allocation David Hildenbrand
2018-06-28 12:42 ` [Qemu-devel] [qemu-s390x] " Christian Borntraeger
2018-06-28 11:38 ` David Hildenbrand [this message]
2018-06-28 15:22 ` [Qemu-devel] [PATCH v1 0/2] s390x/kvm: legacy_s390_alloc() fixes Cornelia Huck
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=20180628113817.30814-3-david@redhat.com \
--to=david@redhat.com \
--cc=agraf@suse.de \
--cc=borntraeger@de.ibm.com \
--cc=cohuck@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-s390x@nongnu.org \
--cc=rth@twiddle.net \
--cc=thuth@redhat.com \
/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).