Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753831AbdFSPwe (ORCPT ); Mon, 19 Jun 2017 11:52:34 -0400 Received: from mail-by2nam03on0064.outbound.protection.outlook.com ([104.47.42.64]:56419 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752176AbdFSPw3 (ORCPT ); Mon, 19 Jun 2017 11:52:29 -0400 Authentication-Results: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=caviumnetworks.com; From: Yury Norov To: Catalin Marinas , Arnd Bergmann , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org Cc: Yury Norov , Adam Borowski , Andreas Schwab , Andrew Pinski , Bamvor Zhangjian , Chris Metcalf , Chris Metcalf , Florian Weimer , Heiko Carstens , James Hogan , James Morse , Joseph Myers , Maxim Kuvyrkov , Nathan_Lynch@mentor.com, Prasun.Kapoor@caviumnetworks.com, Ramana Radhakrishnan , Steve Ellcey , Alexander Graf , Mark Brown , christoph.muellner@theobroma-systems.com, davem@davemloft.net, Geert Uytterhoeven , Alexey Klimov , linyongting@huawei.com, manuel.montezelo@gmail.com, philipp.tomsich@theobroma-systems.com, schwidefsky@de.ibm.com, szabolcs.nagy@arm.com, zhouchengming1@huawei.com, Andrew Pinski Subject: [PATCH 10/20] arm64: ilp32: add is_ilp32_compat_{task,thread} and TIF_32BIT_AARCH64 Date: Mon, 19 Jun 2017 18:49:53 +0300 Message-Id: <20170619155003.13218-11-ynorov@caviumnetworks.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170619155003.13218-1-ynorov@caviumnetworks.com> References: <20170619155003.13218-1-ynorov@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [85.253.137.34] X-ClientProxiedBy: VI1P190CA0030.EURP190.PROD.OUTLOOK.COM (10.165.188.171) To BLUPR0701MB1858.namprd07.prod.outlook.com (10.162.88.144) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a98250db-9d18-4fe1-712d-08d4b72b2e4c X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(201703131423075)(201703031133081);SRVR:BLUPR0701MB1858; X-Microsoft-Exchange-Diagnostics: 1;BLUPR0701MB1858;3:3lntzoNITZOoZZykNAtYFdqgnftSYHRET6T4fwNAPba9vZhOuTyx2DdJkFHOSCX/M371RJNJQMh7OZaaSC1V+BqqQCHdiZvWQCmCs0wiDm2+/SZy0CIYrLXnoZnKpWxazSVrCdd4ylD8yVF1dKTN4Vz4eeRErXpsTOsJlNvIT9P6q8yCoonCWWyfiFGTjSGpJegfXVb4fp8fD8mltL4erAdOLEMSPOFHcPzzZ3jq5Da8Wot2ZYXQr3YCvfoLz7vyRqTsVm3J6E5QrvgnIuKgkURsjnLLRk2hjkdzALLsPcLpYTvGqw5vwx5BdrETFhiJ94Vs+2JICH1iWSQ8+ylGvA==;25:XOdUuQii5BEul8ZZm7qSWkLuUFi5CT/JBYPybXZCjx11SnLwpQ0loZpfc0Z7N1kzEpzPgcY4Ba9H4b6LFN/kSbZT9xmS9NiJoCwdXJNBXuIiOobE+zMImOSiauNYMUcRClPtkpP/v6pWRrrUgIqzVZ3mT2pSZqfGR06377yG0oXtfxnh2rpP5lT37MYNF7xh+Nvah/9q74tiiU3fCR5BK+BVP0Cr374uquCjJO9eY+aWgZeraOxpbcdFm3WplQVpafYo6JPf9fPmezhoZS1dase5uRgQ4SfHmIVZPwhbrf5Vo8NoJzIcAUmLe2Hnesof5Ljh9G9X9OJCoXzjjeJnPNtFJ5wTF7h3x484Ct8BsgkDLEL7xPpbEaTQkOh0jyEbBkb6SF7Z0TGAk8l/wDT4GaOpgEKO5fJZ3E1RWegLAqGn8klsZcmpaKmvnyqHiaXrcCFacgyf9V12j57TsGsZkg3WvumKuk7pZCItOhpOb7A= X-MS-TrafficTypeDiagnostic: BLUPR0701MB1858: X-Microsoft-Exchange-Diagnostics: 1;BLUPR0701MB1858;31:18XnFW+AS0tSl+rCFdY4YodtsEJ8noepaCl6H1iQIwE9QyYsMxAMRw1CMoltGdqUeYsDkVK7GY12KONiiFiG0dVEM8ZDyASmvlupKfVDgMtchj2rfHx2olsa3ZHua5GkC3IXpqUAFU+94KJWrdXahgm3eWiB1Aa+PKiGvsgPsuK2wak0CT1lcP7+AIbiTuPcBSpoUsYOlEg/F9H+utoQt6m0nkYb0bhj/Qlyc/x+M7g=;20:9vYBYPWDsCiuXmoWrdM2bp3O3Fz/UFy5FogD9LjXUbF8Z0hsWzMpZ2vS8l8ChMZ/TxXy5p5To9ZoYUnlzbNIlfmZWXuh+yvRDE0kgqP7idRUpVnTOtqGWV8bA7eeNvHA9huIKbrJuhMNz4fScc7opeGy1xitAHyxZ2OgQDtu44wF9+6K53lX/e62HguGNGYOGVbdKcguZVaePZNYfmS+77GkQ3cVYVpPs7YZg3Y2nMXjVzbQvDmF7BRrm1DuSpcSOcIQzle2feOuYCl4iSklEMU8oQG+DjEQPwcDqTYXvPMj69vW7UKVQuhMJtDA7dTYAJ0V8Upixo7Ijn746WpkvtsBCmjvgnUAb40qGvR2otbJMBTWXk9MDC1DhDoMH4Q4Svh/qEGak/ZRFReQAqQv2Vkl5K9FD6eQ+Gmv9QnP4BfKR+PABEV/lwflXmaiIBOhqdczeQVm6aOpir+0Fq+U7lruLmWzJiLjpUOd2OauAI67+5ccgLkESJjPzFa63DzzsRGCbQNmGwtdElLQ8plG8P2KUMXc967izxJ4YpUEynRGneXS9l52duDKEnHmGqEESpW6Dmw+WXRTmL/ipJyRlkzBB0nTLi4Sqcg1n9JQzyM= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(100000703101)(100105400095)(10201501046)(93006095)(3002001)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123560025)(20161123564025)(20161123562025)(20161123558100)(6072148)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:BLUPR0701MB1858;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:BLUPR0701MB1858; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BLUPR0701MB1858;4:xq8ynQbnyF19TssxXIMkvPF5qtcxU8y4Smxusd4m?= =?us-ascii?Q?zsikyUqyrFuk/D97fNELZzJco9KY4YEtKY4QUugxyow1ZFRCh7wztyl3cYC3?= =?us-ascii?Q?wvwVzl9z5VUrGArtXYEZcy+nNd7BFDmplsy0lUiQsYhmp8Dnx/Ux824kyW/7?= =?us-ascii?Q?TdkvjpdMT0Kmb1fRFb0TjuHjAW/ZYoXOKW2LvUpiWeYfjQbDWcbpVl/vBECS?= =?us-ascii?Q?gwA61fD7KyqUyXRC5Tn9rS+jdASM4SORUrevAEZhqRmAj6dTPUzmZQwG9t5C?= =?us-ascii?Q?SqQH0IKkqulKsnY3kcXuFGrwPy6pOceLmL3rXJ4+9bwb06yR70SC3y2jg/E4?= =?us-ascii?Q?DzlaecHsxqZDRZBHD8c4A+37KbDghEEB3iNRt6wBXWGP5OAw63BhnwmlYob8?= =?us-ascii?Q?N3SrfLUdyPdZwSgc4A5BqAVA3jXpeK08P/pug3LmRFbE31r5VQICrP/ahp4/?= =?us-ascii?Q?/4OpzBtnvozMbwCTc/59760X1kEy7w9+pw1EpE8wyXkRUMrwJ3UQ6KegEz3d?= =?us-ascii?Q?zj8/x8sYr+sc5O7v0VRR8i01PduZLJ3N3iTp+InDno8aKd4dTiTbdQ+0U15m?= =?us-ascii?Q?vDK+apFzFUMr0NxoWjXGT7NI7TXau6RCa2jjMfXSRjN8k3cIqSglFCJkNb4j?= =?us-ascii?Q?qdPAEJ+CCND7yTXFKj5LYmD6Pbu5BSVIXQwFScU+I2EOfthbCGsWr2f7GeBO?= =?us-ascii?Q?hPQo1ls8RI536DQcUhcp1AYaoj9pwuMEW8W+0whqWRzKe0c+A6Tx994MMJWi?= =?us-ascii?Q?lJBpG4sFhO/EABmTZmYnXzNOe95bkElbft2j9E6OgZQwaEjEoyzJCbk2wT2n?= =?us-ascii?Q?K9gx0yHZsIA4JYNufF1Cgtm7pqAGDaQW82NLVLWV/hv2h7Kss1BXgZ+xswQl?= =?us-ascii?Q?8JmB577EM5YQ2qAE7K916wTINigVUBs1Q1zpodZR8WRN4d7r3erYJWZuPtus?= =?us-ascii?Q?+49C99sByGR+XqHVeHismLCFBAWLA2rIwNMzglYevJGDjToLLVRrCylWciiW?= =?us-ascii?Q?Hs2bqqKOICKJ+3UjWhfr6Sn8+MRis2jh1e+EEGu06+Nj/zTHu2EHwuZzfeA7?= =?us-ascii?Q?s3say/BxKcBT7TH87ZTFVHhQRk08kdcNGVuSSO8JHQKj98d8fW4/Une0SCU/?= =?us-ascii?Q?2APPig8MjWM=3D?= X-Forefront-PRVS: 0343AC1D30 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(6069001)(6009001)(39840400002)(39410400002)(39400400002)(39850400002)(39450400003)(6486002)(50466002)(48376002)(36756003)(305945005)(2906002)(107886003)(38730400002)(6496005)(42186005)(76506005)(76176999)(189998001)(54906002)(50986999)(53936002)(66066001)(25786009)(6666003)(72206003)(2950100002)(33646002)(478600001)(1076002)(8676002)(7736002)(6116002)(3846002)(5660300001)(7406005)(7416002)(50226002)(5003940100001)(42882006)(47776003)(81166006)(15760500002)(142933001);DIR:OUT;SFP:1101;SCL:1;SRVR:BLUPR0701MB1858;H:localhost;FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BLUPR0701MB1858;23:Giraf5U44mA1n9J/uVIjVzJniaxapCvCoih6Nx7?= =?us-ascii?Q?5YYic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VG4Ljf?= =?us-ascii?Q?5USqLt5gRTXmGHEBq/UYDIgIpwx13Fq0+PRV/3+RlMSmGZWBSrOw3vNjV+Vs?= =?us-ascii?Q?jlnycZpEREgNv6HXIiPyV82ohoZR08p3UDP1WZosw+4R6/RWnvreLGi+OvWP?= =?us-ascii?Q?+6+pmQwwFbqz2IlrniJp0rCGH9jRzvzZS6ZXU5vyRK8jCObu4hJeDXcLdxy0?= =?us-ascii?Q?J68HUfiiHLLT2eiqMyAoUX6xWgZSE8KPiLTkcSyJc4yjYU7OOhgVCFA=3D?= =?us-ascii?Q?=3D?= X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BLUPR0701MB1858;6:vq+pumivrBvoXZY3KwAWYwdcwWNI4mey5o4ti8VL?= =?us-ascii?Q?q55OdPGodZIJj6xvIrmekiKHfDkzEDgpJj3sA2okLyuXs7MSGWQr2qccNGEg?= =?us-ascii?Q?wbFepIV8HiVl3GVZXBnKcUVxFxSKYYxHc719VHW8gPK85PF0rXMsu7aeYoUa?= =?us-ascii?Q?RSgAfkPxezRMejya8pzTMlJTbpi2M880W9RgwlXrcZtPmH9GCj99SrKAXzQX?= =?us-ascii?Q?CaHLsNBUjtg8v1lTxwfblIYDnIqCvkOjJbD0yP3IQDw84ExlV0RVhvQD1Npk?= =?us-ascii?Q?jXeCM6X2rs5jnTqao+q78ievrJWou0chS6rcUkwgqvvNGhWCPVID13oxnzwl?= =?us-ascii?Q?QCXfq9SqwWp/KLSo8gsYuI60zCFjXBdyLnFAdSlDarhVomdtLki8m7kA97DA?= =?us-ascii?Q?SkqjoYwvU+qEtiG+FoZVtOkkmmod/ygZJLLojhpYhG4TYWVXMlwx1NAD7Xgb?= =?us-ascii?Q?lrjnC50w8sKbRhM+cxYRPRHqw7dHYqdJ0PaNGMD6vpnHo9+/eCWlhlwvP/ZJ?= =?us-ascii?Q?sS5QDr4c+iVq8/YJBd71EcJYXZ/D0tDteWZtI89QljDwcqEV2hx9AOdocQIX?= =?us-asc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/cRz;24:YHtnwqQkFxWy1OkEZp2OHakUoNcI45bqAWTKJ25wLbMeNO1THP5Zx8nwW+fN1j7sQmweMMjIdCiep4ZghqF6i31ykJvOXmfgFe48NVR4hEs= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;BLUPR0701MB1858;7:lL876/lBfEranKJNEm5fm2s5AptAOrj/mybHrI6SLlmTaq/8oII+k94hG0eLF6Bm8DCVaI+V4wN5iMMghzPu441GL1O8PuzozUBqDfA35gvCyBxMyhcz0/Iv5Im3X2WsirG2mfDu+QTu7dhYa/EmwP18wEO5AS/oxbD6sMsFJ7RdLH0YIE3X/n7LfBtIOZmCGdP2L/mE8v0RHJZpCdR1GsQdOo1i4/HoIvNETyOf8Od7xo+HCI/JRqiWW6F3G8sY4nJt0PliJI4cWgEqdWLf6JZGUjBD3lCP3YPXwEgoRjaG7ZN9ajlZiulfw6bNWZERSAT5EJ10KwFQyLG2bMlQy2QH1TrseStyDUv9hlMWc6jhzlHzNlPPzxYq2UH5sRfkPuRGp/By9/s7K/5Z6wjldBoP4fF8J2tep3bIDdYO0dttwcxm84jBpqZdD5MbU11GwL4uTK8TFXHHS66jKRiWNdsSPcyrv4F+HAUUsWNJcqhKiMk/dxCsSUA9k6+l036glUhzZDChRIS6BmZiS95GbnnwG6+SgGXStBqagakjfuNFURqWD/gc8TUAW5V8YvJtlkPk/e8l0xnDxey1eIzGTJCd5BanbH2qep61jHZCLS4D4I6qSQP7Xr574CoXtrHbB/JHMrbvQSL/1dHJZ9FjQbsjdqWvLLVlJWzS7CjKPe/zMAfX0h6ole6zEUtS8J0BUQbf8RLonNC/6t4Ee09D5zxUFCIzXg4eIOrt4ryGJ9Ae8tS348MkOmMvFA4XaiSQorZmk7uIBEtd3gsJCop++os1EtFC/iWeBz1JXqUidjE= X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jun 2017 15:52:25.0883 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0701MB1858 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3697 Lines: 111 ILP32 tasks are needed to be distinguished from lp64 and aarch32. This patch adds helper functions is_ilp32_compat_{task,thread} and thread flag TIF_32BIT_AARCH64 to address it. This is a preparation for following patches in ilp32 patchset. For consistency, SET_PERSONALITY is changed here accordingly. Signed-off-by: Andrew Pinski Signed-off-by: Philipp Tomsich Signed-off-by: Christoph Muellner Signed-off-by: Yury Norov Reviewed-by: David Daney --- arch/arm64/include/asm/elf.h | 2 ++ arch/arm64/include/asm/is_compat.h | 30 ++++++++++++++++++++++++++++-- arch/arm64/include/asm/thread_info.h | 2 ++ 3 files changed, 32 insertions(+), 2 deletions(-) diff --git a/arch/arm64/include/asm/elf.h b/arch/arm64/include/asm/elf.h index 6a37b6facc69..8f7bafa60d01 100644 --- a/arch/arm64/include/asm/elf.h +++ b/arch/arm64/include/asm/elf.h @@ -145,6 +145,7 @@ typedef struct user_fpsimd_state elf_fpregset_t; #define SET_PERSONALITY(ex) \ ({ \ clear_bit(TIF_32BIT, ¤t->mm->context.flags); \ + clear_thread_flag(TIF_32BIT_AARCH64); \ clear_thread_flag(TIF_32BIT); \ current->personality &= ~READ_IMPLIES_EXEC; \ }) @@ -196,6 +197,7 @@ typedef compat_elf_greg_t compat_elf_gregset_t[COMPAT_ELF_NGREG]; #define COMPAT_SET_PERSONALITY(ex) \ ({ \ set_bit(TIF_32BIT, ¤t->mm->context.flags); \ + clear_thread_flag(TIF_32BIT_AARCH64); \ set_thread_flag(TIF_32BIT); \ }) #define COMPAT_ARCH_DLINFO diff --git a/arch/arm64/include/asm/is_compat.h b/arch/arm64/include/asm/is_compat.h index 8dba5caaf5d1..7726bebc4115 100644 --- a/arch/arm64/include/asm/is_compat.h +++ b/arch/arm64/include/asm/is_compat.h @@ -45,18 +45,44 @@ static inline int is_a32_compat_thread(struct thread_info *thread) #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 */ static inline int is_compat_thread(struct thread_info *thread) { - return is_a32_compat_thread(thread); + return is_a32_compat_thread(thread) || is_ilp32_compat_thread(thread); } diff --git a/arch/arm64/include/asm/thread_info.h b/arch/arm64/include/asm/thread_info.h index a7ffea24d94d..abb60b5fc9f4 100644 --- a/arch/arm64/include/asm/thread_info.h +++ b/arch/arm64/include/asm/thread_info.h @@ -96,6 +96,7 @@ struct thread_info { #define TIF_RESTORE_SIGMASK 20 #define TIF_SINGLESTEP 21 #define TIF_32BIT 22 /* AARCH32 process */ +#define TIF_32BIT_AARCH64 23 /* 32 bit process on AArch64(ILP32) */ #define _TIF_SIGPENDING (1 << TIF_SIGPENDING) #define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED) @@ -108,6 +109,7 @@ struct thread_info { #define _TIF_SECCOMP (1 << TIF_SECCOMP) #define _TIF_UPROBE (1 << TIF_UPROBE) #define _TIF_32BIT (1 << TIF_32BIT) +#define _TIF_32BIT_AARCH64 (1 << TIF_32BIT_AARCH64) #define _TIF_WORK_MASK (_TIF_NEED_RESCHED | _TIF_SIGPENDING | \ _TIF_NOTIFY_RESUME | _TIF_FOREIGN_FPSTATE | \ -- 2.11.0