[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 09/10] mipsn32-linux-user: Restrict address spac
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PATCH 09/10] mipsn32-linux-user: Restrict address space to 31-bits. |
Date: |
Mon, 11 Feb 2013 17:44:38 +0000 |
On 10 February 2013 18:30, Richard Henderson <address@hidden> wrote:
> Signed-off-by: Richard Henderson <address@hidden>
> ---
> linux-user/main.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/linux-user/main.c b/linux-user/main.c
> index 8c4dffd..25491ca 100644
> --- a/linux-user/main.c
> +++ b/linux-user/main.c
> @@ -46,10 +46,10 @@ int gdbstub_port;
> envlist_t *envlist;
> const char *cpu_model;
> unsigned long mmap_min_addr;
> +
> #if defined(CONFIG_USE_GUEST_BASE)
> unsigned long guest_base;
> int have_guest_base;
> -#if (TARGET_LONG_BITS == 32) && (HOST_LONG_BITS == 64)
> /*
> * When running 32-on-64 we should make sure we can fit all of the possible
> * guest address space into a contiguous chunk of virtual host memory.
> @@ -57,16 +57,16 @@ int have_guest_base;
> * This way we will never overlap with our own libraries or binaries or stack
> * or anything else that QEMU maps.
> */
> -# ifdef TARGET_MIPS
> +# if HOST_LONG_BITS == 64 \
> + && (defined(TARGET_ABI_MIPSO32) || defined(TARGET_ABI_MIPSN32))
> /* MIPS only supports 31 bits of virtual address space for user space */
> -unsigned long reserved_va = 0x77000000;
> -# else
> +unsigned long reserved_va = 0x7f000000;
> +# elif (TARGET_LONG_BITS == 32) && (HOST_LONG_BITS == 64)
> unsigned long reserved_va = 0xf7000000;
> -# endif
> #else
> unsigned long reserved_va;
> #endif
> -#endif
> +#endif /* CONFIG_USE_GUEST_BASE */
Maybe clearer to pull out the "#if HOST_LONG_BITS == 64" into
its own #if rather than having it as an && term in both the #if
and the #elif?
I don't feel strongly either way though so
Reviewed-by: Peter Maydell <address@hidden>
-- PMM
- Re: [Qemu-devel] [PATCH 04/10] mips-linux-user: Save and restore fpu and dsp from sigcontext, (continued)
[Qemu-devel] [PATCH 08/10] target-mips: Fix check_cp1_64bitmode, Richard Henderson, 2013/02/10
[Qemu-devel] [PATCH 07/10] mips64-linux-user: Use MIPS64R2-generic as default cpu., Richard Henderson, 2013/02/10
[Qemu-devel] [PATCH 09/10] mipsn32-linux-user: Restrict address space to 31-bits., Richard Henderson, 2013/02/10
[Qemu-devel] [PATCH 10/10] mipsn32-linux-user: Configure the architecture properly, Richard Henderson, 2013/02/10
Re: [Qemu-devel] [PATCH 00/10] Support mips64/mipsn32-linux-user, Peter Maydell, 2013/02/11