From patchwork Fri Jul 12 20:12:51 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 18337 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-fa0-f69.google.com (mail-fa0-f69.google.com [209.85.161.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id EA54A25E46 for ; Fri, 12 Jul 2013 20:13:03 +0000 (UTC) Received: by mail-fa0-f69.google.com with SMTP id a11sf10222119fad.0 for ; Fri, 12 Jul 2013 13:13:02 -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=88P+bC3AzJ886mp9qGck1mfshIEBbbTgJlbP6P2cP7w=; b=ESlzunAkLJ9gxNcX+oBvsXivXKM+VcjVhs+gMMTd9yAOH12AWLtgKQgfVX+vuNSPPC 2MlnivQ4FhetFOw9s69F8AHGn7SVNYDlS2zH0FBbuPfORMwlDJMhqs8KVgfuM5rHAu20 YgV1GO0OwxmeDCPnc2xguIZ7hQ9JM4tZOcPNiu7hb0e7uQ/v60Ez8FgT0fxIlYNuMBwo KVMgJzzic0bDCBJfmO979kmC3qcNmoXaqXJJQq3p4dI7xGUUt153hcLzTTboc+wWK5pm WwoJMs5630I+dbBDL8ua6qiQIYC/TcCne9u1uurdKesJQhmJFwJRp42Oq1VdDkJGK4MC ZiZA== X-Received: by 10.180.75.241 with SMTP id f17mr2453191wiw.7.1373659982683; Fri, 12 Jul 2013 13:13:02 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.180.36.132 with SMTP id q4ls221896wij.2.canary; Fri, 12 Jul 2013 13:13:02 -0700 (PDT) X-Received: by 10.194.176.71 with SMTP id cg7mr24744158wjc.18.1373659982307; Fri, 12 Jul 2013 13:13:02 -0700 (PDT) Received: from mail-ve0-f176.google.com (mail-ve0-f176.google.com [209.85.128.176]) by mx.google.com with ESMTPS id lp3si1453829wic.60.2013.07.12.13.13.02 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 12 Jul 2013 13:13:02 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.176 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.176; Received: by mail-ve0-f176.google.com with SMTP id c13so8560312vea.7 for ; Fri, 12 Jul 2013 13:13:01 -0700 (PDT) X-Received: by 10.58.187.4 with SMTP id fo4mr25391783vec.55.1373659980918; Fri, 12 Jul 2013 13:13:00 -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 s13csp147057vcv; Fri, 12 Jul 2013 13:12:59 -0700 (PDT) X-Received: by 10.15.44.67 with SMTP id y43mr13480678eev.20.1373659979152; Fri, 12 Jul 2013 13:12:59 -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 r42si34185910eep.92.2013.07.12.13.12.58 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 12 Jul 2013 13:12:59 -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 1Uxji1-00064U-WF; Fri, 12 Jul 2013 21:12:54 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, Paul Brook , Aurelien Jarno , Jia Liu , Alexander Graf , Blue Swirl , Guan Xuetao , Riku Voipio Subject: [PATCH 6/8] linux-user: Enable NPTL for OpenRISC Date: Fri, 12 Jul 2013 21:12:51 +0100 Message-Id: <1373659973-23289-7-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1373659973-23289-1-git-send-email-peter.maydell@linaro.org> References: <1373659973-23289-1-git-send-email-peter.maydell@linaro.org> X-Gm-Message-State: ALoCoQnv5m1ywiOjF6iYBAZbStzzH1B1E+21uFzpyCWlQTa000kD5++CftY5D4IgzoE6JMppCw6D X-Original-Sender: peter.maydell@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.176 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 --- 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