qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Laurent Vivier <laurent@vivier.eu>
To: Richard Henderson <richard.henderson@linaro.org>, qemu-devel@nongnu.org
Cc: marex@denx.de, crwulff@gmail.com, alex.bennee@linaro.org
Subject: Re: [PATCH 4/9] linux-user/elfload: Rename ARM_COMMPAGE to HI_COMMPAGE
Date: Tue, 12 Oct 2021 08:11:58 +0200	[thread overview]
Message-ID: <4ba40aeb-dd14-8fd4-8edd-0e2421d7acd1@vivier.eu> (raw)
In-Reply-To: <20211001153347.1736014-7-richard.henderson@linaro.org>

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>


  reply	other threads:[~2021-10-12  6:12 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-01 15:33 [PATCH 0/9] nios2: Enable cross compile and fix signals Richard Henderson
2021-10-01 15:33 ` [PATCH 1/9] tests/docker: Add debian-nios2-cross image Richard Henderson
2021-10-12 17:03   ` Alex Bennée
2021-10-12 18:24     ` Richard Henderson
2021-10-12 18:33       ` Alex Bennée
2021-10-14  9:34       ` Alex Bennée
2021-10-14 17:17     ` Richard Henderson
2021-10-14 17:25       ` Alex Bennée
2021-10-01 15:33 ` [PATCH 1/2] tests/docker: Remove fedora-i386-cross from DOCKER_PARTIAL_IMAGES Richard Henderson
2021-10-14  9:35   ` Alex Bennée
2021-10-01 15:33 ` [PATCH 2/9] linux-user/nios2: Properly emulate EXCP_TRAP Richard Henderson
2021-10-14  9:36   ` Alex Bennée
2021-10-01 15:33 ` [PATCH 2/2] tests/docker: Fix fedora-i386-cross Richard Henderson
2021-10-14  9:38   ` Alex Bennée
2021-10-01 15:33 ` [PATCH 3/9] linux-user/nios2: Fixes for signal frame setup Richard Henderson
2021-10-14  9:43   ` Alex Bennée
2021-10-01 15:33 ` [PATCH 4/9] linux-user/elfload: Rename ARM_COMMPAGE to HI_COMMPAGE Richard Henderson
2021-10-12  6:11   ` Laurent Vivier [this message]
2021-10-01 15:33 ` [PATCH 5/9] linux-user/nios2: Map a real kuser page Richard Henderson
2021-10-01 15:33 ` [PATCH 6/9] linux-user/nios2: Fix EA vs PC confusion Richard Henderson
2021-10-01 15:33 ` [PATCH 7/9] linux-user/nios2: Fix sigmask in setup_rt_frame Richard Henderson
2021-10-12  6:16   ` Laurent Vivier
2021-10-01 15:33 ` [PATCH 8/9] linux-user/nios2: Use set_sigmask in do_rt_sigreturn Richard Henderson
2021-10-12  6:29   ` Laurent Vivier
2021-10-01 15:33 ` [PATCH 9/9] tests/tcg: Enable container_cross_cc for nios2 Richard Henderson
2021-10-11 19:06 ` [PATCH 0/9] nios2: Enable cross compile and fix signals 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=4ba40aeb-dd14-8fd4-8edd-0e2421d7acd1@vivier.eu \
    --to=laurent@vivier.eu \
    --cc=alex.bennee@linaro.org \
    --cc=crwulff@gmail.com \
    --cc=marex@denx.de \
    --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).