From patchwork Tue Jul 23 15:49:02 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 261142 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 6DD392C00BA for ; Wed, 24 Jul 2013 02:27:10 +1000 (EST) Received: from localhost ([::1]:34230 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V1evS-0005BY-Hz for incoming@patchwork.ozlabs.org; Tue, 23 Jul 2013 11:54:58 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57584) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V1eqB-0005OW-Ps for qemu-devel@nongnu.org; Tue, 23 Jul 2013 11:49:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V1epx-0001Zv-Nx for qemu-devel@nongnu.org; Tue, 23 Jul 2013 11:49:31 -0400 Received: from afflict.kos.to ([92.243.29.197]:45181) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V1epx-0001Yn-Ik for qemu-devel@nongnu.org; Tue, 23 Jul 2013 11:49:17 -0400 Received: from kos.to (a91-156-63-85.elisa-laajakaista.fi [91.156.63.85]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by afflict.kos.to (Postfix) with ESMTPSA id 6DA0226564 for ; Tue, 23 Jul 2013 17:49:16 +0200 (CEST) Received: from voipio (uid 1000) (envelope-from voipio@kos.to) id 5e0804 by kos.to (DragonFly Mail Agent); Tue, 23 Jul 2013 18:49:13 +0300 From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Tue, 23 Jul 2013 18:49:02 +0300 Message-Id: <2667e71c3d9262d756bea1473e2ea28eb2c9c070.1374593203.git.riku.voipio@linaro.org> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 92.243.29.197 Cc: Peter Maydell Subject: [Qemu-devel] [PULL 12/21] linux-user: Enable NPTL for x86-64 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Peter Maydell 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 - linux-user/i386/target_cpu.h | 7 +++++++ linux-user/syscall.c | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 547297b..999b2ce 100755 --- a/configure +++ b/configure @@ -4193,7 +4193,6 @@ case "$target_name" in ;; x86_64) TARGET_BASE_ARCH=i386 - target_nptl="no" ;; alpha) ;; diff --git a/linux-user/i386/target_cpu.h b/linux-user/i386/target_cpu.h index 1170d84..58f8645 100644 --- a/linux-user/i386/target_cpu.h +++ b/linux-user/i386/target_cpu.h @@ -36,6 +36,13 @@ static inline void cpu_set_tls(CPUX86State *env, target_ulong newtls) do_set_thread_area(env, newtls); cpu_x86_load_seg(env, R_GS, env->segs[R_GS].selector); } +#else +abi_long do_arch_prctl(CPUX86State *env, int code, abi_ulong addr); + +static inline void cpu_set_tls(CPUX86State *env, target_ulong newtls) +{ + do_arch_prctl(env, TARGET_ARCH_SET_FS, newtls); +} #endif /* defined(TARGET_ABI32) */ #endif /* !defined(TARGET_CPU_H) */ diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 452b89d..d3b3590 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -4189,7 +4189,7 @@ static abi_long do_get_thread_area(CPUX86State *env, abi_ulong ptr) #endif /* TARGET_I386 && TARGET_ABI32 */ #ifndef TARGET_ABI32 -static abi_long do_arch_prctl(CPUX86State *env, int code, abi_ulong addr) +abi_long do_arch_prctl(CPUX86State *env, int code, abi_ulong addr) { abi_long ret = 0; abi_ulong val;