From patchwork Tue Jul 16 17:44:59 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 18384 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vb0-f71.google.com (mail-vb0-f71.google.com [209.85.212.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id AAAF325E13 for ; Tue, 16 Jul 2013 17:45:11 +0000 (UTC) Received: by mail-vb0-f71.google.com with SMTP id f12sf1176038vbg.2 for ; Tue, 16 Jul 2013 10:45:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-beenthere:x-forwarded-to:x-forwarded-for :delivered-to:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe; bh=NSaIeV1JLxL67nsY9qjrno6hGstjznXyF2UWEaREr3s=; b=gFyhDVrh7mPUIRI2K5nMtQRCvpKXuSfa78lZ/X3XCzUd7kTgh27GehfrSepBM4BIe7 NSRttekBSqZ5gO03eEo3g6EJyQnRgbr3rk4J3Z7ZYftuHB0j6GORl63UUNxGRnJIlHc4 CBcGgKwPEw1qeM4Ifh5WGJ2C0w57/U4+t6fwH+uhnVJiM1a1DDNzqFavyTr3Fh83zyzH wisYzTzjMd4MIZ2U5Y59BB6W1oPuF/mMfkS5w3OgeUALh/oUVWCP2tClYCljKDtfo7GF Zs+OHtWBei88cdBzcsKkOJX2nSY1j4TGtVtx6uyKKBwQ4eJA3Fx0RjUHYheBNga0q6c3 3pdQ== X-Received: by 10.236.51.225 with SMTP id b61mr1309686yhc.4.1373996711377; Tue, 16 Jul 2013 10:45:11 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.47.110 with SMTP id c14ls320052qen.71.gmail; Tue, 16 Jul 2013 10:45:11 -0700 (PDT) X-Received: by 10.58.230.135 with SMTP id sy7mr796698vec.42.1373996711256; Tue, 16 Jul 2013 10:45:11 -0700 (PDT) Received: from mail-vb0-f50.google.com (mail-vb0-f50.google.com [209.85.212.50]) by mx.google.com with ESMTPS id a1si451369vek.121.2013.07.16.10.45.11 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 16 Jul 2013 10:45:11 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.50 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.50; Received: by mail-vb0-f50.google.com with SMTP id w16so665046vbb.23 for ; Tue, 16 Jul 2013 10:45:11 -0700 (PDT) X-Received: by 10.220.198.133 with SMTP id eo5mr798186vcb.24.1373996711170; Tue, 16 Jul 2013 10:45:11 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.149.77 with SMTP id s13csp131944vcv; Tue, 16 Jul 2013 10:45:10 -0700 (PDT) X-Received: by 10.152.28.6 with SMTP id x6mr1212618lag.41.1373996706876; Tue, 16 Jul 2013 10:45:06 -0700 (PDT) Received: from mnementh.archaic.org.uk (1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.d.1.0.0.b.8.0.1.0.0.2.ip6.arpa. [2001:8b0:1d0::1]) by mx.google.com with ESMTPS id w1si1691605lbw.145.2013.07.16.10.45.05 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 16 Jul 2013 10:45:06 -0700 (PDT) Received-SPF: neutral (google.com: 2001:8b0:1d0::1 is neither permitted nor denied by best guess record for domain of pm215@archaic.org.uk) client-ip=2001:8b0:1d0::1; Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1Uz9J8-0007db-Bo; Tue, 16 Jul 2013 18:45:02 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, Riku Voipio , Richard Henderson , Aurelien Jarno , Alexander Graf , Blue Swirl , Guan Xuetao , "Edgar E. Iglesias" , Jia Liu , Laurent Vivier Subject: [PATCH v3 12/13] linux-user: Enable NPTL for x86-64 Date: Tue, 16 Jul 2013 18:44:59 +0100 Message-Id: <1373996700-29286-13-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1373996700-29286-1-git-send-email-peter.maydell@linaro.org> References: <1373996700-29286-1-git-send-email-peter.maydell@linaro.org> X-Gm-Message-State: ALoCoQnkQmvzTaI6dtYVIvyDnROy37oKxYkx8dtGfVoGHOUahpfPOGBdA4O3208Cq8alKDKMx5Bu X-Original-Sender: peter.maydell@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.50 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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 --- 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 8059b2b..be19cbb 100755 --- a/configure +++ b/configure @@ -4186,7 +4186,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;