From patchwork Thu Jan 7 23:34:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yury Norov X-Patchwork-Id: 7980711 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 0F1139F3F6 for ; Thu, 7 Jan 2016 23:44:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3403020114 for ; Thu, 7 Jan 2016 23:44:50 +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 4597E2010E for ; Thu, 7 Jan 2016 23:44:49 +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 1aHKD9-00074b-AJ; Thu, 07 Jan 2016 23:43:19 +0000 Received: from mail-bn1on0060.outbound.protection.outlook.com ([157.56.110.60] helo=na01-bn1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aHKA7-0002Vs-Es for linux-arm-kernel@lists.infradead.org; Thu, 07 Jan 2016 23:40:15 +0000 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Yuri.Norov@caviumnetworks.com; Received: from localhost (95.143.213.121) by BY2PR07MB614.namprd07.prod.outlook.com (10.141.222.146) with Microsoft SMTP Server (TLS) id 15.1.361.13; Thu, 7 Jan 2016 23:39:47 +0000 From: Yury Norov To: , , , Subject: [PATCH v6 13/21] arm64: ptrace: handle ptrace_request differently for aarch32 and ilp32 Date: Fri, 8 Jan 2016 02:34:31 +0300 Message-ID: <1452209679-19445-14-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: AM3PR01CA025.eurprd01.prod.exchangelabs.com (10.141.191.15) To BY2PR07MB614.namprd07.prod.outlook.com (10.141.222.146) X-Microsoft-Exchange-Diagnostics: 1; BY2PR07MB614; 2:b6ZuH3L8hfwzfXeEkDKn5xrvRYgqCEVlX/OfJxgcLxu/BBmA25hl2r2lKeVPCRPQXBn9Vr8uicaVp3FtVtXLjBT5tPkBqibFwzJLnBQp5ZmKGIDAfP/Co1pISsJLbyUImKnwIH3DkqNFTTmcDjp0IQ==; 3:TxYsV6eqqM4h8ThsrzWxQpd7PlLmxu/5EoWuZrV9MYd5jobmsZTTyu8AreU7eFMr3qG75xeTypLnmmQRmlR5mVrI/xTyjhoQ2Q1dgIxb1EDMusvx5orG3OBusGZR0L7s; 25:tj1/Vj0OWJ0+3SFXlV4y3r3uxuoONKSjKE62U9D1s8fBxRHBQCfqP8X1iwRwCE8NU+Bo4MUOehRYsSmkk+xzs8G7wySvLL3mYpkwBZ5DXZ7wsJ+FCWe9lUD9gEx6dbmJCuEzUtgd2XobVAmSl8INxigg9q9wD4A4pXtIxHxunCCG2jNGGoPNHiqWpROxeGs7L9N9KYTpPUMrWSXFoaLG0KV8uf5Aj7Yp/aGXc42ctk+3Ku9aAqv9qrgrc4fSZLol X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY2PR07MB614; X-MS-Office365-Filtering-Correlation-Id: 2317623d-bc97-45b6-5906-08d317bbd478 X-Microsoft-Exchange-Diagnostics: 1; BY2PR07MB614; 20:V1Rk9YWVXNUs5BKkJwJ22v8+cLp+0gG4pCSYEEbDh6fqMPza3n1EdeQHFUyP4xXPLbZrd/TJLFy0HyDW1s5zqNkQX1DUDfMMilGXSt/23b/909eCE3KosHPSiqUePuSkYh1kMgVtEhVX7gvXS85UV0582s48iieQm2N8pjFTtJA/wi8zhiV0iQM5rXLvg4nhndhArU2DKVqM2pwmmTknopjxCmCqPMBJe6a82ZOKVKjRy0gDRgmGI1i1MMzwrXr1B+GKFWzXx2kySoPWg0Zy8dOqt3K1Wnf9QomxI5Yy0R1uf6wYCDppKKtyTZ9y8e7VuUIDjvVAir8heHDA+40nBqd1hxqZXDV51C5lAlnZhjtPbOVZS7z1+jUuTaWIDuR5HEQ39JwdTHFMmXxzqAI++hq+GylUn7gaudn9MEueqRm+UCXL5uv1EQr3JAUM1/b/91YcbBWMXXqwPlJ2YaSFxmTENFbfInieDv5x4TvrVZGiYK16KngmDrVTujteVVacCnIGeB70/fw52BLkNw4Uvxt8JkPz+bkr0Fb0gp1yJDDIJYI6hohlM/YFUH3NuQU0I/M4rQ53yBxIEaeQ6w4LZEf43yCdh7vrT76I106BcTo= 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)(8121501046)(520078)(10201501046)(3002001); SRVR:BY2PR07MB614; BCL:0; PCL:0; RULEID:; SRVR:BY2PR07MB614; X-Microsoft-Exchange-Diagnostics: 1; BY2PR07MB614; 4:KAsToHObinGhr+U0xncWkO/vgyWLV4h2gRCITV1BHxr7vVQbrqjcLkW1SrC9m0ui3yCFZacqhMGf9mkzL+4LQV+VIpihDpttH5GICkeSAzu101eJVnHVgMoRV47bh/Sa7Z/4ADlhC/R3c3i23pFnjsWZsruALK3ZUjEHU+V+8PXvqn4R4JKAYU/6QP+L3l/LUit3J7EJo4a00PZu2DwLwbnjqGP8IjJ58ju4mV1yeUk6o/80O6lqAto/YRMTydI8954oywgF83rlpr1blyFNjjjDB9RAqqf4IKgweGpm7AwC1OAzxTDW06HUBrgyU2VLUmA9QWA/D/AmobfRPlGdD1u7WsBfjHy38W2ik/O6ze+MgEWWPjEy6BpvmrzqI1nMImXi1+VrsXsidyhuwiuFlfz2/7GG5JsjON8qsUVco7M= X-Forefront-PRVS: 0814A2C7A3 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(979002)(6009001)(6069001)(199003)(189002)(33646002)(105586002)(5001770100001)(50986999)(189998001)(106356001)(81156007)(1096002)(2950100001)(5003940100001)(47776003)(97736004)(50226001)(87976001)(92566002)(40100003)(5001960100002)(50466002)(229853001)(5008740100001)(3846002)(4326007)(19580395003)(76176999)(77096005)(19580405001)(586003)(122386002)(42186005)(36756003)(5004730100002)(6116002)(2906002)(101416001)(66066001)(48376002)(76506005)(2201001)(2101003)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR07MB614; 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; BY2PR07MB614; 23:EDDlMAchYvG8gTPlNFF8lOcgAETpdh/LmdQVa5rXF2?= =?us-ascii?Q?rJT/PS1HNExZBy8/H6dLnbISo4OuJP13Z1Oq/jSXE7d/RGVEhBYtKLcgk8zZ?= =?us-ascii?Q?k3lho5UVDL9GtHVrHziid9VyQvwHRy7D5EoxG7KVr0QtnQ1Sq7JoyRaPqrNB?= =?us-ascii?Q?uiYgSAzfAdtHX/XK6u8yZDa/GCAXmS4jJhUUh6J4HZMGUXw0IRaq2pNaAw9H?= =?us-ascii?Q?GMMJG935MDFXeHwdfRLKFdiMM/BXMFno+zLpaDWO9e/oAn3tr58QmVT5tBcM?= =?us-ascii?Q?d7A3qzWGKxXpXasNRw28/ERav9wO+6Lgu6X+HBxC3T2JATV+GBo+R/IbcpCE?= =?us-ascii?Q?Z28P+dfEVxB0Pu9DWgesYgkOFoIYey2+W3OFH749KLh1gXyaViDKDXBRtamx?= =?us-ascii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; 5:rP++2SUO/J7iWLHJfikvvCA2oSb5fDKDOhhoVUGovQHgrq74tU+UxR8lvNCTcvPWW7Gcx1dOX7ZiyYAGT8xoKI3UmcHwI3xlXrhVWtpL1M+brjlUK/zw5QBmQ5i7RhFpmwrH4QXek2uan+kJNzN3lg==; 24:7xgiygVJnfAVPOK9wX01QtHIGU2usTZwxH2S9qjeXEFKQAch6UsxLMWeA8OQGEFMmqVQVO1wyeyRtxyxJycvzwIOO1MHSDzzjGppuhrG+P8= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jan 2016 23:39:47.5976 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR07MB614 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160107_154012_169085_0035C6D9 X-CRM114-Status: UNSURE ( 7.16 ) 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, schwab@suse.de, broonie@kernel.org, Nathan_Lynch@mentor.com, agraf@suse.de, klimov.linux@gmail.com, 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 Signed-off-by: Yury Norov --- arch/arm64/kernel/ptrace.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/arch/arm64/kernel/ptrace.c b/arch/arm64/kernel/ptrace.c index c166548..f95fb89 100644 --- a/arch/arm64/kernel/ptrace.c +++ b/arch/arm64/kernel/ptrace.c @@ -1108,7 +1108,7 @@ static int compat_ptrace_sethbpregs(struct task_struct *tsk, compat_long_t num, } #endif /* CONFIG_HAVE_HW_BREAKPOINT */ -long compat_arch_ptrace(struct task_struct *child, compat_long_t request, +long compat_a32_ptrace(struct task_struct *child, compat_long_t request, compat_ulong_t caddr, compat_ulong_t cdata) { unsigned long addr = caddr; @@ -1185,8 +1185,25 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request, return ret; } +#else + +#define compat_a32_ptrace(child, request, caddr, cdata) (-1) + #endif /* CONFIG_AARCH32_EL0 */ +#ifdef CONFIG_COMPAT + +long compat_arch_ptrace(struct task_struct *child, compat_long_t request, + compat_ulong_t caddr, compat_ulong_t cdata) +{ + if (is_a32_compat_task()) + return compat_a32_ptrace(child, request, caddr, cdata); + + return compat_ptrace_request(child, request, caddr, cdata); +} + +#endif /* CONFIG_COMPAT */ + const struct user_regset_view *task_user_regset_view(struct task_struct *task) { #ifdef CONFIG_AARCH32_EL0