From patchwork Tue Dec 15 21:42:34 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yury Norov X-Patchwork-Id: 7857641 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 09D40BEEE5 for ; Tue, 15 Dec 2015 21:52:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 27B722037F for ; Tue, 15 Dec 2015 21:52:06 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CE0C1203E6 for ; Tue, 15 Dec 2015 21:52:04 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1a8xUa-0000oy-1R; Tue, 15 Dec 2015 21:50:44 +0000 Received: from mail-bl2on0096.outbound.protection.outlook.com ([65.55.169.96] helo=na01-bl2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1a8xSK-0006AG-64 for linux-arm-kernel@lists.infradead.org; Tue, 15 Dec 2015 21:48:28 +0000 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Yuri.Norov@caviumnetworks.com; Received: from localhost (95.143.213.121) by DM2PR07MB624.namprd07.prod.outlook.com (10.141.177.154) with Microsoft SMTP Server (TLS) id 15.1.337.19; Tue, 15 Dec 2015 21:48:01 +0000 From: Yury Norov To: , , , Subject: [PATCH v6 08/20] arm64: ilp32: add is_ilp32_compat_{task, thread} and TIF_32BIT_AARCH64 Date: Wed, 16 Dec 2015 00:42:34 +0300 Message-ID: <1450215766-14765-9-git-send-email-ynorov@caviumnetworks.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1450215766-14765-1-git-send-email-ynorov@caviumnetworks.com> References: <1450215766-14765-1-git-send-email-ynorov@caviumnetworks.com> MIME-Version: 1.0 X-Originating-IP: [95.143.213.121] X-ClientProxiedBy: AM3PR01CA026.eurprd01.prod.exchangelabs.com (10.141.191.16) To DM2PR07MB624.namprd07.prod.outlook.com (10.141.177.154) X-Microsoft-Exchange-Diagnostics: 1; DM2PR07MB624; 2:Mfo1ZCZ+LEics5OSW98zaUqNxaiDPZmQFNqVbfogYkVI7lBigiF92UGXd2X0Nn2bkSeY80K/2nlxKuHMUS7Nr8WddvfUD7jVnXC9FNSY2n6kY7fam1mS0pVxrWdx153HwD0H91UOCw8WjyOyCCHefQ==; 3:L0DHMdLibvGYUydtbNj1Lqv7LU0re1GeWpeZF4w8VswzJrqHgVGWKf8ZfBbh3XRtwKl3rkEN+nbA2YkvWx8iXEpghOBETUpf7A+zcoeDAZGemRAX/q+JdAKqdpxPpWY/; 25:IwVtIFYC5nBpGopiSW9OkMWdAs/CpFCBTNgR4R+iZ2huQNAwW6CJYtgL4qlpEs0IlGyW74JnpM8AzmN7h2z7wL9SAuBYCMr7hB8jid8uki5IqWICW7UR3Kc/W0t3jTyFuSe7tO6q0gBQhvh1YruobftoiZtf2SQVmQuv1l3Hh7CxQl1ek5RdJ/w5YzP1WuubOFHIY83sMtorXe85/F7gnIxTC41GOMG3Q9++cbsVLG9gD6scf5ryVq5oORm4HWKvFzrRTyv/vX7AbJ72C5wdUA== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DM2PR07MB624; X-Microsoft-Exchange-Diagnostics: 1; DM2PR07MB624; 20:iAlrvvU9rjz+SVo0DiQ2hUeKjUy6kvc/GSAKjHuWFGdrVmqtChcKXO8zrOiceHVluk1QLNaJDIbSLe7ZLz9EYKGOLzdOfGmFvVd7tEu4EEaKE1oOZIBtWGgNXy/rmBz4CUjucwO7Q8x2yEzB3onG4J06uHLxZqtc5oYPx+ClutIwvRDvYCO+CXZsFmH6wbBal0FXQEPRE3aErY1KBHNLbtb57r/LymCRlvC/3RdCNmiu6LurX9CS5Rybrq0q9zRSz+0mRfuVVDdHShYy8SMclzYclUUJtGmoG1YUpaBjW5PuaXseN1dKY17Fn5LoN6Lf8nvk3NuB6tTBEXLVNbgn48MAthi3KDBYSwyOoPZSQaQaX/pUkHubk9vDbhAR0OGrJVEncIG9fxKjFGFoUZbXYMNtuVMRwbJR0lHKeEfsIIXY/YoSKfll7QgUmkZzjc+MymDNlSUJYahZx+fiAadPO7xsz90jE9fUBTMKGqEIV29bZ2nEpNocUHOAl36n4R4F8KHeae0Sb6bT+bqFPmsQ+LOnCDYNnvH8gOYF/RGfBKRNYIxDlBlHfrHSrXvED+VKUOmcgX8tnES2zTgkJsubgUAAfoeyqj8YGwnRJhHFWqQ= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(236414709691187); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(8121501046)(5005006)(520078)(10201501046)(3002001); SRVR:DM2PR07MB624; BCL:0; PCL:0; RULEID:; SRVR:DM2PR07MB624; X-Microsoft-Exchange-Diagnostics: 1; DM2PR07MB624; 4:f11eFGjOlkBuSojnlPf9vjOt/aDIYzUv9SHAAVxztgyS0yp90TWxLLtBX+0uyDauPg698zFXHCNK/8yCPq4nofy1uSfBpYUdZPfXXO+8sqODyy2WfvZKpXnLcn3W4xNZweL1ty1q+9BxxNwU9X+biEzpV+FCnvKRqQYzfx+mmg28os02BYBxY14k4jOZV9i7YdPpaCvp+X8mgvYlT47hgG2qnttUUUGhcb4F0dDTCPcvVo9+uMS20HzphF0WFVDlXEvXqOKK3rKjJv/WegFqyNrwgtUgsaKaPDNej+lch6zvB/JYJp+NFLqDgfzMA8+mgzL84juVxKd3L5a4oxNhcDZBQMF6qhbtT95Isczd/vKeQPsKXSGqz2mfeCjJuDZ5hzJHQG/0eXyI7JNICew3qPx5HOLCEyv7tjcpbMNuk6eDrcDDuaoPnUPxJS0a56uk X-Forefront-PRVS: 07915F544A X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(6069001)(199003)(189002)(87976001)(66066001)(229853001)(77096005)(42186005)(2201001)(122386002)(5008740100001)(92566002)(105586002)(50986999)(76176999)(76506005)(40100003)(106356001)(2950100001)(5003940100001)(19580405001)(3846002)(5001770100001)(50226001)(50466002)(47776003)(4001430100002)(5004730100002)(5001960100002)(33646002)(19580395003)(101416001)(81156007)(586003)(36756003)(6116002)(107886002)(189998001)(48376002)(97736004)(1096002)(142933001)(2101003); DIR:OUT; SFP:1101; SCL:1; SRVR:DM2PR07MB624; H:localhost; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: caviumnetworks.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM2PR07MB624; 23:tNWczx5Eati8dlbcGO2ZlOzSp5wGv8FolFpJJDflj/?= =?us-ascii?Q?ttO5+tbhkn2mevob3eV33A0zIfk4TMMwaNJ/9ExigzJRM5mWYOert5ruD8Uk?= =?us-ascii?Q?Rbq7rIH7fUpI3bVnCRieUvFbX0xARi/hWwv+cdjanoMyAwQyjj3mBADI8xI6?= =?us-ascii?Q?H5HlhKu2W/oDiGoiePKUkEqf4tJP9BMMGb8ee98jwZxk/VWxUpqVkPpgyQXI?= =?us-ascii?Q?PSHl5sZmipP1ZnSVQ9+9KfAjWZqQ99c8rE9SNK//UEFrT2/UX6CEjKRHjPSR?= =?us-ascii?Q?RZ+Oj0iLtV+SvdXLwHQ85SpTZe0GJ4o/3SjDmG2p3p/zWZfxLbbhONvKtXY6?= =?us-ascii?Q?KNsKSn9QgKQpbwWCl3sAKucf+QXsAxqqHjhOILcGxOqsx4JAfs6H/huZHdNU?= =?us-ascii?Q?3ewr0BRZRAgwc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oRMpkCd1aHcJ17BiXyPpddpFJf7xup+Hd2lsyHb81DQG+gfIeEALhhCmHw==; 24:swnqQIU20ja3Z42gvuYFZ9pfKWIupjZgfXm18ZPHWy+L8pxTv2sMR5jahS2JqwqgooW2rMozMABFQvhOaiKFeAE/CwBTCC/Op85Bl61UvZ0= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Dec 2015 21:48:01.9315 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR07MB624 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151215_134824_902290_E97F3565 X-CRM114-Status: UNSURE ( 8.72 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -1.9 (-) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: pinskia@gmail.com, Prasun.Kapoor@caviumnetworks.com, schwab@suse.de, broonie@kernel.org, Nathan_Lynch@mentor.com, agraf@suse.de, klimov.linux@gmail.com, Andrew Pinski , ynorov@caviumnetworks.com, jan.dakinevich@gmail.com, ddaney.cavm@gmail.com, bamvor.zhangjian@huawei.com, philipp.tomsich@theobroma-systems.com, joseph@codesourcery.com, christoph.muellner@theobroma-systems.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAD_ENC_HEADER,BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Reviewed-by: David Daney Signed-off-by: Philipp Tomsich Signed-off-by: Christoph Muellner Signed-off-by: Yury Norov Signed-off-by: Andrew Pinski --- arch/arm64/include/asm/is_compat.h | 30 +++++++++++++++++++++++++++--- arch/arm64/include/asm/thread_info.h | 1 + 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/arch/arm64/include/asm/is_compat.h b/arch/arm64/include/asm/is_compat.h index 476db90..89b1f65 100644 --- a/arch/arm64/include/asm/is_compat.h +++ b/arch/arm64/include/asm/is_compat.h @@ -36,7 +36,6 @@ static inline int is_a32_compat_thread(struct thread_info *thread) #else static inline int is_a32_compat_task(void) - { return 0; } @@ -45,14 +44,39 @@ static inline int is_a32_compat_thread(struct thread_info *thread) { return 0; } - #endif /* CONFIG_AARCH32_EL0 */ +#ifdef CONFIG_ARM64_ILP32 + +static inline int is_ilp32_compat_task(void) +{ + return test_thread_flag(TIF_32BIT_AARCH64); +} + +static inline int is_ilp32_compat_thread(struct thread_info *thread) +{ + return test_ti_thread_flag(thread, TIF_32BIT_AARCH64); +} + +#else + +static inline int is_ilp32_compat_task(void) +{ + return 0; +} + +static inline int is_ilp32_compat_thread(struct thread_info *thread) +{ + return 0; +} + +#endif /* CONFIG_ARM64_ILP32 */ + #ifdef CONFIG_COMPAT static inline int is_compat_task(void) { - return is_a32_compat_task(); + return is_a32_compat_task() || is_ilp32_compat_task(); } #endif /* CONFIG_COMPAT */ diff --git a/arch/arm64/include/asm/thread_info.h b/arch/arm64/include/asm/thread_info.h index 7d03565..e72de74 100644 --- a/arch/arm64/include/asm/thread_info.h +++ b/arch/arm64/include/asm/thread_info.h @@ -112,6 +112,7 @@ static inline struct thread_info *current_thread_info(void) #define TIF_SINGLESTEP 21 #define TIF_32BIT 22 /* AARCH32 process */ #define TIF_SWITCH_MM 23 /* deferred switch_mm */ +#define TIF_32BIT_AARCH64 24 /* 32 bit process on AArch64(ILP32) */ #define _TIF_SIGPENDING (1 << TIF_SIGPENDING) #define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED)