From: Richard Henderson <richard.henderson@linaro.org>
To: qemu-devel@nongnu.org
Cc: laurent@vivier.eu
Subject: [PATCH v2 3/7] linux-user/elfload: Rename ARM_COMMPAGE to HI_COMMPAGE
Date: Mon, 20 Dec 2021 18:50:08 -0800 [thread overview]
Message-ID: <20211221025012.1057923-4-richard.henderson@linaro.org> (raw)
In-Reply-To: <20211221025012.1057923-1-richard.henderson@linaro.org>
Arm will no longer be the only target requiring a commpage,
but it will continue to be the only target placing the page
at the high end of the address space.
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
linux-user/elfload.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/linux-user/elfload.c b/linux-user/elfload.c
index 767f54c76d..d34cd4fe43 100644
--- a/linux-user/elfload.c
+++ b/linux-user/elfload.c
@@ -390,11 +390,11 @@ enum {
/* The commpage only exists for 32 bit kernels */
-#define ARM_COMMPAGE (intptr_t)0xffff0f00u
+#define HI_COMMPAGE (intptr_t)0xffff0f00u
static bool init_guest_commpage(void)
{
- void *want = g2h_untagged(ARM_COMMPAGE & -qemu_host_page_size);
+ void *want = g2h_untagged(HI_COMMPAGE & -qemu_host_page_size);
void *addr = mmap(want, qemu_host_page_size, PROT_READ | PROT_WRITE,
MAP_ANONYMOUS | MAP_PRIVATE | MAP_FIXED, -1, 0);
@@ -2160,8 +2160,8 @@ static abi_ulong create_elf_tables(abi_ulong p, int argc, int envc,
return sp;
}
-#ifndef ARM_COMMPAGE
-#define ARM_COMMPAGE 0
+#ifndef HI_COMMPAGE
+#define HI_COMMPAGE 0
#define init_guest_commpage() true
#endif
@@ -2361,7 +2361,7 @@ static void pgb_static(const char *image_name, abi_ulong orig_loaddr,
}
loaddr &= -align;
- if (ARM_COMMPAGE) {
+ if (HI_COMMPAGE) {
/*
* Extend the allocation to include the commpage.
* For a 64-bit host, this is just 4GiB; for a 32-bit host we
@@ -2372,14 +2372,14 @@ static void pgb_static(const char *image_name, abi_ulong orig_loaddr,
if (sizeof(uintptr_t) == 8 || loaddr >= 0x80000000u) {
hiaddr = (uintptr_t) 4 << 30;
} else {
- offset = -(ARM_COMMPAGE & -align);
+ offset = -(HI_COMMPAGE & -align);
}
}
addr = pgb_find_hole(loaddr, hiaddr - loaddr, align, offset);
if (addr == -1) {
/*
- * If ARM_COMMPAGE, there *might* be a non-consecutive allocation
+ * If HI_COMMPAGE, there *might* be a non-consecutive allocation
* that can satisfy both. But as the normal arm32 link base address
* is ~32k, and we extend down to include the commpage, making the
* overhead only ~96k, this is unlikely.
@@ -2400,7 +2400,7 @@ static void pgb_dynamic(const char *image_name, long align)
* All we need is a commpage that satisfies align.
* If we do not need a commpage, leave guest_base == 0.
*/
- if (ARM_COMMPAGE) {
+ if (HI_COMMPAGE) {
uintptr_t addr, commpage;
/* 64-bit hosts should have used reserved_va. */
@@ -2410,7 +2410,7 @@ static void pgb_dynamic(const char *image_name, long align)
* By putting the commpage at the first hole, that puts guest_base
* just above that, and maximises the positive guest addresses.
*/
- commpage = ARM_COMMPAGE & -align;
+ commpage = HI_COMMPAGE & -align;
addr = pgb_find_hole(commpage, -commpage, align, 0);
assert(addr != -1);
guest_base = addr;
--
2.25.1
next prev parent reply other threads:[~2021-12-21 2:54 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-21 2:50 [PATCH v2 0/7] linux-user: nios2 fixes Richard Henderson
2021-12-21 2:50 ` [PATCH v2 1/7] linux-user/nios2: Properly emulate EXCP_TRAP Richard Henderson
2021-12-22 18:52 ` Laurent Vivier
2022-01-05 10:23 ` Laurent Vivier
2021-12-21 2:50 ` [PATCH v2 2/7] linux-user/nios2: Fixes for signal frame setup Richard Henderson
2022-01-05 10:23 ` Laurent Vivier
2021-12-21 2:50 ` Richard Henderson [this message]
2022-01-05 10:24 ` [PATCH v2 3/7] linux-user/elfload: Rename ARM_COMMPAGE to HI_COMMPAGE Laurent Vivier
2021-12-21 2:50 ` [PATCH v2 4/7] linux-user/nios2: Map a real kuser page Richard Henderson
2021-12-22 20:18 ` Laurent Vivier
2022-01-05 10:24 ` Laurent Vivier
2021-12-21 2:50 ` [PATCH v2 5/7] linux-user/nios2: Fix EA vs PC confusion Richard Henderson
2021-12-22 20:20 ` Laurent Vivier
2022-01-05 10:24 ` Laurent Vivier
2021-12-21 2:50 ` [PATCH v2 6/7] linux-user/nios2: Fix sigmask in setup_rt_frame Richard Henderson
2022-01-05 10:24 ` Laurent Vivier
2021-12-21 2:50 ` [PATCH v2 7/7] linux-user/nios2: Use set_sigmask in do_rt_sigreturn Richard Henderson
2022-01-05 10:24 ` Laurent Vivier
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=20211221025012.1057923-4-richard.henderson@linaro.org \
--to=richard.henderson@linaro.org \
--cc=laurent@vivier.eu \
--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).