Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753806AbdFSPwS (ORCPT ); Mon, 19 Jun 2017 11:52:18 -0400 Received: from mail-sn1nam02on0050.outbound.protection.outlook.com ([104.47.36.50]:62656 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753791AbdFSPwM (ORCPT ); Mon, 19 Jun 2017 11:52:12 -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 , Bamvor Jian Zhang Subject: [PATCH 09/20] arm64: introduce is_a32_task and is_a32_thread (for AArch32 compat) Date: Mon, 19 Jun 2017 18:49:52 +0300 Message-Id: <20170619155003.13218-10-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: VI1P190CA0017.EURP190.PROD.OUTLOOK.COM (10.165.188.158) To SN1PR0701MB1871.namprd07.prod.outlook.com (10.162.100.21) X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PR0701MB1871: X-MS-Office365-Filtering-Correlation-Id: 79ce8b49-4f00-4b53-1394-08d4b72b23e7 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(201703131423075)(201703031133081);SRVR:SN1PR0701MB1871; X-Microsoft-Exchange-Diagnostics: 1;SN1PR0701MB1871;3:anyoAAxa+npdxLz9OnbG/s7Pk1a4LDv/lN15NIMoHM9ixKY0RqLvAJu86IZY1qOLZ2YfHfGzLw0nh7TwnFC8Jt5pz9D/Dt+0i1AV6UN4K7yGjLmiGehvjt9FPq84hdl5RCYUvkkE+COZMQRyVu3eKl5vVDNQ2lNI5182zrxLYx6jkS0+OKaK+GwB8NfQluAcmFbg4I9xGnV0H40FOKnlQ903p14SILRDmQYqOPa6PR1pzrzqccv8xITVAVVrUsaGtfqRUu8p9/FGz8+rqljL9tll0O7EvuvssIIohcgtMn7kmt8y4+xuvdmvHWasGvm0dKOlh+7CH9DU13DC+eDAQA== X-Microsoft-Exchange-Diagnostics: 1;SN1PR0701MB1871;25:5wtLd/aPfDAZVuz18WXdTmswo6b8zNg3xzPcV1M+wk6ITxEVbFuKa6Inmbeis4ODAFLLS26yzMuqrDL0jAb21UOernVyleHDAiqS9CcX3LWxcYuOnlxKYIuUQBGPzl5aUqvHf2XpG5gfiprqzXhCYTNm1XPDrPKqgs/3/oetYR3/oishN9oJayDR6WKnEsBnbP6N+AhH/SkF53MTLG981ISQIqNgDrBO35GbyRYWW7QWEAR3XztgvgIlxCM1M0V6a257up2uv59HoCWf4xDw4nf2ZBB8CT3thzNLMyz8rXp1scOAoM1J7/ckAjG+mtghn96LsOJrAWDOYHpfCQkBy8cKZGTQp/x8tYgDPhXgwyItaEjYm4CddkbB/WrukSciAmcB+UKkuU6Bslk4uIxFTJcgB3hNvMFcFm888SArQHtjqkHDa4BEeK5HoT45fzud1CssARBL6o/CEu7s5HjBwzFYIcKfI1NL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vOVlvlaqpjErG6I+bjkxbXaNd9R1A24NfSH/ttlZieJoU7x5AmyEQyYRQUz3CCoOvijlYGlabIwAFwaT2UKI6qx3lvCrbABfPjY= X-Microsoft-Exchange-Diagnostics: 1;SN1PR0701MB1871;20:Bu3n+Kgft6JIt83+aeQGCEls+8HMkQpDul35dyGGeX3Le5lUffm+XpU0OFCJg28bTZnjMMMz5hxtGlrN4eu/5wvMuVrw6gcXnObv76NCOfDzg6LKmXfWfaXNjLzqx+cbE4qZZed0Fk8gvzXr1M1o+ZXm6w+O1ZxH9i2YYrW23ZvGH7u4Hb258Sjz+hqz0T/LpeZs9ynTVp7wBdCKsRDBEOsqQWH3rFl5f2dTHbpurlqTMyb2Tok2MvaOkDvTrPueS2IB8iZdnmTa/QdkjfPJYv0LWgyyvOsbX1Lc/5F+I1hYiIVD+/+PQeJtx+CAGXGsHMfqUGIAmDo8uFdoimJVWIDCK76Lg0rgR9VEcECBBPDbgL5/VLRl3AVwDAqkdNvh4oePHO3y1gFihmLpB2BR3aqN9Ydkwr5aoIbVsVzH3NURoSmZ2y4MlwPjlwLmrRL30o3+3L4++AkaHcf0FkhWIH2B3PWYuZjgAbh1qsFst84irwDM6DheotSmiof/0DMUD1plLkXJzjROm7aY/CnutdcxBXZSSmB7GBlOVQ/UyPiFIR24cPiRR04aTN6swmrsA3NKbSj5/8rNd/wgCpMkwgY5EPZmIRjS99UmL40DPVo= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(250305191791016)(22074186197030); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(93006095)(3002001)(10201501046)(100000703101)(100105400095)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123555025)(20161123560025)(20161123564025)(20161123558100)(6072148)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:SN1PR0701MB1871;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:SN1PR0701MB1871; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;SN1PR0701MB1871;4:wbD/28298v6UMp2E3KKEheKPVDcS9UrT/grjFkwc?= =?us-ascii?Q?NotXG5fmYX3vmytOqhnxcH4/QK67o5USPgYqCpP2PA4ltpX0P60tYvRLNcsb?= =?us-ascii?Q?YLt3igTnQFeY/SILgSuAVUNsmn0PPp8bNVJ9EZJC66/Q6SiovV/kWJbE/32m?= =?us-ascii?Q?XBGFEO2TCUUYQ5WveqgwNKB4hLsC9wkhPzUl7baLb5t6/AhrW0lBuy12fy8i?= =?us-ascii?Q?7/TDhHLx7iLM6kdOKS7Yu0sTJtSGooOoPRZnlKJrJUdxD++iHiYr+8kaTlns?= =?us-ascii?Q?GoM5WnQhg+vWu6P+RVQbUZiolNUWe3w7ERJKV7sXsaRAsdaaR0MduX2QglUK?= =?us-ascii?Q?XDm/mGFjPL5ca3ffhj2CyOv2S94RImMTAM6KbkAJsh+QWfXQfrQOOCh3HzaD?= =?us-ascii?Q?9m6yTTpqBX9O/wM515ea6JjBPwQQgL9J2sQJ0+YhnQdYufWKqHUA86JhNfAO?= =?us-ascii?Q?nJtuTO+Ey7N3b54gt6nTNT9tjzDcg9rc5flz8qbRaZtKsDnsnfLZLbXdMFnd?= =?us-ascii?Q?UPkQuajo3zj7TLdaLnCRf3Du9oYIsF7hAPKuxh+HndPl4bCm3b7aw2vkNYhs?= =?us-ascii?Q?knnIehKO8SXMDtQ1WH0JhVvQt1lWifxkje5IpmBYL219DbriwNUmRSR9vqr5?= =?us-ascii?Q?9lV1WWXADULD4UWhimbWiELHBe51x17o5FuzCdTyh9zMo/H3tmyuEp2z3DCq?= =?us-ascii?Q?Ite78dCF/xaAB9zhoT7DTM/XnV3WDi+cDF3qRIWs7gHmzw48P3H1ElvdH/ib?= =?us-ascii?Q?g0NqYTtt/xw2ko9vGCO29Na09hl5Wt7l/a+UVxjB9qaFfCxupNY6rvU0E6yi?= =?us-ascii?Q?YlR2ONf5OhtYhPXkWgEC1huXaSHpsIMs5AFvyFdcSsa/1zi977g0G/F/0JEr?= =?us-ascii?Q?C8yo+fDdF7F+lmz9McOHE19/WhFEu51JzBp8CbSprvmp+e3VydSy+3IGtRTk?= =?us-ascii?Q?atVXhepR+3AcOR7sGCH7MNIzZsTzGalWVCIKMojeaOqKV0Wi5QY4qp6BGlpk?= =?us-ascii?Q?2EMZVyIHMvusxqKgeS9/bVqa1ZQPtT8lQMojDyrZdUapGlYiKxlBD4UfINSn?= =?us-ascii?Q?qwq9tufKtrPEncyUcNgSctas7J+X3w63yO91gT5yR0N8cj7tEaWzu3t1diVW?= =?us-ascii?Q?4cUrXVN5nXhl2rAZQzoTgbREc/HGLckn85eHzwOoUiyXdPr0Af1O2H2++kxO?= =?us-ascii?Q?rDtWCKVS4gZNwSo5NdbCBNG7ROwert3Bt7IQ?= X-Forefront-PRVS: 0343AC1D30 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(6009001)(6069001)(39840400002)(39410400002)(39450400003)(39850400002)(39400400002)(76506005)(7736002)(42186005)(6496005)(66066001)(6666003)(33646002)(2906002)(2950100002)(5003940100001)(38730400002)(81166006)(25786009)(42882006)(50986999)(53936002)(72206003)(478600001)(54906002)(305945005)(47776003)(50226002)(7406005)(76176999)(3846002)(6486002)(1076002)(189998001)(48376002)(5660300001)(6306002)(8676002)(6116002)(36756003)(50466002)(7416002);DIR:OUT;SFP:1101;SCL:1;SRVR:SN1PR0701MB1871;H:localhost;FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;SN1PR0701MB1871;23:sWDDWPB2kG9QLHn4Mi0H3Ds4pmHuVOlSLw/S/Ty?= =?us-ascii?Q?Dqk1PJHsRwQo7OmOWWfWtilseQCkvKV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s0dtapTvxX+3IMeAWnag= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;SN1PR0701MB1871;7:hSHTH4legavncJHfrgbvuaD9WWB3ZWnUkIW/BJTNZyLp8+XglJl1CKnyq6ITDWnJ5QAKbpUayXeYdWba/yCCMtLfzKJXP/h5KGMHGOizxSx1gZcTzvbsSBTgiqTIZz1lsMa9l6mURO/Ns6xpUEk8NXzM3AUi1uAN0YR59GTI9TUcdiTf7nzriPlFKPsB1x+TqTl8uoUj1YStRrO8Dq5jaHydTBvkDYuBFB1hANAfFdF2BOrFVUwG7edyXDlaXFYnPS2boeds8aiiNhKckH+iV1XC9Ya9jxqTReL5MGhKmBmSkXFHO6mubnudBqO9Szab9bRj+ykK9dFK7hnvPXSq064ee2LaXBnbQ2z9HvQHDy2GPPPnHFf916pcSeYkda67iOmkCSYbu0d4IS3iyUkhOLfWB7Xgd42x8aEMWn8n9UFGh8yemuXFhddpQZ5HmnpjyfJ3r6DIX6ZlofJIiSj3DEl/1+TPAiLIfL2Uk/ovwt/tk42CwJoUKq3aMB8GcmrDQWTzYWqBlFTSfqCXN0t0ad+CBVED0vv38s+5DJnnmdBBU5uUmnGeZZ52yIyTJPZWWHs2eM2HOinuWnRu+YlCK/e4ZzD6PE1ZSW0xCrohIYIqDbuxzAENSWkZYhW4+X52q9IKjgBFMS7KMUK+QPPCHIvpCDkhWMn521Vvt42BoxqQQNn5vqN6VF3l6u/IsPNQbfJCP48NxNgzSkIRLBpkHyL9bx0we+AwS/ELu8jeWCz6JxAnBsr12nRvZD0X70JWWMHoAWsUMwCtEjCFyiY3UFBMCne9+A8NKYOkL6S98dc= X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jun 2017 15:52:07.5686 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR0701MB1871 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 14643 Lines: 464 Based on patch of Andrew Pinski. This patch introduces is_a32_compat_task and is_a32_thread so it is easier to say this is a a32 specific thread or a generic compat thread/task. Corresponding functions are located in to avoid mess in headers. Some files include both and , and this is wrong because has already included. It was fixed too. Signed-off-by: Yury Norov Signed-off-by: Andrew Pinski Signed-off-by: Bamvor Jian Zhang --- arch/arm64/include/asm/compat.h | 19 ++--------- arch/arm64/include/asm/elf.h | 10 +++--- arch/arm64/include/asm/ftrace.h | 2 +- arch/arm64/include/asm/is_compat.h | 64 ++++++++++++++++++++++++++++++++++++ arch/arm64/include/asm/memory.h | 5 +-- arch/arm64/include/asm/processor.h | 5 +-- arch/arm64/include/asm/syscall.h | 2 +- arch/arm64/include/asm/thread_info.h | 2 +- arch/arm64/kernel/hw_breakpoint.c | 8 ++--- arch/arm64/kernel/perf_regs.c | 2 +- arch/arm64/kernel/process.c | 7 ++-- arch/arm64/kernel/ptrace.c | 11 +++---- arch/arm64/kernel/signal.c | 4 +-- arch/arm64/kernel/traps.c | 3 +- arch/arm64/mm/mmap.c | 2 +- 15 files changed, 98 insertions(+), 48 deletions(-) create mode 100644 arch/arm64/include/asm/is_compat.h diff --git a/arch/arm64/include/asm/compat.h b/arch/arm64/include/asm/compat.h index e39d487bf724..463533b1ae32 100644 --- a/arch/arm64/include/asm/compat.h +++ b/arch/arm64/include/asm/compat.h @@ -25,6 +25,8 @@ #include #include +#include + #define COMPAT_USER_HZ 100 #ifdef __AARCH64EB__ #define COMPAT_UTS_MACHINE "armv8b\0\0" @@ -299,23 +301,6 @@ struct compat_shmid64_ds { compat_ulong_t __unused5; }; -static inline int is_compat_task(void) -{ - return test_thread_flag(TIF_32BIT); -} - -static inline int is_compat_thread(struct thread_info *thread) -{ - return test_ti_thread_flag(thread, TIF_32BIT); -} - -#else /* !CONFIG_COMPAT */ - -static inline int is_compat_thread(struct thread_info *thread) -{ - return 0; -} - #endif /* CONFIG_COMPAT */ #endif /* __KERNEL__ */ #endif /* __ASM_COMPAT_H */ diff --git a/arch/arm64/include/asm/elf.h b/arch/arm64/include/asm/elf.h index ac3fb7441510..6a37b6facc69 100644 --- a/arch/arm64/include/asm/elf.h +++ b/arch/arm64/include/asm/elf.h @@ -16,6 +16,10 @@ #ifndef __ASM_ELF_H #define __ASM_ELF_H +#ifndef __ASSEMBLY__ +#include +#endif + #include /* @@ -158,13 +162,9 @@ extern int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp); /* 1GB of VA */ -#ifdef CONFIG_COMPAT -#define STACK_RND_MASK (test_thread_flag(TIF_32BIT) ? \ +#define STACK_RND_MASK (is_compat_task() ? \ 0x7ff >> (PAGE_SHIFT - 12) : \ 0x3ffff >> (PAGE_SHIFT - 12)) -#else -#define STACK_RND_MASK (0x3ffff >> (PAGE_SHIFT - 12)) -#endif #ifdef __AARCH64EB__ #define COMPAT_ELF_PLATFORM ("v8b") diff --git a/arch/arm64/include/asm/ftrace.h b/arch/arm64/include/asm/ftrace.h index caa955f10e19..0feb28ad10dd 100644 --- a/arch/arm64/include/asm/ftrace.h +++ b/arch/arm64/include/asm/ftrace.h @@ -54,7 +54,7 @@ static inline unsigned long ftrace_call_adjust(unsigned long addr) #define ARCH_TRACE_IGNORE_COMPAT_SYSCALLS static inline bool arch_trace_is_compat_syscall(struct pt_regs *regs) { - return is_compat_task(); + return is_a32_compat_task(); } #endif /* ifndef __ASSEMBLY__ */ diff --git a/arch/arm64/include/asm/is_compat.h b/arch/arm64/include/asm/is_compat.h new file mode 100644 index 000000000000..8dba5caaf5d1 --- /dev/null +++ b/arch/arm64/include/asm/is_compat.h @@ -0,0 +1,64 @@ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef __ASM_IS_COMPAT_H +#define __ASM_IS_COMPAT_H +#ifndef __ASSEMBLY__ + +#include + +#ifdef CONFIG_AARCH32_EL0 + +static inline int is_a32_compat_task(void) +{ + return test_thread_flag(TIF_32BIT); +} + +static inline int is_a32_compat_thread(struct thread_info *thread) +{ + return test_ti_thread_flag(thread, TIF_32BIT); +} + +#else + +static inline int is_a32_compat_task(void) + +{ + return 0; +} + +static inline int is_a32_compat_thread(struct thread_info *thread) +{ + return 0; +} + +#endif /* CONFIG_AARCH32_EL0 */ + +#ifdef CONFIG_COMPAT + +static inline int is_compat_task(void) +{ + return is_a32_compat_task(); +} + +#endif /* CONFIG_COMPAT */ + +static inline int is_compat_thread(struct thread_info *thread) +{ + return is_a32_compat_thread(thread); +} + + +#endif /* !__ASSEMBLY__ */ +#endif /* __ASM_IS_COMPAT_H */ diff --git a/arch/arm64/include/asm/memory.h b/arch/arm64/include/asm/memory.h index 32f82723338a..9b1835ca808f 100644 --- a/arch/arm64/include/asm/memory.h +++ b/arch/arm64/include/asm/memory.h @@ -26,6 +26,7 @@ #include #include #include +#include /* * Allow for constants defined here to be used from assembly code @@ -78,9 +79,9 @@ #ifdef CONFIG_COMPAT #define TASK_SIZE_32 UL(0x100000000) -#define TASK_SIZE (test_thread_flag(TIF_32BIT) ? \ +#define TASK_SIZE (is_compat_task() ? \ TASK_SIZE_32 : TASK_SIZE_64) -#define TASK_SIZE_OF(tsk) (test_tsk_thread_flag(tsk, TIF_32BIT) ? \ +#define TASK_SIZE_OF(tsk) (is_compat_thread(tsk) ? \ TASK_SIZE_32 : TASK_SIZE_64) #else #define TASK_SIZE TASK_SIZE_64 diff --git a/arch/arm64/include/asm/processor.h b/arch/arm64/include/asm/processor.h index 2bbbd33549c0..0136a1af677d 100644 --- a/arch/arm64/include/asm/processor.h +++ b/arch/arm64/include/asm/processor.h @@ -30,6 +30,7 @@ #include #include +#include #include #include #include @@ -40,7 +41,7 @@ #define STACK_TOP_MAX TASK_SIZE_64 #ifdef CONFIG_COMPAT #define AARCH32_VECTORS_BASE 0xffff0000 -#define STACK_TOP (test_thread_flag(TIF_32BIT) ? \ +#define STACK_TOP (is_compat_task() ? \ AARCH32_VECTORS_BASE : STACK_TOP_MAX) #else #define STACK_TOP STACK_TOP_MAX @@ -94,7 +95,7 @@ struct thread_struct { #define task_user_tls(t) \ ({ \ unsigned long *__tls; \ - if (is_compat_thread(task_thread_info(t))) \ + if (is_a32_compat_thread(task_thread_info(t))) \ __tls = &(t)->thread.tp2_value; \ else \ __tls = &(t)->thread.tp_value; \ diff --git a/arch/arm64/include/asm/syscall.h b/arch/arm64/include/asm/syscall.h index 709a574468f0..ce09641f888d 100644 --- a/arch/arm64/include/asm/syscall.h +++ b/arch/arm64/include/asm/syscall.h @@ -113,7 +113,7 @@ static inline void syscall_set_arguments(struct task_struct *task, */ static inline int syscall_get_arch(void) { - if (is_compat_task()) + if (is_a32_compat_task()) return AUDIT_ARCH_ARM; return AUDIT_ARCH_AARCH64; diff --git a/arch/arm64/include/asm/thread_info.h b/arch/arm64/include/asm/thread_info.h index 46c3b93cf865..a7ffea24d94d 100644 --- a/arch/arm64/include/asm/thread_info.h +++ b/arch/arm64/include/asm/thread_info.h @@ -95,7 +95,7 @@ struct thread_info { #define TIF_FREEZE 19 #define TIF_RESTORE_SIGMASK 20 #define TIF_SINGLESTEP 21 -#define TIF_32BIT 22 /* 32bit process */ +#define TIF_32BIT 22 /* AARCH32 process */ #define _TIF_SIGPENDING (1 << TIF_SIGPENDING) #define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED) diff --git a/arch/arm64/kernel/hw_breakpoint.c b/arch/arm64/kernel/hw_breakpoint.c index 749f81779420..49b9a29915c0 100644 --- a/arch/arm64/kernel/hw_breakpoint.c +++ b/arch/arm64/kernel/hw_breakpoint.c @@ -169,7 +169,7 @@ enum hw_breakpoint_ops { HW_BREAKPOINT_RESTORE }; -static int is_compat_bp(struct perf_event *bp) +static int is_a32_compat_bp(struct perf_event *bp) { struct task_struct *tsk = bp->hw.target; @@ -180,7 +180,7 @@ static int is_compat_bp(struct perf_event *bp) * deprecated behaviour if we use unaligned watchpoints in * AArch64 state. */ - return tsk && is_compat_thread(task_thread_info(tsk)); + return tsk && is_a32_compat_thread(task_thread_info(tsk)); } /** @@ -480,7 +480,7 @@ static int arch_build_bp_info(struct perf_event *bp) * Watchpoints can be of length 1, 2, 4 or 8 bytes. */ if (info->ctrl.type == ARM_BREAKPOINT_EXECUTE) { - if (is_compat_bp(bp)) { + if (is_a32_compat_bp(bp)) { if (info->ctrl.len != ARM_BREAKPOINT_LEN_2 && info->ctrl.len != ARM_BREAKPOINT_LEN_4) return -EINVAL; @@ -537,7 +537,7 @@ int arch_validate_hwbkpt_settings(struct perf_event *bp) * AArch32 tasks expect some simple alignment fixups, so emulate * that here. */ - if (is_compat_bp(bp)) { + if (is_a32_compat_bp(bp)) { if (info->ctrl.len == ARM_BREAKPOINT_LEN_8) alignment_mask = 0x7; else diff --git a/arch/arm64/kernel/perf_regs.c b/arch/arm64/kernel/perf_regs.c index bd1b74c2436f..443e42001108 100644 --- a/arch/arm64/kernel/perf_regs.c +++ b/arch/arm64/kernel/perf_regs.c @@ -46,7 +46,7 @@ int perf_reg_validate(u64 mask) u64 perf_reg_abi(struct task_struct *task) { - if (is_compat_thread(task_thread_info(task))) + if (is_a32_compat_thread(task_thread_info(task))) return PERF_SAMPLE_REGS_ABI_32; else return PERF_SAMPLE_REGS_ABI_64; diff --git a/arch/arm64/kernel/process.c b/arch/arm64/kernel/process.c index af1ea258c212..0fbbe7c96f69 100644 --- a/arch/arm64/kernel/process.c +++ b/arch/arm64/kernel/process.c @@ -51,7 +51,6 @@ #include #include -#include #include #include #include @@ -217,7 +216,7 @@ static void tls_thread_flush(void) { write_sysreg(0, tpidr_el0); - if (is_compat_task()) { + if (is_a32_compat_task()) { current->thread.tp_value = 0; /* @@ -269,7 +268,7 @@ int copy_thread(unsigned long clone_flags, unsigned long stack_start, *task_user_tls(p) = read_sysreg(tpidr_el0); if (stack_start) { - if (is_compat_thread(task_thread_info(p))) + if (is_a32_compat_thread(task_thread_info(p))) childregs->compat_sp = stack_start; else childregs->sp = stack_start; @@ -306,7 +305,7 @@ static void tls_thread_switch(struct task_struct *next) *task_user_tls(current) = tpidr; tpidr = *task_user_tls(next); - tpidrro = is_compat_thread(task_thread_info(next)) ? + tpidrro = is_a32_compat_thread(task_thread_info(next)) ? next->thread.tp_value : 0; write_sysreg(tpidr, tpidr_el0); diff --git a/arch/arm64/kernel/ptrace.c b/arch/arm64/kernel/ptrace.c index da908f9a1e05..e2b7c040bf84 100644 --- a/arch/arm64/kernel/ptrace.c +++ b/arch/arm64/kernel/ptrace.c @@ -39,7 +39,6 @@ #include #include -#include #include #include #include @@ -187,7 +186,7 @@ static void ptrace_hbptriggered(struct perf_event *bp, #ifdef CONFIG_AARCH32_EL0 int i; - if (!is_compat_task()) + if (!is_a32_compat_task()) goto send_sig; for (i = 0; i < ARM_MAX_BRP; ++i) { @@ -1312,9 +1311,9 @@ const struct user_regset_view *task_user_regset_view(struct task_struct *task) * 32-bit children use an extended user_aarch32_ptrace_view to allow * access to the TLS register. */ - if (is_compat_task()) + if (is_a32_compat_task()) return &user_aarch32_view; - else if (is_compat_thread(task_thread_info(task))) + else if (is_a32_compat_thread(task_thread_info(task))) return &user_aarch32_ptrace_view; #endif return &user_aarch64_view; @@ -1341,7 +1340,7 @@ static void tracehook_report_syscall(struct pt_regs *regs, * A scratch register (ip(r12) on AArch32, x7 on AArch64) is * used to denote syscall entry/exit: */ - regno = (is_compat_task() ? 12 : 7); + regno = (is_a32_compat_task() ? 12 : 7); saved_reg = regs->regs[regno]; regs->regs[regno] = dir; @@ -1452,7 +1451,7 @@ int valid_user_regs(struct user_pt_regs *regs, struct task_struct *task) if (!test_tsk_thread_flag(task, TIF_SINGLESTEP)) regs->pstate &= ~DBG_SPSR_SS; - if (is_compat_thread(task_thread_info(task))) + if (is_a32_compat_thread(task_thread_info(task))) return valid_compat_regs(regs); else return valid_native_regs(regs); diff --git a/arch/arm64/kernel/signal.c b/arch/arm64/kernel/signal.c index c7b6de62f9d3..5fa1b401c5d6 100644 --- a/arch/arm64/kernel/signal.c +++ b/arch/arm64/kernel/signal.c @@ -276,7 +276,7 @@ static int setup_rt_frame(int usig, struct ksignal *ksig, sigset_t *set, static void setup_restart_syscall(struct pt_regs *regs) { - if (is_compat_task()) + if (is_a32_compat_task()) compat_setup_restart_syscall(regs); else regs->regs[8] = __NR_restart_syscall; @@ -295,7 +295,7 @@ static void handle_signal(struct ksignal *ksig, struct pt_regs *regs) /* * Set up the stack frame */ - if (is_compat_task()) { + if (is_a32_compat_task()) { if (ksig->ka.sa.sa_flags & SA_SIGINFO) ret = compat_setup_rt_frame(usig, ksig, oldset, regs); else diff --git a/arch/arm64/kernel/traps.c b/arch/arm64/kernel/traps.c index 287a21ee39b3..d1e40129afe0 100644 --- a/arch/arm64/kernel/traps.c +++ b/arch/arm64/kernel/traps.c @@ -18,6 +18,7 @@ */ #include +#include #include #include #include @@ -578,7 +579,7 @@ asmlinkage long do_ni_syscall(struct pt_regs *regs) { #ifdef CONFIG_AARCH32_EL0 long ret; - if (is_compat_task()) { + if (is_a32_compat_task()) { ret = compat_arm_syscall(regs); if (ret != -ENOSYS) return ret; diff --git a/arch/arm64/mm/mmap.c b/arch/arm64/mm/mmap.c index adc208c2ae9c..57b25e7770dc 100644 --- a/arch/arm64/mm/mmap.c +++ b/arch/arm64/mm/mmap.c @@ -54,7 +54,7 @@ unsigned long arch_mmap_rnd(void) unsigned long rnd; #ifdef CONFIG_COMPAT - if (test_thread_flag(TIF_32BIT)) + if (is_compat_task()) rnd = get_random_long() & ((1UL << mmap_rnd_compat_bits) - 1); else #endif -- 2.11.0