From: Laurent Vivier <laurent@vivier.eu>
To: qemu-devel@nongnu.org
Cc: Richard Henderson <richard.henderson@linaro.org>,
Laurent Vivier <laurent@vivier.eu>
Subject: [PULL 19/27] linux-user/elfload: Rename ARM_COMMPAGE to HI_COMMPAGE
Date: Thu, 6 Jan 2022 11:41:29 +0100 [thread overview]
Message-ID: <20220106104137.732883-20-laurent@vivier.eu> (raw)
In-Reply-To: <20220106104137.732883-1-laurent@vivier.eu>
From: Richard Henderson <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>
Message-Id: <20211221025012.1057923-4-richard.henderson@linaro.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
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 767f54c76dc5..d34cd4fe43fb 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.33.1
next prev parent reply other threads:[~2022-01-06 11:03 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-06 10:41 [PULL 00/27] Linux user for 7.0 patches Laurent Vivier
2022-01-06 10:41 ` [PULL 01/27] qemu-binfmt-conf.sh: fix -F option Laurent Vivier
2022-01-06 10:41 ` [PULL 02/27] linux-user/hexagon: Use generic target_stat64 structure Laurent Vivier
2022-01-06 10:41 ` [PULL 03/27] linux-user: Mark cpu_loop() with noreturn attribute Laurent Vivier
2022-01-06 10:41 ` [PULL 04/27] linux-user: Move target_signal.h generic definitions to generic/signal.h Laurent Vivier
2022-01-06 10:41 ` [PULL 05/27] linux-user: target_syscall.h remove definition TARGET_MINSIGSTKSZ Laurent Vivier
2022-01-06 10:41 ` [PULL 06/27] linux-user: Remove TARGET_SIGSTKSZ Laurent Vivier
2022-01-06 10:41 ` [PULL 07/27] linux-user: Split out do_prctl and subroutines Laurent Vivier
2022-01-06 10:41 ` [PULL 08/27] linux-user: Disable more prctl subcodes Laurent Vivier
2022-01-06 10:41 ` [PULL 09/27] linux-user: Add code for PR_GET/SET_UNALIGN Laurent Vivier
2022-01-06 10:41 ` [PULL 10/27] target/alpha: Implement prctl_unalign_sigbus Laurent Vivier
2022-01-06 10:41 ` [PULL 11/27] target/hppa: " Laurent Vivier
2022-01-06 10:41 ` [PULL 12/27] target/sh4: " Laurent Vivier
2022-01-06 10:41 ` [PULL 13/27] linux-user/signal: Map exit signals in SIGCHLD siginfo_t Laurent Vivier
2022-01-06 10:41 ` [PULL 14/27] linux-user: add sched_getattr support Laurent Vivier
2022-01-06 10:41 ` [PULL 15/27] linux-user: call set/getscheduler set/getparam directly Laurent Vivier
2022-01-06 10:41 ` [PULL 16/27] linux-user/syscall.c: fix missed flag for shared memory in open_self_maps Laurent Vivier
2022-01-06 10:41 ` [PULL 17/27] linux-user/nios2: Properly emulate EXCP_TRAP Laurent Vivier
2022-01-06 10:41 ` [PULL 18/27] linux-user/nios2: Fixes for signal frame setup Laurent Vivier
2022-01-06 10:41 ` Laurent Vivier [this message]
2022-01-06 10:41 ` [PULL 20/27] linux-user/nios2: Map a real kuser page Laurent Vivier
2022-01-10 13:22 ` Peter Maydell
2022-01-06 10:41 ` [PULL 21/27] linux-user/nios2: Fix EA vs PC confusion Laurent Vivier
2022-01-06 10:41 ` [PULL 22/27] linux-user/nios2: Fix sigmask in setup_rt_frame Laurent Vivier
2022-01-06 10:41 ` [PULL 23/27] linux-user/nios2: Use set_sigmask in do_rt_sigreturn Laurent Vivier
2022-01-06 10:41 ` [PULL 24/27] linux-user/syscall.c: malloc to g_try_malloc Laurent Vivier
2022-01-06 10:41 ` [PULL 25/27] linux-user: netlink: update IFLA entries Laurent Vivier
2022-01-06 10:41 ` [PULL 26/27] linux-user: netlink: Add IFLA_VFINFO_LIST Laurent Vivier
2022-01-06 10:41 ` [PULL 27/27] linux-user: netlink: update IFLA_BRPORT entries Laurent Vivier
2022-01-06 21:15 ` [PULL 00/27] Linux user for 7.0 patches Richard Henderson
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=20220106104137.732883-20-laurent@vivier.eu \
--to=laurent@vivier.eu \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.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).