From patchwork Sat Jul 29 03:51:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Pitre X-Patchwork-Id: 9869723 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 64FD36035E for ; Sat, 29 Jul 2017 03:53:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 57FA328799 for ; Sat, 29 Jul 2017 03:53:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4CE12287AE; Sat, 29 Jul 2017 03:53:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D8DE028799 for ; Sat, 29 Jul 2017 03:53:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=XXwWKuwrYYLolT5eIwkPEVzHSRXGlE7t4F17HQl1rL8=; b=ncfWr3Js/pXczAfasHsz4gGtBy 31ZfoS6DDp0LHum6l0ZFkhqHQbNIWvflcEfn1r311QK4J00Qbm/zzBGFoEpOBHrlSaPl6+zwmbvue +0x4QRL865OnsRzDoNs/AHePbwWTzbZp782Wc66n3IpIC0QKCMJq1BNd5fiut0gqRIg3vcJvQHmJT fnVgAKOAF7F5Mh5Ok7MrXiuhQRJqZ77m5eAAEf6eGD3hbcqfWnkPJxhOYkiBI20Dk0W/RTSrFB/Oc G76SgxEHg5A+59kpCeiObEhfk1nNdWrLTu2hWh1ebWR4xO1TlKL+YX3EN0DT5Uvas382UM02UwfVh 1ftxwWrQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dbIoi-0002Va-65; Sat, 29 Jul 2017 03:53:28 +0000 Received: from pb-smtp1.pobox.com ([64.147.108.70] helo=sasl.smtp.pobox.com) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dbInb-0001c5-D6 for linux-arm-kernel@lists.infradead.org; Sat, 29 Jul 2017 03:52:23 +0000 Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id A8B229EE27; Fri, 28 Jul 2017 23:51:57 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:date:message-id:in-reply-to:references; s=sasl; bh=thVQ tBK3w2DSkncX9g72fIittds=; b=ETGqawvB4cep/CAq+5e57QY5cPS7xbDipmNp Cd+c97TAyIzcKAx8YbDrdhvbHd/168mcjN1afCfd9h9hiyZ2WL9DXLG4evWfd0eY txdqNfMwxtWxXpo+TupXlQHxnBj6EC49mNyF7x7UuPJa+WegoO4Mt6vadoLg3XDg goQQd3M= Received: from pb-smtp1.nyi.icgroup.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id A0D739EE24; Fri, 28 Jul 2017 23:51:56 -0400 (EDT) Received: from yoda.home (unknown [96.23.157.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp1.pobox.com (Postfix) with ESMTPSA id F13CA9EE20; Fri, 28 Jul 2017 23:51:55 -0400 (EDT) Received: from xanadu.home (xanadu.home [192.168.2.2]) by yoda.home (Postfix) with ESMTP id 574F32DA0670; Fri, 28 Jul 2017 23:51:55 -0400 (EDT) From: Nicolas Pitre To: Russell King - ARM Linux , linux-arm-kernel@lists.infradead.org Subject: [PATCH 3/4] ARM: implement get_tls syscall Date: Fri, 28 Jul 2017 23:51:49 -0400 Message-Id: <20170729035150.5214-4-nicolas.pitre@linaro.org> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170729035150.5214-1-nicolas.pitre@linaro.org> References: <20170729035150.5214-1-nicolas.pitre@linaro.org> X-Pobox-Relay-ID: 43DF34A8-7411-11E7-91F5-FE4B1A68708C-78420484!pb-smtp1.pobox.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170728_205219_634007_4DBF5E98 X-CRM114-Status: GOOD ( 12.20 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Mickael Guene ." , Alexandre Torgue MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP When there is no dedicated register to hold the tp value and no MMU to provide a fixed address kuser helper entry point, all that is left as fallback is a syscall. Signed-off-by: Nicolas Pitre --- arch/arm/include/uapi/asm/unistd.h | 1 + arch/arm/kernel/traps.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/arch/arm/include/uapi/asm/unistd.h b/arch/arm/include/uapi/asm/unistd.h index 28bd456494..575b25fc29 100644 --- a/arch/arm/include/uapi/asm/unistd.h +++ b/arch/arm/include/uapi/asm/unistd.h @@ -35,5 +35,6 @@ #define __ARM_NR_usr26 (__ARM_NR_BASE+3) #define __ARM_NR_usr32 (__ARM_NR_BASE+4) #define __ARM_NR_set_tls (__ARM_NR_BASE+5) +#define __ARM_NR_get_tls (__ARM_NR_BASE+6) #endif /* _UAPI__ASM_ARM_UNISTD_H */ diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c index 948c648fea..43c0560f7b 100644 --- a/arch/arm/kernel/traps.c +++ b/arch/arm/kernel/traps.c @@ -647,6 +647,9 @@ asmlinkage int arm_syscall(int no, struct pt_regs *regs) set_tls(regs->ARM_r0); return 0; + case NR(get_tls): + return current_thread_info()->tp_value[0]; + default: /* Calls 9f00xx..9f07ff are defined to return -ENOSYS if not implemented, rather than raising SIGILL. This