From patchwork Tue Jul 23 15:48:56 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 261107 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 DBEB32C00A7 for ; Wed, 24 Jul 2013 01:52:15 +1000 (EST) Received: from localhost ([::1]:53771 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V1esm-0000Du-5S for incoming@patchwork.ozlabs.org; Tue, 23 Jul 2013 11:52:12 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57524) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V1eq4-0005NX-Lu for qemu-devel@nongnu.org; Tue, 23 Jul 2013 11:49:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V1epw-0001Yf-Nq for qemu-devel@nongnu.org; Tue, 23 Jul 2013 11:49:24 -0400 Received: from afflict.kos.to ([92.243.29.197]:45170) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V1epw-0001Y2-Gw for qemu-devel@nongnu.org; Tue, 23 Jul 2013 11:49:16 -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 AA5DA26551 for ; Tue, 23 Jul 2013 17:49:13 +0200 (CEST) Received: from voipio (uid 1000) (envelope-from voipio@kos.to) id 5e07ee by kos.to (DragonFly Mail Agent); Tue, 23 Jul 2013 18:49:12 +0300 From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Tue, 23 Jul 2013 18:48:56 +0300 Message-Id: <442a59c8ddc55f327ec0219d810fe4580177716a.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 06/21] linux-user: Enable NPTL for OpenRISC 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 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 - linux-user/openrisc/target_cpu.h | 9 +++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/configure b/configure index 0b19408..bfad34e 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" 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