From patchwork Mon Nov 2 23:30:36 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yury Norov X-Patchwork-Id: 7538831 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 8FA96BEEA4 for ; Mon, 2 Nov 2015 23:35:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id ACCAE20380 for ; Mon, 2 Nov 2015 23:35:53 +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 CE2CC2026C for ; Mon, 2 Nov 2015 23:35:52 +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 1ZtOc2-0006Wj-2e; Mon, 02 Nov 2015 23:34:06 +0000 Received: from mail-bl2on0075.outbound.protection.outlook.com ([65.55.169.75] helo=na01-bl2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZtObA-0005Vc-DN for linux-arm-kernel@lists.infradead.org; Mon, 02 Nov 2015 23:33:18 +0000 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Yuri.Norov@caviumnetworks.com; Received: from localhost (109.252.143.100) by CO2PR07MB620.namprd07.prod.outlook.com (10.141.228.156) with Microsoft SMTP Server (TLS) id 15.1.312.18; Mon, 2 Nov 2015 23:32:48 +0000 From: Yury Norov To: , , , Subject: [PATCH v6 07/17] arm64:ilp32: add is_ilp32_compat_{task, thread} and TIF_32BIT_AARCH64 Date: Tue, 3 Nov 2015 02:30:36 +0300 Message-ID: <1446507046-24604-8-git-send-email-ynorov@caviumnetworks.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1446507046-24604-1-git-send-email-ynorov@caviumnetworks.com> References: <1446507046-24604-1-git-send-email-ynorov@caviumnetworks.com> MIME-Version: 1.0 X-Originating-IP: [109.252.143.100] X-ClientProxiedBy: VI1PR05CA0030.eurprd05.prod.outlook.com (25.162.33.168) To CO2PR07MB620.namprd07.prod.outlook.com (10.141.228.156) X-Microsoft-Exchange-Diagnostics: 1; CO2PR07MB620; 2:fd8670GmsQx8ujMoqwDDZyDVl1Gtzwy2mIaLtzZU9o+hqspCPDbGgJsKUOcLuNKP7ZYOYNOl21HOwFBs+Z4GPI4miv911hLFeYAx+4ECa0VVVS5ZsBsU9e/v95vHzoneEtDnUh2L36caCuKBUjU/e0MLUN8vR9OtYx8gCGyM3y4=; 3:IdE10NMDYkHZgonnINgT2JDnTXuBQXkqeVUOv8J1DQhyPMMa7mEdKOyhe0OyzjDV29sR47XnXcxW+rca2kjIEudxvgwpL2UlpB5JQd66pKg7u6t6PgnazEM7N8jere0EYZJKM8B9HOo2XydenQowcQ==; 25:kslVCNYR2YpNLbyeSyjQ8ZFWWdXTjx0uZQd63EDFYqvzpCXGb/067uiPXCz+TBI4ebjyXjWCFT+mklhCZH2HOf7I2Dr1+IDu1DyU2VO0I/GZ20VWWWaMOojET7Bx+vBKFiD9FT6dPPrSxHxluZl6hSX43wX5gjaqlUYPRdkLilrcN3DSGoyE6DtEMpZkhvvWsot2RuAXvCM0W8Xz9Bmitt+F1OhsNsGMQQ2pUucJxaRD/hLHgp4xGUXqi37/qC17IzGgaRr3JJOKjyROsuXiVg== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CO2PR07MB620; X-Microsoft-Exchange-Diagnostics: 1; CO2PR07MB620; 20:A+j1oV9Zfne8dtnohO7G8NFStvMCJKAoPDzVbNzi5q+giwdXS5Jw0UXtcQM1l3u/Z8xh6mC8lxAXZHZ0tqY1vAFLDANEBEemcVxlflUp+Eu/8I8b4fzW8YzrApW6gOZ0FOFdSntxldv8LKtUGH56i5+Sb6Jx9tseDQCI9oq+QhHu3bsiEK4RZMfeo6BEG4FWhrDNm59AU0BzeDsv/clrv7k4MRk9/Afouwtv6IBLBOxPfwqmfii0fBF90zPJriHZbZz/cMrCC13V+KjeBJFrKKTyQpblkW6VRBsk8+/ApchAVm8bMcuz4jZiNf2HrgNgw2sWPp2U4NSe5ttrnTPtZVBfFWWn3j8/6/mHfAwZ/k53D+SoXXZ7peAGEdAYmVbJmLSDhIYQPa4PKND3GmyVPd+w7iuiDv1tQHeybLSLRD8CboiNVrMtkDfPA4L4WGJsEU05LhrDWQSZiL6iJbGPSHkbPZSp1gWozQ/uUU5pkIVcwFPwbacfGdo0OtUtdf8NyQTFrWmB3v9BoSa0pipoHCgvUviW/0WDajpVrKFfLvUtllSSqKLhAXGUNFyODraci+4wkJRhkDcdiwnOvU9dBK/KuGJnFK2t7AAPqEhh5Ac= 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)(520078)(5005006)(10201501046)(3002001); SRVR:CO2PR07MB620; BCL:0; PCL:0; RULEID:; SRVR:CO2PR07MB620; X-Microsoft-Exchange-Diagnostics: 1; CO2PR07MB620; 4:VpFzjRHgSeLTFbn4c508Ql6BTYiIzwqmHjZtaTJY5muRHtS6ab/j04B9RDwry68OfjKlDSrp6+3Vnqh8sz0HiFG3likDZAKdI0hQV2hRtSlInia4GTQnYreXPWFgRsevOp1v1ilE2FtlQiTCNW/ss7fVOZtkwBviRQBEA6SpezMP8UEjt41RHEt/xvwMlq54kj7AFSNproEGWoOqghJdgC452s8OZjchhrIRoH4x43ureovQHJX47zIMeTxxj25QvE45lGI2VgiNTZJ4Tv4v7f7gi4apYYJray2coLLM3ACLgHftoUAPpCYt5VRL34yvEq+7fKufT1GULnfdewxN2UYcN6han60Eh6iOqQwyel3S1JvQknjZaA7No7zh829L X-Forefront-PRVS: 0748FF9A04 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6069001)(6009001)(189002)(199003)(66066001)(48376002)(50986999)(47776003)(5007970100001)(5004730100002)(5003940100001)(4001430100002)(40100003)(42186005)(101416001)(50466002)(76506005)(19580395003)(19580405001)(33646002)(76176999)(50226001)(105586002)(107886002)(106356001)(189998001)(5008740100001)(229853001)(122386002)(5001960100002)(2201001)(2950100001)(36756003)(87976001)(5001770100001)(81156007)(77096005)(92566002)(97736004)(142933001)(2101003); DIR:OUT; SFP:1101; SCL:1; SRVR:CO2PR07MB620; H:localhost; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A: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; CO2PR07MB620; 23:2B//QgXhGMirfesZEV6xnQPuVU1zoIPTIA+79BbLun?= =?us-ascii?Q?tOklllAQLFYknVhA9gIcyPmxcE7O+Ip9WnDwy6z/WredjjH7wyVnTfZ1Jvu9?= =?us-ascii?Q?PqMQnqJWX2KC80Vkt50PTriXtlCBVNKtod2AxQ8B0d5dMFKM3zmUjL8Pta0m?= =?us-ascii?Q?Y6yZTZTWyh5Yl1Qrf7UGbiwz0U5uZBgdjyQfxGflxNG9qWAFcW+9CmuUcSGk?= =?us-ascii?Q?SKR1b9Oz+OXssBeOpryLe0Z8xpiBmIuAvm5fEMHvuN9xCTlob0yZaFqyrcbt?= =?us-ascii?Q?iWlMDK9mFeh0lNio43Id4Kt1NftqlLMlwp46oiYMxW2k+UloT03LdBxQ0g7A?= =?us-ascii?Q?GIlGE5CaAyD13x0czff3l7p73P8sTCqJMuygA9mQN2dzZeMLeij+iCo9z7bE?= =?us-ascii?Q?zoQ4TOtMpb02rX9Qze4ySFTtSOzPZV/xFn7DkdgLqTIDNR0Y1yQmAnaPhZhE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A9B9FX+qADnAa7MZXGOyr7oV526oUpnCgtZl56gykbkmOKHO9xxrgHzNfg3rc3PeHk5GB+78Ag=; 20:H8+sopntWvTRPfXp0YzQ3g7ZS9jdv1w57W9/DSTeWrEPmTGf5gp+gT8f/KkjmFtQ6D1ilwG9ysFOr0H+bAJ0bQ== SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Nov 2015 23:32:48.6967 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO2PR07MB620 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151102_153313_229176_FBB1654A X-CRM114-Status: UNSURE ( 9.39 ) 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, Nathan_Lynch@mentor.com, agraf@suse.de, klimov.linux@gmail.com, Andrew Pinski , broonie@kernel.org, jan.dakinevich@gmail.com, Andrew Pinski , ddaney.cavm@gmail.com, bamvor.zhangjian@huawei.com, Yury Norov , philipp.tomsich@theobroma-systems.com, andrey.konovalov@linaro.org, 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 From: Andrew Pinski Signed-off-by: Philipp Tomsich Signed-off-by: Christoph Muellner Signed-off-by: Yury Norov Signed-off-by: Andrew Pinski Reviewed-by: David Daney --- arch/arm64/include/asm/compat.h | 38 +++++++++++++++++++++++++++++++++++- arch/arm64/include/asm/thread_info.h | 1 + 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/arch/arm64/include/asm/compat.h b/arch/arm64/include/asm/compat.h index 9700e5e..95d2d72 100644 --- a/arch/arm64/include/asm/compat.h +++ b/arch/arm64/include/asm/compat.h @@ -324,9 +324,35 @@ static inline int is_a32_compat_thread(struct thread_info *thread) } #endif +#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 + static inline int is_compat_task(void) { - return is_a32_compat_task(); + return is_a32_compat_task() || is_ilp32_compat_task(); } #else /* !CONFIG_COMPAT */ @@ -341,6 +367,16 @@ static inline int is_a32_compat_task(void) return 0; } +static inline int is_ilp32_compat_thread(struct thread_info *thread) +{ + return 0; +} + +static inline int is_ilp32_compat_task(void) +{ + return 0; +} + #endif /* CONFIG_COMPAT */ #endif /* __KERNEL__ */ #endif /* __ASM_COMPAT_H */ 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)