From patchwork Tue Jul 16 17:44:53 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 18388 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f69.google.com (mail-yh0-f69.google.com [209.85.213.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 3328325E13 for ; Tue, 16 Jul 2013 17:45:16 +0000 (UTC) Received: by mail-yh0-f69.google.com with SMTP id b12sf1288728yha.0 for ; Tue, 16 Jul 2013 10:45:16 -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=CIsiUFpryrwHQeZv2eguuOZjXOO9pI2rikr25+BICIs=; b=P69PKlOdyR11axVrWK6mF1Abm5PsgqUm1C58GeSa69PrsIu4IzshK1/HikD/7+H3ok bESHTHnQEo+veXrZxTgmVMwAVjexGgYjeWXQF4AeroUIfIk0o87c1QnYcMYI68lmCMEg gDMjnqSqV3MT8LErgaoLRILTPvZoeYpjZki8nu0TYn9nX2Xwc9VA8JAkKIvR+soIIPq6 rY3K5xCcPsGW/KzWXA74X8y35CbO45UECatBp2jzJ1EIqHZfF8FqL4NJ+MoxBOakOgql UMyC5PSQj5B0OW8tIy4nPAoD15OHjY8YVw8OOGoR46J/jfALNyTB+0ia45g0G3E2W4rb /5/Q== X-Received: by 10.236.137.35 with SMTP id x23mr1451633yhi.7.1373996715980; Tue, 16 Jul 2013 10:45:15 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.96.233 with SMTP id dv9ls326673qeb.81.gmail; Tue, 16 Jul 2013 10:45:15 -0700 (PDT) X-Received: by 10.52.164.16 with SMTP id ym16mr660888vdb.32.1373996715770; Tue, 16 Jul 2013 10:45:15 -0700 (PDT) Received: from mail-vb0-f44.google.com (mail-vb0-f44.google.com [209.85.212.44]) by mx.google.com with ESMTPS id sz6si447636vdc.153.2013.07.16.10.45.15 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 16 Jul 2013 10:45:15 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.44 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.44; Received: by mail-vb0-f44.google.com with SMTP id e15so678917vbg.3 for ; Tue, 16 Jul 2013 10:45:15 -0700 (PDT) X-Received: by 10.52.69.177 with SMTP id f17mr683064vdu.48.1373996715645; Tue, 16 Jul 2013 10:45:15 -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 s13csp131948vcv; Tue, 16 Jul 2013 10:45:15 -0700 (PDT) X-Received: by 10.66.246.194 with SMTP id xy2mr3725131pac.131.1373996708378; Tue, 16 Jul 2013 10:45:08 -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 of1si1482308pbb.12.2013.07.16.10.45.06 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 16 Jul 2013 10:45:08 -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 1Uz9J7-0007dD-F2; Tue, 16 Jul 2013 18:45:01 +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 06/13] linux-user: Enable NPTL for OpenRISC Date: Tue, 16 Jul 2013 18:44:53 +0100 Message-Id: <1373996700-29286-7-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: ALoCoQnY7iAlEF+S9LbaHHcbIPP9kgSR6ec6bPJmChxhC/4jSjqyMi3VkzeC/qOD2YELlDwZ1Chy X-Original-Sender: peter.maydell@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.44 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: , 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 --- configure | 1 - linux-user/openrisc/target_cpu.h | 9 +++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/configure b/configure index 4a241e0..3848c1c 100755 --- a/configure +++ b/configure @@ -4229,7 +4229,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" diff --git a/linux-user/openrisc/target_cpu.h b/linux-user/openrisc/target_cpu.h index 501fb81..32a46ac 100644 --- a/linux-user/openrisc/target_cpu.h +++ b/linux-user/openrisc/target_cpu.h @@ -25,9 +25,14 @@ static inline void cpu_clone_regs(CPUOpenRISCState *env, target_ulong newsp) if (newsp) { env->gpr[1] = newsp; } - env->gpr[2] = 0; + env->gpr[11] = 0; } -/* TODO: need to implement cpu_set_tls() */ +static inline void cpu_set_tls(CPUOpenRISCState *env, target_ulong newtls) +{ + /* Linux kernel 3.10 does not pay any attention to CLONE_SETTLS + * in copy_thread(), so QEMU need not do so either. + */ +} #endif