From patchwork Sun Feb 10 18:30:49 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [09/10] mipsn32-linux-user: Restrict address space to 31-bits. Date: Sun, 10 Feb 2013 08:30:49 -0000 From: Richard Henderson X-Patchwork-Id: 219511 Message-Id: <1360521050-29680-10-git-send-email-rth@twiddle.net> To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, riku.voipio@iki.fi, aurelien@aurel32.net Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- 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 */ static void usage(void);