From patchwork Tue Sep 29 22:14:08 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yury Norov X-Patchwork-Id: 7290971 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 F10BEBEEA4 for ; Tue, 29 Sep 2015 22:25:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1657720678 for ; Tue, 29 Sep 2015 22:25:20 +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 2D032205FE for ; Tue, 29 Sep 2015 22:25:19 +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 1Zh3JB-0008PE-Qy; Tue, 29 Sep 2015 22:23:37 +0000 Received: from mail-bn1bon0095.outbound.protection.outlook.com ([157.56.111.95] helo=na01-bn1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Zh3Cy-0002vb-4y for linux-arm-kernel@lists.infradead.org; Tue, 29 Sep 2015 22:17:12 +0000 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Yuri.Norov@caviumnetworks.com; Received: from localhost (91.78.158.8) by DM2PR07MB624.namprd07.prod.outlook.com (10.141.177.154) with Microsoft SMTP Server (TLS) id 15.1.280.20; Tue, 29 Sep 2015 22:17:06 +0000 From: Yury Norov To: , , , , , Subject: [PATCH v5 11/23] arm64:ilp32: add is_ilp32_compat_{task, thread} and TIF_32BIT_AARCH64 Date: Wed, 30 Sep 2015 01:14:08 +0300 Message-ID: <1443564860-31208-12-git-send-email-ynorov@caviumnetworks.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1443564860-31208-1-git-send-email-ynorov@caviumnetworks.com> References: <1443564860-31208-1-git-send-email-ynorov@caviumnetworks.com> MIME-Version: 1.0 X-Originating-IP: [91.78.158.8] X-ClientProxiedBy: AM3PR07CA0027.eurprd07.prod.outlook.com (10.141.45.155) To DM2PR07MB624.namprd07.prod.outlook.com (10.141.177.154) X-Microsoft-Exchange-Diagnostics: 1; DM2PR07MB624; 2:EbEmCIMqagNsVRVFxGI7LtgwDLRtRjq+vqgG6P0MLIvQhmEFUxiLGW5xYau3HX+bVOs5OOnFzJiZTDZ35foI6QBEG7zzeJLhJPHSc7S+RCqO28XrPAwywIFHs9DEhcNGb8kx+sFYEr5ObqzUf/nJC0j9tGiTEVWi2p4BoBtmqQI=; 3:bcwPJxSXkKrc4Bf0tfIfvqCy7c62QIDQoGAoAKCyp+2zEJIk3mo6a0JIs0qGUY43UyA4KvGSU+X9Z/w6oCych4wBXS5GbvmhxCbL3PbXbNxvOtDpGIVpuXljx370EQICwn6gNPJVa0gNlG29jFpqMw==; 25:m38GR682jDsTsj/Pj8Lj6wFifCmTQgdbOby+lrWFro/VQOh2rr0R4+NNBy5icmXvxiGIkPf0nGCBgBXssINRWg+yymORowL8RwxXdOO+rLUeoOR1WqxOyRrd6qyaDBlCAMB6GBdhUiDxp0MaTFuWveUY9qgFvwzmN0L3ZTqzeU3E2sFU4r8GamCMX5nxhh409FCHVz7dirhtra3dDA3ztLTGWhbQBf315s5TJDuMBsW6pbZj12MWUaLq1RYOx1p1/9lhbRrNsS9b+mgkF79OwA== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DM2PR07MB624; X-Microsoft-Exchange-Diagnostics: 1; DM2PR07MB624; 20:qrW/ZHJ1xSXtcodj300W5P1UGBGYe16CZh0Hl83aEwrtSF00OrJtsWRadSdy0oQ5xQDTQksmIv7k7Tqve8OH/79sBsUezIw3pVL8hpr9zRgXMuiLKb9onUvJ/DMtMInuE5CS0U0+cKU51yf6URBOf53iNRyLcAHPJbfAoOtPYvBX1uEZWYQPmATJ1RxAqtCZ/fznC72YXbkqrnQI/GP9GEx48BJxHo6R1ciMkoHpd28W3/stBBQ7w+0Gmudg0v71J2PI/G55CCe/+hI3Sb9XjQhH/4Xfer++obwQir4Dey2XVlGqS1yAgsXsTYGtEGdwI4BLspANghDqi5ZW/rw2dZAdJpGGix3dj0lcOmemPpSyVFu0uXMIiqfwhLTzDeENn9qmR9LpjEYxbVPNNK3BsE58PvlhxPmq47vFGDrEGCC8I8ZakDU8D/JTOCcCGVpjVOx0Lmy5vEaWsV/gRkwlvi48E35eE14j68OGiHIb9vqtdbXkEMxpEw4k4B5nAk9Gy9xJqUYPObJm5/GoYLqOBw8IeeYAPnealz/6492EhFQQw0YaMTdGJ648rt8vKHDFLQx2TafOMWzbTRta2lYDy7Lm4GqJPi4ZnGp2yc8WfNk= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(8121501046)(520078)(5005006)(3002001); SRVR:DM2PR07MB624; BCL:0; PCL:0; RULEID:; SRVR:DM2PR07MB624; X-Microsoft-Exchange-Diagnostics: 1; DM2PR07MB624; 4:OThpWqFMpW5V/BDcNQ68KbygCzV6DndtnxSLXYrnMH3L6OkEYjP1VSj5WozdWw258sNdbZzoEizTVWbh4ZiNAXekeeo0+6fex/qXD6P/nvtvnHZXw/C5It7jvr5E1b+c07yGLti121ZcHyy7ToQdLUI/CdE54WWPw3oB3134v3+7jxHkUcb6SU4VqDAoPqZfAEreprA7BRnwTGTj3bL9DA/I4M2/G+prCwwpVISnA17F40lpN1qQPhyg14fXSccHPXeKARgqJClENufdjGmIvPy7esiO4j49kcmIppRhjXQXQB1ZutJvylHKEJbqd/CnyHWMNb70eAjXYTaNye8DQnpIO31Ne6BJ9rAuTrYWdsM= X-Forefront-PRVS: 0714841678 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6069001)(6009001)(199003)(189002)(42186005)(19580405001)(189998001)(50226001)(107886002)(87976001)(92566002)(46102003)(5004730100002)(5001960100002)(5007970100001)(97736004)(122386002)(19580395003)(101416001)(2201001)(50986999)(5001860100001)(47776003)(50466002)(76176999)(4001540100001)(48376002)(68736005)(81156007)(40100003)(5001830100001)(76506005)(5001770100001)(229853001)(36756003)(77156002)(2950100001)(77096005)(66066001)(64706001)(33646002)(105586002)(106356001)(5003940100001)(5008740100001)(62966003)(142933001)(2101003)(4001430100001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM2PR07MB624; H:localhost; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:; Received-SPF: None (protection.outlook.com: caviumnetworks.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM2PR07MB624; 23:NEcT512iBum1SRkBVJxIwtEZ94CazXY2hKVgcOhILM?= =?us-ascii?Q?7qQ2h0Cc6CeYQ0EWPK0cAT7YP7UhVxRFElhU5Rh4aUHZ05MCbwvn8zgEMVxf?= =?us-ascii?Q?jA0KLsBKaCUVDqdx7EFnAJ5tx6qhzsTgF4hkL0wvcd4wHPMmCNcPGnJJbaiJ?= =?us-ascii?Q?0oTPaVsRk2fALH8O4t42fyDATmxyUnK5ggn+tIDt1b9GTj8bVYnG+MC538XG?= =?us-ascii?Q?erQI/4l3/jezfMOjpFcCzE5bOO93XpDEEYOlC3LJDDqMKlO4zoAIAdhX8q7e?= =?us-ascii?Q?dTZjJ2yQW9PM44Hrvb3nR5mEa/4pIhFzNya559fYSE8ljmYfRwacLrQPYySm?= =?us-ascii?Q?M9f9Wy8Qx+GTAJW4x5Qhxc6BInzZlphxGY6SXWKYGzMFNQUsAXK/KtmlHTvl?= =?us-ascii?Q?qjameQ2xlrBVP41DjGM2m8B+d1Sd71xq1v18TjG1saad4VjUgpq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J5HRZS5v1J?= X-Microsoft-Exchange-Diagnostics: 1; DM2PR07MB624; 5:2y5THieKl85XSk63VAz8PPF2ogAi2qtV9l4mUCPWrYiTX8gsbbJot1dJtAUYDtR6xZLLLLajPr1wxoOE3MY5hFra4km3A8k0GCF16KxDrL94JHgjpy++/kx8QxFg3WuPzspAWACmIeQaMgGfjVEbGw==; 24:gnEEM50ConRoAlI25ELrZQiAqBE6XJ11/ltd4arkr4YNK4gZb5GDpjq7TZdU3cCSdW/9okYCsUbheB3mSk9IOj/Vrfwa4w8XfzmgdVv/qNY=; 20:esF5B5UIvttnUXm1hHjRiKZ99966XlsEJt+EWOuWUpzjszaq88J2KalVJN3oltlSj8wLmdlUCdCKyeRO2iHpzQ== SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Sep 2015 22:17:06.0910 (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-20150929_151712_344252_14F3F659 X-CRM114-Status: UNSURE ( 6.04 ) 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: yury.norov@gmail.com, klimov.linux@gmail.com, Yury Norov , apinski@cavium.com, philipp.tomsich@theobroma-systems.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 From: Andrew Pinski Signed-off-by: Philipp Tomsich Signed-off-by: Christoph Muellner Signed-off-by: Yury Norov diff --git a/arch/arm64/include/asm/compat.h b/arch/arm64/include/asm/compat.h index 3a2976d..f53c4e6 100644 --- a/arch/arm64/include/asm/compat.h +++ b/arch/arm64/include/asm/compat.h @@ -319,6 +319,26 @@ 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 + #else /* !CONFIG_COMPAT */ static inline int is_compat_thread(struct thread_info *thread) @@ -330,17 +350,25 @@ static inline int is_a32_compat_task(void) { return 0; } +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_COMPAT */ static inline int is_compat_task(void) { - return is_a32_compat_task(); + return is_a32_compat_task() || is_ilp32_compat_task(); } 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); } #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)