Message ID | 20211001153347.1736014-7-richard.henderson@linaro.org |
---|---|
State | Superseded |
Headers | show |
Series | nios2: Enable cross compile and fix signals | expand |
Le 01/10/2021 à 17:33, Richard Henderson a écrit : > 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. > > 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 5f9e2141ad..dc4ababedd 100644 > --- a/linux-user/elfload.c > +++ b/linux-user/elfload.c > @@ -388,11 +388,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; > Reviewed-by: Laurent Vivier <laurent@vivier.eu>
diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 5f9e2141ad..dc4ababedd 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -388,11 +388,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;
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. Signed-off-by: Richard Henderson <richard.henderson@linaro.org> --- linux-user/elfload.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) -- 2.25.1