From patchwork Thu Jan 7 23:34:26 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yury Norov X-Patchwork-Id: 7980661 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 BA471BEEE5 for ; Thu, 7 Jan 2016 23:42:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 574A020149 for ; Thu, 7 Jan 2016 23:42:06 +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 DD6262010E for ; Thu, 7 Jan 2016 23:42:04 +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 1aHKAD-00038U-Ux; Thu, 07 Jan 2016 23:40:17 +0000 Received: from mail-bn1bon0695.outbound.protection.outlook.com ([2a01:111:f400:fc10::1:695] helo=na01-bn1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aHK9A-0001bh-6l for linux-arm-kernel@lists.infradead.org; Thu, 07 Jan 2016 23:39:23 +0000 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Yuri.Norov@caviumnetworks.com; Received: from localhost (95.143.213.121) by CO2PR07MB618.namprd07.prod.outlook.com (10.141.228.149) with Microsoft SMTP Server (TLS) id 15.1.361.13; Thu, 7 Jan 2016 23:38:48 +0000 From: Yury Norov To: , , , Subject: [PATCH v6 08/21] arm64: introduce is_a32_task and is_a32_thread (for AArch32 compat) Date: Fri, 8 Jan 2016 02:34:26 +0300 Message-ID: <1452209679-19445-9-git-send-email-ynorov@caviumnetworks.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1452209679-19445-1-git-send-email-ynorov@caviumnetworks.com> References: <1452209679-19445-1-git-send-email-ynorov@caviumnetworks.com> MIME-Version: 1.0 X-Originating-IP: [95.143.213.121] X-ClientProxiedBy: AM2PR09CA0001.eurprd09.prod.outlook.com (25.161.22.139) To CO2PR07MB618.namprd07.prod.outlook.com (10.141.228.149) X-Microsoft-Exchange-Diagnostics: 1; CO2PR07MB618; 2:Bf9xSfCJAoJ8y1B0iQsaHvS0eRt6D2G6yyElsFEEhdR4Xqxz8o0DtLEDjIQFKc7vnEayXtxKp+7SzwLEwk1J/lZVGyN0GwZRKjzPIQc4SnnGC4WIJvGN44w5fpdh6BMo/nRn7/ChgutIXClSzcyY9g==; 3:W9k8tAOuHUKUAxHXkYP+bnUCQl7bH1hGVEUgrz/pHuxR8YLEa4Am2ouXoq9ITXBantYf5dAggFi7lo28BPvcYYOC+0cTTHhQJlngzKb7ayuYB1U/x18rmQJm+sKzhe/Z; 25:DshtF0DqXlNkBKvAuxhuOQtu9sI97b2r0mpEqw5httsoEMJbuQexMGac2ZLbNjJ2djEKCqe/lPKkWlbA9y+QADXx3hq8a1KFLe8dEn8stIH5vhLAALXCb7lD+WbSPglCIYLgSNvT732OvT0AqLNqbfe4WEZ7YkU3f/5/cUPHisSlt400BYrn0Bz7cx3Ma75X8j408Aq2wcGOs9AG1bl83D+dcwL9nUoQ1xF8gbu6hXt0E5W0qTPXqCd+0qmN5UPP X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CO2PR07MB618; X-MS-Office365-Filtering-Correlation-Id: 54cc0713-d32b-4d93-c148-08d317bbb124 X-Microsoft-Exchange-Diagnostics: 1; CO2PR07MB618; 20:vPNfdaqDTJtWBpcLVET21qXfpOL9W1iSSw5dNfgM4Oxgp6YipLvWrwDziG7WyGLdstc0YT3/4cBSIrlq3VwnMP7dknG+WwSIzYOsNBJ88G17JKnho3V0JDRvk2nsVDhnpdnRECFzI6p3ASIJ39gjirnkG7vCdwisunWyc5Ii4Ptah1B1owQy3ckVA4XKukAvaNARbemXREHKwr6S2RJGP1+dDnIHwHw6DjMsDfs5oiqYpnEDX63nOD+WmywzHqZw+6B2mtvyjF1Jw6UjS6iEXZN1Lw+Ueni8rJiO2Zdq6xTs5TE2cbvRIODzWZaV4P9c9kBWz7bNs2NUrgzrJaWaob+2MrCT6UL/f1/9QaShkl+4I93SK2f5GFCSPmDwMx7lkYZevEerTEt+tEoRuq5YwW6/cs4c2mAbiY5C6tLLYJfJIjHLSOth9YzAuodqb/1O8NhWxwxawaOnr14F6TB1bmteyWcQYh47bGlvsh8ojDWGX6yM+4aQYlkZgaELXwNZLILtYkPamdSpuxaS13iJbVz72GcyPbznHe43VWh9EQFDURxlc9WyJtA/YBWhNt3OqXDOX64usMmP5jPugeUuv5VwN4DrdbSlYNqoGjAXLzM= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(236414709691187); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(520078)(8121501046)(10201501046)(3002001); SRVR:CO2PR07MB618; BCL:0; PCL:0; RULEID:; SRVR:CO2PR07MB618; X-Microsoft-Exchange-Diagnostics: 1; CO2PR07MB618; 4:avnuraB0pr8vij+kyFHSWw4gTST/hJ+DfVm2MnaaplIesAgaQp8jhFmBK+80TJWXGPZcZG0lyXgoODvG699IC7gpZ63glKmVC94o0WR0SfqMoMSQcBWjTRDCdfy1BSddr4nl4ug7sqR3AwXyr+FaUJI/wocWuSyCgvs176eTQRN39IQCMwd1w3rKTbcGWuRwKIex0vsjp9ZBzSD3tP+4nEoyBKSjC4emFiQR8ykZzq/Z45hDMCVrwB58pOMPt40ZbYtzGeizS5MW62ehJ0YtHlcsCPWRUNLhzVZd1kOAFOgDWyqP4H5zMwVMXRdqRpElDhBZaoK5d3QZVZazgExhIzlawx15EsznHbwyrQ7xRN46lWkinsfAva3mCEy3mm5CwkcoiRDLU2fYVeEWV43A6rKzcAOfDJDnD/vjI65Bl0ImRLVY6zfdczCG7gSuwiAD X-Forefront-PRVS: 0814A2C7A3 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(6069001)(199003)(189002)(19580405001)(33646002)(3846002)(42186005)(87976001)(101416001)(50986999)(5004730100002)(106356001)(36756003)(122386002)(586003)(2906002)(5001770100001)(76506005)(92566002)(15975445007)(19580395003)(4326007)(77096005)(4001430100002)(76176999)(48376002)(107886002)(81156007)(5001960100002)(2950100001)(189998001)(40100003)(66066001)(105586002)(6116002)(5008740100001)(47776003)(50466002)(97736004)(229853001)(1096002)(50226001)(2201001)(5003940100001)(2004002)(2101003)(473944003); DIR:OUT; SFP:1101; SCL:1; SRVR:CO2PR07MB618; 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; CO2PR07MB618; 23:IULA5ErbuJOt9LDRGwbqNfqZkBCRQxflNZFYW01joD?= =?us-ascii?Q?iMRFS+GjxAthlvwIAKnm0AyVFkH3QTPoBCnXEp6PaOCt/hlUCMVZox9gUWex?= =?us-ascii?Q?TyZIHNNzlTLSD9Uqgvxu27MiG9rWt5R0JT6RTDS0N7rp0CY7oNTPsTMLTb1o?= =?us-ascii?Q?p0/q7+4JaXuEW+HzRf3yR7N+13+FMk+gFWWLTTP3J8OP9BcyzPPpPqwJHcpZ?= =?us-ascii?Q?b3U7MsEP8aRMfO6Zzt8y9Nbb45lB6v+1gy1ZjCdcsw+O3o3hXXPjyiZ8buGy?= =?us-ascii?Q?u4PAXWRZT9dNo38s/r35OOlQg1xMU5VBH956l3lzhhaahAs5K3tlHQYMjghq?= =?us-ascii?Q?TPKGk5bqF2YwPhDYX4GC9rIpb6Oy+QsaHr8S8PNS0R3d+wbNE4Y1Nc2u5iJA?= =?us-ascii?Q?xNcrTG9p7fuwMts6C3JbrZL69JzoUHjsQx4f/IYn28hiVm37nfBxGbUYiNsW?= =?us-ascii?Q?AzN4G/0FISeDNzfcZVK59O7VorupzEOK+yu0PE2Pqfkib7rHJiVoZTtDNBi5?= =?us-ascii?Q?13CcSzQz1bU1WFcJffpkzbhdbnWJW6nLQ0bgfaKUX6MiYQ2NxY4nh9RlhsXt?= =?us-ascii?Q?xGLvtwZ4tSK1g8VdyOnQPrTldNDB7sE1z/313G8ahZheBV6ye/4xAZIJF53Z?= =?us-ascii?Q?kA8S5xDaj9cqjGj94xwL3sBeFStUWdjLoBHEvb09K4u1B3YtaqOaaWEczxmT?= =?us-ascii?Q?lueZMzE+zCgTHUH3hVQvVSouip6KaexN5MKRk9dI6O8iyoXuUypWp8it7SHJ?= =?us-ascii?Q?NUKdFvESYP7cJx2mSf9ekRejT578CU8rmz9SgKMBzEE7LZr8Ch0SmpcV6Ful?= =?us-ascii?Q?Z5BS5zFgAyUjEHF34k+B1v3vi2acRyEjuwWVvo1nllTMbqakfNFaKwK5XMeJ?= =?us-ascii?Q?pPotfM+dlqc2UvTTVUZ+pM1lq8DCETTxBAMTKLW1K1w9sfvSvGFRVWWdURG0?= =?us-ascii?Q?bquyUnnkfIfBE+UOiEIgFuL7+NQYIyrqCdUSp7rRcvIkYJ+P88s+cNsMBvGg?= =?us-ascii?Q?xhoTdP4zJzRFq0atVDwRgL8RBXwZIjUBMMO46QX1WSvV5KfHHsbqRD6NfQ78?= =?us-ascii?Q?w1belxJSEsD7mmqrGmHASVgzAhTISODaairOkg1aAhoCy6TKqP/YmM8uN6Sb?= =?us-ascii?Q?9lf3lFmKalr5u6C2z0ouJs+876nP8FIMTmxPehLVZ+G+tRxD8KJiz33XnJxd?= =?us-ascii?Q?0g2ybfi3558SWIXARsJj5zMuGFIP1FU1hTJRmmPRWZbVsNszYNNAeCFao8Lp?= =?us-ascii?Q?x1XSb7Iu+4N4KN8Tc=3D?= X-Microsoft-Exchange-Diagnostics: 1; CO2PR07MB618; 5:zil7u5QqIUZGY/z70majmSj0a56BF+8ZH2mxMFoOmK21a+PG7+MCYD76bp3VjGxvN6wDPQW0jBdpobnG8Htc3TvvqBu9V8NzD5SRdOy5w3YECYbFqf4REvzvfBcEjL9HZefxW9OBk8QiDYlTrBBfmQ==; 24:mih+hqgBiLJDFvCv02b9hpFL/gt+maC2qGC9OprM/VmzNCMCLtKvNFBleYoCEtTCDBcTwO5a7jGLIV6DNn8EM0BbftuYTdojUPfFgvBqdG0= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jan 2016 23:38:48.3296 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO2PR07MB618 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160107_153912_869313_C58109F0 X-CRM114-Status: GOOD ( 18.12 ) 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, schwab@suse.de, broonie@kernel.org, Nathan_Lynch@mentor.com, agraf@suse.de, klimov.linux@gmail.com, Andrew Pinski , ynorov@caviumnetworks.com, jan.dakinevich@gmail.com, ddaney.cavm@gmail.com, bamvor.zhangjian@huawei.com, philipp.tomsich@theobroma-systems.com, joseph@codesourcery.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, 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 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: 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/compat.h | 19 ++---------- arch/arm64/include/asm/elf.h | 7 ++--- arch/arm64/include/asm/is_compat.h | 58 ++++++++++++++++++++++++++++++++++++ arch/arm64/include/asm/memory.h | 3 +- arch/arm64/include/asm/processor.h | 5 ++-- arch/arm64/include/asm/thread_info.h | 2 +- arch/arm64/kernel/hw_breakpoint.c | 10 +++---- arch/arm64/kernel/perf_regs.c | 2 +- arch/arm64/kernel/process.c | 5 ++-- arch/arm64/kernel/ptrace.c | 9 +++--- arch/arm64/kernel/signal.c | 4 +-- arch/arm64/kernel/traps.c | 3 +- 12 files changed, 84 insertions(+), 43 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 eb8432b..df2f72d 100644 --- a/arch/arm64/include/asm/compat.h +++ b/arch/arm64/include/asm/compat.h @@ -24,6 +24,8 @@ #include #include +#include + #define COMPAT_USER_HZ 100 #ifdef __AARCH64EB__ #define COMPAT_UTS_MACHINE "armv8b\0\0" @@ -298,23 +300,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 faad6df..2f62ded 100644 --- a/arch/arm64/include/asm/elf.h +++ b/arch/arm64/include/asm/elf.h @@ -16,6 +16,7 @@ #ifndef __ASM_ELF_H #define __ASM_ELF_H +#include #include /* @@ -148,13 +149,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 CONFIG_COMPAT diff --git a/arch/arm64/include/asm/is_compat.h b/arch/arm64/include/asm/is_compat.h new file mode 100644 index 0000000..6139b5a --- /dev/null +++ b/arch/arm64/include/asm/is_compat.h @@ -0,0 +1,58 @@ +/* + * 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 */ + +#endif /* !__ASSEMBLY__ */ +#endif /* __ASM_IS_COMPAT_H */ diff --git a/arch/arm64/include/asm/memory.h b/arch/arm64/include/asm/memory.h index 853953c..5ec1b74 100644 --- a/arch/arm64/include/asm/memory.h +++ b/arch/arm64/include/asm/memory.h @@ -25,6 +25,7 @@ #include #include #include +#include /* * Allow for constants defined here to be used from assembly code @@ -60,7 +61,7 @@ #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) ? \ TASK_SIZE_32 : TASK_SIZE_64) diff --git a/arch/arm64/include/asm/processor.h b/arch/arm64/include/asm/processor.h index 9c4d95d..e4e56ae 100644 --- a/arch/arm64/include/asm/processor.h +++ b/arch/arm64/include/asm/processor.h @@ -29,6 +29,7 @@ #include +#include #include #include #include @@ -39,7 +40,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 @@ -92,7 +93,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/thread_info.h b/arch/arm64/include/asm/thread_info.h index 90c7ff2..dd046c5 100644 --- a/arch/arm64/include/asm/thread_info.h +++ b/arch/arm64/include/asm/thread_info.h @@ -112,7 +112,7 @@ static inline struct thread_info *current_thread_info(void) #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 b45c95d..baa1eba 100644 --- a/arch/arm64/kernel/hw_breakpoint.c +++ b/arch/arm64/kernel/hw_breakpoint.c @@ -164,7 +164,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; @@ -175,7 +175,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)); } /** @@ -435,7 +435,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; @@ -492,7 +492,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 @@ -679,7 +679,7 @@ static int watchpoint_handler(unsigned long addr, unsigned int esr, info = counter_arch_bp(wp); /* AArch32 watchpoints are either 4 or 8 bytes aligned. */ - if (is_compat_task()) { + if (is_a32_compat_task()) { 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 3f62b35..a79058f 100644 --- a/arch/arm64/kernel/perf_regs.c +++ b/arch/arm64/kernel/perf_regs.c @@ -45,7 +45,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 f75b540..251e1f7 100644 --- a/arch/arm64/kernel/process.c +++ b/arch/arm64/kernel/process.c @@ -46,7 +46,6 @@ #include #include -#include #include #include #include @@ -262,7 +261,7 @@ int copy_thread(unsigned long clone_flags, unsigned long stack_start, asm("mrs %0, tpidr_el0" : "=r" (*task_user_tls(p))); 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; /* 16-byte aligned stack mandatory on AArch64 */ else if (stack_start & 15) @@ -299,7 +298,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; asm( diff --git a/arch/arm64/kernel/ptrace.c b/arch/arm64/kernel/ptrace.c index 6b02f26..c166548 100644 --- a/arch/arm64/kernel/ptrace.c +++ b/arch/arm64/kernel/ptrace.c @@ -38,7 +38,6 @@ #include #include -#include #include #include #include @@ -79,7 +78,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) { @@ -1197,9 +1196,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; @@ -1226,7 +1225,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; diff --git a/arch/arm64/kernel/signal.c b/arch/arm64/kernel/signal.c index e18c48c..65baaef 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 b50fced..4115c44 100644 --- a/arch/arm64/kernel/traps.c +++ b/arch/arm64/kernel/traps.c @@ -18,6 +18,7 @@ */ #include +#include #include #include #include @@ -370,7 +371,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;