From 24cb36a61c663d98a53338620e88e4cd3403459a Mon Sep 17 00:00:00 2001 From: Peter Maydell Date: Tue, 16 Jul 2013 18:45:00 +0100 Subject: configure: Make NPTL non-optional Now all linux-user targets support building with NPTL, we can make it mandatory. This is a good idea because: * NPTL is no longer new and experimental; it is completely standard * in practice, linux-user without NPTL is nearly useless for binaries built against non-ancient glibc * it allows us to delete the rather untested code for handling the non-NPTL configuration Note that this patch leaves the CONFIG_USE_NPTL ifdefs in the bsd-user codebase alone. This makes no change for bsd-user, since our configure test for NPTL had a "#include " which means bsd-user would never have been compiled with CONFIG_USE_NPTL defined, and it still is not. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Signed-off-by: Riku Voipio --- include/exec/gdbstub.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/exec') diff --git a/include/exec/gdbstub.h b/include/exec/gdbstub.h index ded4160e57..8065f40a60 100644 --- a/include/exec/gdbstub.h +++ b/include/exec/gdbstub.h @@ -32,7 +32,7 @@ void gdb_register_coprocessor(CPUArchState *env, static inline int cpu_index(CPUState *cpu) { -#if defined(CONFIG_USER_ONLY) && defined(CONFIG_USE_NPTL) +#if defined(CONFIG_USER_ONLY) return cpu->host_tid; #else return cpu->cpu_index + 1; -- cgit v1.2.3 From 732f9e89a1c737f738c445ff24929a1bc137d1a9 Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Sat, 6 Jul 2013 14:17:49 +0200 Subject: linux-user: fix segmentation fault passing with h2g(x) != x When forwarding a segmentation fault into the guest process, we were passing the host's address directly into the guest process's signal descriptor. That obviously confused the guest process, since it didn't know what to make of the (usually 32-bit truncated) address. Passing in h2g(address) makes the guest process a lot happier. To make the code more obvious, introduce a h2g_nocheck() macro that does the same as h2g(), but allows us to convert addresses that may be outside of guest mapped range into the guest's view of address space. This fixes java running in arm-linux-user for me. Signed-off-by: Alexander Graf Signed-off-by: Riku Voipio --- include/exec/cpu-all.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'include/exec') diff --git a/include/exec/cpu-all.h b/include/exec/cpu-all.h index 5084202217..f1cde978ab 100644 --- a/include/exec/cpu-all.h +++ b/include/exec/cpu-all.h @@ -209,11 +209,15 @@ extern unsigned long reserved_va; }) #endif -#define h2g(x) ({ \ +#define h2g_nocheck(x) ({ \ unsigned long __ret = (unsigned long)(x) - GUEST_BASE; \ + (abi_ulong)__ret; \ +}) + +#define h2g(x) ({ \ /* Check if given address fits target address space */ \ assert(h2g_valid(x)); \ - (abi_ulong)__ret; \ + h2g_nocheck(x); \ }) #define saddr(x) g2h(x) -- cgit v1.2.3