From patchwork Tue Nov 17 21:16:48 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yury Norov X-Patchwork-Id: 56871 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp2184428lbb; Tue, 17 Nov 2015 13:19:53 -0800 (PST) X-Received: by 10.66.141.73 with SMTP id rm9mr677920pab.96.1447795193469; Tue, 17 Nov 2015 13:19:53 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bw10si29257866pac.157.2015.11.17.13.19.51; Tue, 17 Nov 2015 13:19:53 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754964AbbKQVTt (ORCPT + 28 others); Tue, 17 Nov 2015 16:19:49 -0500 Received: from mail-bl2on0054.outbound.protection.outlook.com ([65.55.169.54]:28992 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754941AbbKQVTp (ORCPT ); Tue, 17 Nov 2015 16:19:45 -0500 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Yuri.Norov@caviumnetworks.com; Received: from localhost (95.143.213.120) by BLUPR07MB611.namprd07.prod.outlook.com (10.141.207.16) with Microsoft SMTP Server (TLS) id 15.1.325.17; Tue, 17 Nov 2015 21:19:42 +0000 From: Yury Norov To: , , , CC: , , , , , , , , , , , , , , Yury Norov Subject: [PATCH v6 08/19] arm64:ilp32: add is_ilp32_compat_{task, thread} and TIF_32BIT_AARCH64 Date: Wed, 18 Nov 2015 00:16:48 +0300 Message-ID: <1447795019-30176-9-git-send-email-ynorov@caviumnetworks.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1447795019-30176-1-git-send-email-ynorov@caviumnetworks.com> References: <1447795019-30176-1-git-send-email-ynorov@caviumnetworks.com> MIME-Version: 1.0 X-Originating-IP: [95.143.213.120] X-ClientProxiedBy: AM3PR01CA051.eurprd01.prod.exchangelabs.com (10.141.191.41) To BLUPR07MB611.namprd07.prod.outlook.com (10.141.207.16) X-Microsoft-Exchange-Diagnostics: 1; BLUPR07MB611; 2:lSpgC1v+d0AgnMvoh6APV7bRnAcgmUpCdK0Pzj7+YAIqF85HdoyHEoRlNmXYxtpCFelC22VHplUkhCkMb0v9sFsWnHIdyBYqak4ygY4h74qN5mIxz+A1I/GrgrjxKQhlx6sB8xHnDYPN9NOv1SVxPuWKRBZGEZMdYRZWcOF7CcE=; 3:9dPkyhrn4uYzOHuodjPUh5/AgzJyysLGReHen1+/pD42KsEG4+lSRxh9sGQfmxbJquyrSYOV9ANyVSvh8uMBzeNUo2eNp+AHGgsaBe+izbnneIq29pr3MOpk0sCDOPxqme71oPpHZkce98RfKN7CwQ==; 25:QcG+WBZHiwqALhwUEaOPKPdmPdRjHgc+f33NYPPbh2oSrpiuy6lRqkJ7tGo6ZRB92DCufYRJT6bEyHDzcAlcjjkK2nMGKVkEBVPUODb1jDTgiSvgBS79+d2dNeD6GuMmfPmKsqIwpJhJNg2C8SbZOULzV0ZJZZibOlIozl6hZsPsiyweVttuZS7fGxXwXeYq3y8MBZ5P/iaGY7w+n2nc0j+LyN3SH5R6/I3WX/zRnztjm6L0j2OS37PbLSN1CaQ6DchbrAs0QYFFofDgPu+NaA== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR07MB611; X-Microsoft-Exchange-Diagnostics: 1; BLUPR07MB611; 20:y1Lus/mfHMd5BD/OKpQ7ohFm7LckHRDnOpAcr8//zSRwRyhw+cSeH4+lTTsFJadlNEwJbFCQvrjA3Y0Sug0DXZDnYX0A1ApsOYPN4GN9NtBc4DLI2P/urOLa4wcj1ftRYEHYizlo7q6hLFbuknwaV31jwgd4DQiZd2/0KjBvpmF6M/Tgg5eia/pxTMlpg8+8FftK+/dBxT2SNeRpNUqvLiwX8LsxzslV2vKKCiF7exuAd5XvSmRD6CKnLwHvlz1KkbWovlyfiTa9QrF9GVqfuPSSJbsH3b2bd8pEADPg1Gwp6nmjL4+oDeDktEiHozRuRuwho3gHa0EGWuWnXQAMi1p/UgNcqmalOaBxhZONEPUGSVGIknk7JmxrWg6Dw/9ht/O90cUinKw9qqDCOABJoirDEX57MHdkaFvcltT/2cSUqUuXcf8vmTBiKQpeAc35/Mgi+ocVviLKUf5YbngCaYPCXmiCwNc0Odc4aJICUl5QpP9wpEyxpWkK8/FLGUOWlj749X3rgzIPFFQiw7PY8JzXAmKiATo6rsIQGqGE8Yc0ro/MnqzK5QWlNNUZYLCGP0g1W1dOOtRN34btqkB1jv1Cb2rUPOW5ar+VPm5dIyI= 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)(3002001)(10201501046); SRVR:BLUPR07MB611; BCL:0; PCL:0; RULEID:; SRVR:BLUPR07MB611; X-Microsoft-Exchange-Diagnostics: 1; BLUPR07MB611; 4:XaoLZGGJopjZwY2ZdaFQ4xZpeLjU4DaakarUb6sORUSDFEicFJ0rEJtUSVmKtYssRIE0YeIw1gNMAUxajxJc5U2Omc1aRRgkA4INImykER2kdvvsok8VBr4xncmap82rN7Kf4mgUr8qgtflBHYpeF5kr+B/Bw0eicNiLwaN23rcG5NNWUDR12xj3BAlNsZFN1vk/8weJhMQed7GsaSf2tmX/7JA/0D7FTy9vNobqFbD4djULgBs+RrYJXMBojJHSYLKQ562B/S29cVCMQmD+4o6CvJdEn8aeD5fx2VREswOsO037X56rVNONxNmz+t8judPXpffSyzn9q2olQhDhYwdzM1Oo5FymQM0YHr3Vpe42eoosJYd8ATwQzKOBfGFr X-Forefront-PRVS: 07630F72AD X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(6069001)(199003)(189002)(33646002)(42186005)(5008740100001)(40100003)(50986999)(5007970100001)(586003)(66066001)(76176999)(122386002)(189998001)(47776003)(36756003)(2950100001)(50466002)(5003940100001)(4001430100002)(5004730100002)(105586002)(106356001)(229853001)(48376002)(97736004)(19580405001)(87976001)(50226001)(19580395003)(5001770100001)(2201001)(92566002)(101416001)(107886002)(5001920100001)(81156007)(5001960100002)(77096005)(76506005)(142933001)(2101003); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR07MB611; 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; BLUPR07MB611; 23:yhpa3ewhodDlIjdY3MHso32ZkoBTU/W8E98XZluhd4?= =?us-ascii?Q?uuEKJ0Cm4zq8vAsXaCzHSHiMOgohH8FMimifQ9uL+ZIaBV4tbk2H9jU8hpqO?= =?us-ascii?Q?/qSHRn5P5MiiSDVTnw8dUjBRb2sRAef5Jg/H2OHFJBpO5GQ0l78nCt8FvgY5?= =?us-ascii?Q?QBnyvbdlQvIawzxmK7g0DXZfVjBHZFuIYWk7WN6cvqzufjcX6z3nJGfu86QD?= =?us-ascii?Q?V5V+PccKaPq0m08L36F+iW/WnNqGnJgEuJsKuMVFgv5LbSuB0anSN603909E?= =?us-ascii?Q?lX1OD9YEKUEYK55NSX4i77m7Xlhtw+ak1O/42VRIEmS0mO2zKOp3r133RclO?= =?us-ascii?Q?E0lXvwPhgXCTlvuQpA+p94vXGvHuo2W3vUXU47CkYVPs/HnUCSkvQw2R5stL?= =?us-ascii?Q?2NM27wjA5l87thK6Uv2Z9kxfZspMS5JF2/576fK3gcq+hh62HSnxMePEerSF?= =?us-ascii?Q?fs3ekniGW+okT7QAPzuO/GTfbDSk3WQDdMH8OSazCLMtB5crhDRQkJg4cycK?= =?us-ascii?Q?1CIQHvV1xN9GpeHboJC6QEWvWUTxM9OdssKtF7JX9anitySMCMnFJStenQUo?= =?us-ascii?Q?BBgI7d9iPUOseH014Cq/Vbe2FeQ9lGsaFdnE71jYBruaLu2GXX9QkYUvdzRg?= =?us-ascii?Q?zJbgLvrtWvP820B+nCTAQ/Epoqaoe+AkS7ukl3Kio3NjV3e0ht5cb42TLaZS?= =?us-ascii?Q?n5gCPmLXmLYAXjpRjZFzapztiLqF5k3+XqnmR8eP2LxIX1VHKjeubmg8bSmy?= =?us-ascii?Q?OeonRPNPjnqaJ1NqCbSx5JomZBKLGnvS5dWMHQt+NSqWfK+ZjK4oEIW5f0hS?= =?us-ascii?Q?B+1Zz9ml19HKR7Kei3LsCIhaGMsBsifkt1KpySEwusZwhsZtUKfnGozy8hlC?= =?us-ascii?Q?BxbLSbEeSE8YQpqpLaP/guxc48j4PTKUN62hZBZqWilrbxo98HXp61+679a1?= =?us-ascii?Q?+dfJ2R25Mil6jdUNGHvtynGYkbqkYhfXO5AcE6p1h3IA0yP8pJ+U3O3YVQkL?= =?us-ascii?Q?hDymTY8ifKbhRGFqGDb7iMupjdqrJ38O5Cb0TvkFtlAbg5sKc4a/rN9zyD1w?= =?us-ascii?Q?/do6PyS2lmyZggZTqZhaUD49wwSdug8E7wuJ6agVUAED/57eq8NTe678/vfO?= =?us-ascii?Q?GNJY7JEuSK69mBNJ4xX9gYZzSK14TnmDhwz2+HsY8IIqezkHuuFw=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; BLUPR07MB611; 5:FK9q8snGix/5E5svlluKO2n3UAmziDeT8WFnXTVUeN+agYvYEyZugXdGfwPIuH7kSLpV3pZ7DR2L4A1ADx+Q6DH7FJsBfZEDvdTatOHGaAxO2WjJZc/epiwZ+aFHxtiiH85DT4EwiVz1Ojc5ik+3HQ==; 24:JJURfZv/gAOFGAD12ADBkMzydSXE2/AiO0O/Njzxf5vbMaGa/JE2Sho9LY3pyH5ZCy980KKk3VzFKY8qYaseS7ztWam4kngqjoXe6gjPdtU=; 20:jObmznkF5TvE1eKtUS7luJovwtMUQ6Hln6bHN5kAsZ1+Lt1Bwdn1adjWNECs9FSUav+oi+Ow9CjMoSfElwHtpw== SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Nov 2015 21:19:42.8186 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR07MB611 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andrew Pinski 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/compat.h | 38 +++++++++++++++++++++++++++++++++++- arch/arm64/include/asm/thread_info.h | 1 + 2 files changed, 38 insertions(+), 1 deletion(-) -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ 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)