From aa004f5f9c5785273ef56b8c0b775f57ccb19168 Mon Sep 17 00:00:00 2001 From: Peter Maydell Date: Tue, 16 Jul 2013 18:44:48 +0100 Subject: configure: Flip default of target_nptl Most targets either (a) support threading or (b) don't have a linux-user/bsd-user target, so make it default to 'yes', with those targets that don't support threading having to specifically say so. This is a mechanical no-behaviour-change commit; some of the "no" entries it adds will be taken out in later patches. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Signed-off-by: Riku Voipio --- configure | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) (limited to 'configure') diff --git a/configure b/configure index 7c45db2fdd..983f4d5b5d 100755 --- a/configure +++ b/configure @@ -4180,7 +4180,7 @@ mkdir -p $target_dir echo "# Automatically generated by configure - do not modify" > $config_target_mak bflt="no" -target_nptl="no" +target_nptl="yes" interp_prefix1=`echo "$interp_prefix" | sed "s/%M/$target_name/g"` gdb_xml_files="" @@ -4190,69 +4190,71 @@ TARGET_ABI_DIR="" case "$target_name" in i386) + target_nptl="no" ;; x86_64) TARGET_BASE_ARCH=i386 + target_nptl="no" ;; alpha) - target_nptl="yes" ;; arm|armeb) TARGET_ARCH=arm bflt="yes" - target_nptl="yes" gdb_xml_files="arm-core.xml arm-vfp.xml arm-vfp3.xml arm-neon.xml" ;; cris) - target_nptl="yes" ;; lm32) + target_nptl="no" ;; m68k) bflt="yes" gdb_xml_files="cf-core.xml cf-fp.xml" + target_nptl="no" ;; microblaze|microblazeel) TARGET_ARCH=microblaze bflt="yes" - target_nptl="yes" ;; mips|mipsel) TARGET_ARCH=mips echo "TARGET_ABI_MIPSO32=y" >> $config_target_mak - target_nptl="yes" ;; mipsn32|mipsn32el) TARGET_ARCH=mips64 TARGET_BASE_ARCH=mips echo "TARGET_ABI_MIPSN32=y" >> $config_target_mak echo "TARGET_ABI32=y" >> $config_target_mak + target_nptl="no" ;; mips64|mips64el) TARGET_ARCH=mips64 TARGET_BASE_ARCH=mips echo "TARGET_ABI_MIPSN64=y" >> $config_target_mak + target_nptl="no" ;; moxie) + target_nptl="no" ;; or32) TARGET_ARCH=openrisc TARGET_BASE_ARCH=openrisc + target_nptl="no" ;; ppc) gdb_xml_files="power-core.xml power-fpu.xml power-altivec.xml power-spe.xml" - target_nptl="yes" ;; ppcemb) TARGET_BASE_ARCH=ppc TARGET_ABI_DIR=ppc gdb_xml_files="power-core.xml power-fpu.xml power-altivec.xml power-spe.xml" - target_nptl="yes" ;; ppc64) TARGET_BASE_ARCH=ppc TARGET_ABI_DIR=ppc gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml" + target_nptl="no" ;; ppc64abi32) TARGET_ARCH=ppc64 @@ -4260,30 +4262,34 @@ case "$target_name" in TARGET_ABI_DIR=ppc echo "TARGET_ABI32=y" >> $config_target_mak gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml" + target_nptl="no" ;; sh4|sh4eb) TARGET_ARCH=sh4 bflt="yes" - target_nptl="yes" ;; sparc) + target_nptl="no" ;; sparc64) TARGET_BASE_ARCH=sparc + target_nptl="no" ;; sparc32plus) TARGET_ARCH=sparc64 TARGET_BASE_ARCH=sparc TARGET_ABI_DIR=sparc echo "TARGET_ABI32=y" >> $config_target_mak + target_nptl="no" ;; s390x) - target_nptl="yes" ;; unicore32) + target_nptl="no" ;; xtensa|xtensaeb) TARGET_ARCH=xtensa + target_nptl="no" ;; *) error_exit "Unsupported target CPU" -- cgit v1.2.1 From fa78f3dbe4e0e1d9a34556b73e5118cb40153875 Mon Sep 17 00:00:00 2001 From: Peter Maydell Date: Tue, 16 Jul 2013 18:44:49 +0100 Subject: configure: Don't say target_nptl="no" if there is no linux-user target For architectures with no linux-user target, don't claim no NPTL support. This has no behavioural change, but it means that we won't accidentally add a new linux-user target without threading support in future (because attempting to do so would be a compile failure rather than a silent lack of support). Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Signed-off-by: Riku Voipio --- configure | 3 --- 1 file changed, 3 deletions(-) (limited to 'configure') diff --git a/configure b/configure index 983f4d5b5d..3792607c3b 100755 --- a/configure +++ b/configure @@ -4206,7 +4206,6 @@ case "$target_name" in cris) ;; lm32) - target_nptl="no" ;; m68k) bflt="yes" @@ -4235,7 +4234,6 @@ case "$target_name" in target_nptl="no" ;; moxie) - target_nptl="no" ;; or32) TARGET_ARCH=openrisc @@ -4289,7 +4287,6 @@ case "$target_name" in ;; xtensa|xtensaeb) TARGET_ARCH=xtensa - target_nptl="no" ;; *) error_exit "Unsupported target CPU" -- cgit v1.2.1 From d769c64147d32a80e5e37d41b397f45943d45e0d Mon Sep 17 00:00:00 2001 From: Peter Maydell Date: Tue, 16 Jul 2013 18:44:50 +0100 Subject: configure: Enable threading on all ppc and mips linux-user targets Though threading (target_nptl) was enabled on the base PPC and MIPS targets, it wasn't enabled for the variants mipsn32, mipsn32el, mips64, mips64el, ppc64 or ppc46abi32 (probably an oversight). Enable threading consistently on all these targets. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Reviewed-by: Richard Henderson Signed-off-by: Riku Voipio --- configure | 4 ---- 1 file changed, 4 deletions(-) (limited to 'configure') diff --git a/configure b/configure index 3792607c3b..9b7101cb60 100755 --- a/configure +++ b/configure @@ -4225,13 +4225,11 @@ case "$target_name" in TARGET_BASE_ARCH=mips echo "TARGET_ABI_MIPSN32=y" >> $config_target_mak echo "TARGET_ABI32=y" >> $config_target_mak - target_nptl="no" ;; mips64|mips64el) TARGET_ARCH=mips64 TARGET_BASE_ARCH=mips echo "TARGET_ABI_MIPSN64=y" >> $config_target_mak - target_nptl="no" ;; moxie) ;; @@ -4252,7 +4250,6 @@ case "$target_name" in TARGET_BASE_ARCH=ppc TARGET_ABI_DIR=ppc gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml" - target_nptl="no" ;; ppc64abi32) TARGET_ARCH=ppc64 @@ -4260,7 +4257,6 @@ case "$target_name" in TARGET_ABI_DIR=ppc echo "TARGET_ABI32=y" >> $config_target_mak gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml" - target_nptl="no" ;; sh4|sh4eb) TARGET_ARCH=sh4 -- cgit v1.2.1 From 790d440605a997a5e146809e824e95ca22a14652 Mon Sep 17 00:00:00 2001 From: Peter Maydell Date: Tue, 16 Jul 2013 18:44:51 +0100 Subject: configure: Enable threading for unicore32-linux-user unicore32-linux-user provides cpu_set_tls(), so the failure to enable target_nptl was presumably an oversight. Enable it. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Signed-off-by: Riku Voipio --- configure | 1 - 1 file changed, 1 deletion(-) (limited to 'configure') diff --git a/configure b/configure index 9b7101cb60..0b19408458 100755 --- a/configure +++ b/configure @@ -4279,7 +4279,6 @@ case "$target_name" in s390x) ;; unicore32) - target_nptl="no" ;; xtensa|xtensaeb) TARGET_ARCH=xtensa -- cgit v1.2.1 From 442a59c8ddc55f327ec0219d810fe4580177716a Mon Sep 17 00:00:00 2001 From: Peter Maydell Date: Tue, 16 Jul 2013 18:44:53 +0100 Subject: linux-user: Enable NPTL for OpenRISC The OpenRISC kernel ignores CLONE_SETTLS in its copy_thread() implementation, so a cpu_set_tls() implementation is a no-op. cpu_clone_regs() was setting the syscall return value in the wrong register -- it is gpr[11], not gpr[2]. With these two things fixed, we can compile with NPTL enabled. Signed-off-by: Peter Maydell Reviewed-by: Jia Liu Signed-off-by: Riku Voipio --- configure | 1 - 1 file changed, 1 deletion(-) (limited to 'configure') diff --git a/configure b/configure index 0b19408458..bfad34e327 100755 --- a/configure +++ b/configure @@ -4236,7 +4236,6 @@ case "$target_name" in or32) TARGET_ARCH=openrisc TARGET_BASE_ARCH=openrisc - target_nptl="no" ;; ppc) gdb_xml_files="power-core.xml power-fpu.xml power-altivec.xml power-spe.xml" -- cgit v1.2.1 From f5147c93d0e7f91df0215598017a4d9d6a48f0ee Mon Sep 17 00:00:00 2001 From: Peter Maydell Date: Tue, 16 Jul 2013 18:44:54 +0100 Subject: linux-user: Enable NPTL for SPARC targets Provide the missing cpu_set_tls(), and resolve the FIXME in cpu_clone_regs() by clearing the carry flag for the child. This allows us to turn on building with NPTL for SPARC. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Signed-off-by: Riku Voipio --- configure | 3 --- 1 file changed, 3 deletions(-) (limited to 'configure') diff --git a/configure b/configure index bfad34e327..ab3dc3cbca 100755 --- a/configure +++ b/configure @@ -4262,18 +4262,15 @@ case "$target_name" in bflt="yes" ;; sparc) - target_nptl="no" ;; sparc64) TARGET_BASE_ARCH=sparc - target_nptl="no" ;; sparc32plus) TARGET_ARCH=sparc64 TARGET_BASE_ARCH=sparc TARGET_ABI_DIR=sparc echo "TARGET_ABI32=y" >> $config_target_mak - target_nptl="no" ;; s390x) ;; -- cgit v1.2.1 From 1ccd9374af22ec4ed5f864d4935a9cfad01f1204 Mon Sep 17 00:00:00 2001 From: Peter Maydell Date: Tue, 16 Jul 2013 18:44:55 +0100 Subject: linux-user: Enable NPTL for m68k For m68k, per-thread data is a purely kernel construct with no CPU level support. Implement it via a field in the TaskState structure, used by cpu_set_tls() and the set_thread_area/get_thread_area syscalls. This allows us to enable compilation with NPTL. Signed-off-by: Peter Maydell Reviewed-by: Laurent Vivier Signed-off-by: Riku Voipio --- configure | 1 - 1 file changed, 1 deletion(-) (limited to 'configure') diff --git a/configure b/configure index ab3dc3cbca..f065edc8bb 100755 --- a/configure +++ b/configure @@ -4210,7 +4210,6 @@ case "$target_name" in m68k) bflt="yes" gdb_xml_files="cf-core.xml cf-fp.xml" - target_nptl="no" ;; microblaze|microblazeel) TARGET_ARCH=microblaze -- cgit v1.2.1 From bc22eb447c0552e2327f278fdc6bedccb14fc7a3 Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Tue, 16 Jul 2013 18:44:58 +0100 Subject: linux-user: Add i386 TLS setter We can easily set the TLS on i386. Add code to do so. Signed-off-by: Alexander Graf [PMM: also remove "target_nptl=no" line from configure, for consistency with other patches in this series] Signed-off-by: Peter Maydell Signed-off-by: Riku Voipio --- configure | 1 - 1 file changed, 1 deletion(-) (limited to 'configure') diff --git a/configure b/configure index f065edc8bb..547297bfb4 100755 --- a/configure +++ b/configure @@ -4190,7 +4190,6 @@ TARGET_ABI_DIR="" case "$target_name" in i386) - target_nptl="no" ;; x86_64) TARGET_BASE_ARCH=i386 -- cgit v1.2.1 From 2667e71c3d9262d756bea1473e2ea28eb2c9c070 Mon Sep 17 00:00:00 2001 From: Peter Maydell Date: Tue, 16 Jul 2013 18:44:59 +0100 Subject: linux-user: Enable NPTL for x86-64 Add x86-64 implementation of cpu_set_tls() (like the kernel, we just have to call do_arch_prctl() to set FS); this allows us to enable NPTL. Signed-off-by: Peter Maydell Signed-off-by: Riku Voipio --- configure | 1 - 1 file changed, 1 deletion(-) (limited to 'configure') diff --git a/configure b/configure index 547297bfb4..999b2ced23 100755 --- a/configure +++ b/configure @@ -4193,7 +4193,6 @@ case "$target_name" in ;; x86_64) TARGET_BASE_ARCH=i386 - target_nptl="no" ;; alpha) ;; -- cgit v1.2.1 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 --- configure | 25 +++---------------------- 1 file changed, 3 insertions(+), 22 deletions(-) (limited to 'configure') diff --git a/configure b/configure index 999b2ced23..9d9088ebd6 100755 --- a/configure +++ b/configure @@ -155,7 +155,6 @@ curl="" curses="" docs="" fdt="" -nptl="" pixman="" sdl="" virtfs="" @@ -855,10 +854,6 @@ for opt do ;; --enable-fdt) fdt="yes" ;; - --disable-nptl) nptl="no" - ;; - --enable-nptl) nptl="yes" - ;; --enable-mixemu) mixemu="yes" ;; --disable-linux-aio) linux_aio="no" @@ -1096,8 +1091,6 @@ echo " --disable-slirp disable SLIRP userspace network connectivity" echo " --disable-kvm disable KVM acceleration support" echo " --enable-kvm enable KVM acceleration support" echo " --enable-tcg-interpreter enable TCG with bytecode interpreter (TCI)" -echo " --disable-nptl disable usermode NPTL support" -echo " --enable-nptl enable usermode NPTL support" echo " --enable-system enable all system emulation targets" echo " --disable-system disable all system emulation targets" echo " --enable-user enable supported user emulation targets" @@ -1432,7 +1425,7 @@ fi ########################################## # NPTL probe -if test "$nptl" != "no" ; then +if test "$linux_user" = "yes"; then cat > $TMPC < #include @@ -1443,14 +1436,8 @@ int main(void) { return 0; } EOF - - if compile_object ; then - nptl=yes - else - if test "$nptl" = "yes" ; then - feature_not_found "nptl" - fi - nptl=no + if ! compile_object ; then + feature_not_found "nptl" fi fi @@ -3550,7 +3537,6 @@ echo "bluez support $bluez" echo "Documentation $docs" [ ! -z "$uname_release" ] && \ echo "uname -r $uname_release" -echo "NPTL support $nptl" echo "GUEST_BASE $guest_base" echo "PIE $pie" echo "vde support $vde" @@ -4180,7 +4166,6 @@ mkdir -p $target_dir echo "# Automatically generated by configure - do not modify" > $config_target_mak bflt="no" -target_nptl="yes" interp_prefix1=`echo "$interp_prefix" | sed "s/%M/$target_name/g"` gdb_xml_files="" @@ -4351,10 +4336,6 @@ fi if test "$target_user_only" = "yes" -a "$bflt" = "yes"; then echo "TARGET_HAS_BFLT=y" >> $config_target_mak fi -if test "$target_user_only" = "yes" \ - -a "$nptl" = "yes" -a "$target_nptl" = "yes"; then - echo "CONFIG_USE_NPTL=y" >> $config_target_mak -fi if test "$target_user_only" = "yes" -a "$guest_base" = "yes"; then echo "CONFIG_USE_GUEST_BASE=y" >> $config_target_mak fi -- cgit v1.2.1