From patchwork Thu Jan 7 23:34:29 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yury Norov X-Patchwork-Id: 101183 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp222424lbb; Thu, 7 Jan 2016 15:39:33 -0800 (PST) X-Received: by 10.66.216.7 with SMTP id om7mr153482671pac.90.1452209973142; Thu, 07 Jan 2016 15:39:33 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g7si6865072pat.11.2016.01.07.15.39.31; Thu, 07 Jan 2016 15:39:33 -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 S1754008AbcAGXj3 (ORCPT + 29 others); Thu, 7 Jan 2016 18:39:29 -0500 Received: from mail-by2on0054.outbound.protection.outlook.com ([207.46.100.54]:25716 "EHLO na01-by2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752738AbcAGXjZ (ORCPT ); Thu, 7 Jan 2016 18:39:25 -0500 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Yuri.Norov@caviumnetworks.com; Received: from localhost (95.143.213.121) by BY2PR07MB613.namprd07.prod.outlook.com (10.141.222.144) with Microsoft SMTP Server (TLS) id 15.1.361.13; Thu, 7 Jan 2016 23:39:22 +0000 From: Yury Norov To: , , , CC: , , , , , , , , , , , , , Subject: [PATCH v6 11/21] arm64: ilp32: introduce binfmt_ilp32.c Date: Fri, 8 Jan 2016 02:34:29 +0300 Message-ID: <1452209679-19445-12-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: AM3PR01CA044.eurprd01.prod.exchangelabs.com (10.141.191.34) To BY2PR07MB613.namprd07.prod.outlook.com (10.141.222.144) X-Microsoft-Exchange-Diagnostics: 1; BY2PR07MB613; 2:wojJbYYNQHGsymLfeeE0RpX+9kQhfJmJ5yzakl+npj5xpiGceA3Jpl1QYdLApk/wrVrKCc0IcDqY6EQqqeWQD2OeJ3P5yIVLAmfLMuaxsmiDZ0TM+E+eUgbiRe9vBJZjsiPuMiIt1epQky1+daN9Gw==; 3:xN7Rk0K/dQfOtVAWsasf3rFUtC6+9no+Tb0GRLbbMpDUHpF0N4kfNOdswi9soj4P0OxFU9O0cxaF284ugclt6zRfNTErMwleqCy5TSG4/t5SG4ujk7yIjOVVdTJJMlFV; 25:YeQmSUBPEtZ5kIkpGY4lRHEWVWQ8PPe8gwDtncBPd+lDxHAIL5PtFwtpKq2CFkCf1dKT6XEZIWfhkFvEjSHBzEJeTLaQnGbEfgR90vn0zZ3sUWFTILKYoRm1NsoFD/Z8qIPfat6d4Cm3PS/U59+urh/IVZt4/ek1bXVvpyP2iDzdsPnJFO/45S6PtqYjgMuysWmkP1jS2Vi9Hb1BIRudTcuEfht7cmFJLXBGRwcVxZIV18l09cp97X31pOLu0uLs X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY2PR07MB613; X-MS-Office365-Filtering-Correlation-Id: 112d7aa5-297f-4995-87c4-08d317bbc54e X-Microsoft-Exchange-Diagnostics: 1; BY2PR07MB613; 20:w8tUln4TPu6ncRkJW+4HzXW2dyjL0DlKzwb+Y1MgpRcLkzh+lsMGxqmwBezoFWAjdcMAg6CzjxhiE6xzhsLPXYhOma47cEFbDMxXDIFpU81m+Y7snw80CBNxhuJLiMr3ljlMpVbxwLLkDPh6mA40Hniiu7mQ9S3zLyuoN8ILTQGvQoplHGN2eTbBBR0zT7jWdw+H23bd6jpRXXcTsGE8yXgm07xZpma3/Q6+4SVuRVKnJQNJpmggrizJCfqyh/6fjr8h1i9amV2Aye6NvVup+/wKgnUBWnO313jN/JhikNi9G4C2gRXLNxkY5/l2vfJE4UNvXMDyQk/6s0aZDs7+db1ChSdJynfdp/AFikauNjlvrbyERd5mha62aebwXKbop0nxWDMunqxt96NWcaQWdI75BAuQ06qnRqPoV+aCvbYxJiGO2jF38v84EI3rCeNKt3dopbCi+MklrfLEa7gJbWAtexBXAYzZZtTfqUmh298f3vhRk1msk1YWU2x+PN17RWJt3Afvrx5E4a9r3ydp19I9+y86mQSB/x1xoJ5FVrp9KSBYeaIvsNnqsCVhTffIFGMHwhs5ISYj6cyZYoX3D0FMvMzXSDJIQXdRS1gpG3A= 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:BY2PR07MB613; BCL:0; PCL:0; RULEID:; SRVR:BY2PR07MB613; X-Microsoft-Exchange-Diagnostics: 1; BY2PR07MB613; 4:s66dWXgUfVt2gPJlhdKXbbM+vQdidBhLhSadMVnTZArS0m/Azhtj7AgsZloRMGo9jInxG23MFJeWQ190/BsPtAXEsktGID8pJQuaxXXVxaMVeS8F3Oqplu6pEwYvhQDGqo7tDCMRLQj+2hDfoP3qNM4Gx40neL1kjIk/d/X6B1chmns7ONzy7AQ7GLO1HGUw0tfjZtG3maDKgUIW6PCmwsbji+Quxsc+pEqhXGx7gK/N3A+09vKYKAMn0P4CcRswA7z/re4ONHZDTn1aH2ZoF6cW70geZP4sVgxyh1Hqxl5UpKNdLXDH/m9KLBmCf0sYGpHYsTZfKmCuPEdQYtHYxpl5riJPmQMDAK86R9UUSTpnIE931YPVGuw0xVdfaGLslc3CHwH1XZ74Xch0SQElzaT5nJd8xWwUJEz9X3pj5PM= X-Forefront-PRVS: 0814A2C7A3 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(6069001)(189002)(199003)(586003)(40100003)(122386002)(5001770100001)(87976001)(5004730100002)(36756003)(50986999)(81156007)(5003940100001)(42186005)(97736004)(48376002)(92566002)(1096002)(47776003)(66066001)(76176999)(3846002)(2201001)(5008740100001)(106356001)(101416001)(50226001)(6116002)(19580405001)(4326007)(2950100001)(77096005)(33646002)(105586002)(76506005)(189998001)(50466002)(19580395003)(229853001)(5001960100002)(2906002)(2101003); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR07MB613; H:localhost; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: caviumnetworks.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: 1; BY2PR07MB613; 23:TSEP7jSLj3IKJrQG4t/8T4yN9ImXjgQWr6k9S8vnpveez+r3zBWkkaocXcfedxG2DtBt2XnOfQs4ypHob8n6LrGwUsORR347hbet40gAgs8XArg1ZytOttuwI+PTV7yhqipgWnior5cMP1/UpV2NhRnZ0cJ/5n0jRqW1EXF24vmBOxr7IctKN02H3pLo8kEKGgxnvdHqWNjk+IpytYiDNl4oEvqb/LNOgjEFragrAAUH8JMYpacd9X05UerMuJsOprmQWrNm+V48HicrXfo9U+UGOoYALgHDgmLFe3Ma4QHAsPsgyka5jdomKnfMnbWY5h8xRszTZTts3kkVgF/R62OQWpNKnSoY6TFdwocJyceTjzwyi5AtkgxE/pCnJsqWv49aEvRQI8a/LT7hIrx/rk5vtw8zHYZlt/V80bYS2x3II2p5B+7Pe7LOPwZvIiEbWKBQM5S0oCgGMbApW4G7dIvri8vi7VTiG5Y8njLjwT18/PSxDGIHrXd9GME7yK58/JeKe1QQ2lnmRCnQUe+ouPY6BAZD9mgyfo6DkxdW1YV9w2T2tIpKYbz/qpX0BhntL/zTdu+RPNZ9DcK9JhAUUho5uchuARgGBVZm7vFkFL0nHWhSXDMzM5WP9IkS3gocNRams+jFqourVsqGsrwDTg4pYkERChO8N7mGyikjDu06pbXbYIFJTQtbabc/MsmJyUW+7o2hz+ZziDxo0klV/ATW4EWWLqwyP/Urgv7RQycRMDos0ajIxtXleG9D/DusUGj5HAXy4hVJfat2Wj7jj3UtaEA31dhB1LnfIHDeBJ2r3WuHGsep5dYalwCTpCTeL/MbB6i5PgN3Z3BSASxCf+KQziI++Sn/l9YvtZ2nnYBKrAcu/RihNr845ptiB2OV1rlwOfRcHpgvfhbEAgdRn52DHlTHt1nPrNRsw7oL7cXynb4UxHIcfeYrRqahXg93rwEpRode899of3m9lG72ikeVC12l3y88KNoWP4NFyCgdXdLu6cvQDsudQ3LtLNSZWBPDYhscCzyjCqq8WdCsJFb7lsKCEbWjPYLyXUBapwPdQJa/L3VghlHg6C/2bl3jFFtefNZ7bMdWWkakLLiY7xXnWNEdibUzf74ABLzVzqc= X-Microsoft-Exchange-Diagnostics: 1; BY2PR07MB613; 5:0QN5QRsSTnwDkHeSDdZgax9Shum1fiCnCn8M3o39S5NfYKGNzt7ZfTm0k8tlJ+CWv1wWniOvKUiGBo079tBkZQp5nTfdq5zIsFf71m91du+iCGuBUTfFjo4sz1vgED3djkCouWDAVGj15ZE350RJAw==; 24:X4MFSUSYU07uAun960cqWV4AZlrxZbb2ovUcDxn6YXqjd3QGzqeINHHXrJFBugz+3vk47bxU/d+2eTt0QKDcThiLnV6QFRHOYKfcU0oOy3A= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jan 2016 23:39:22.1578 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR07MB613 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org to handle ILP32 binaries Signed-off-by: Yury Norov --- arch/arm64/kernel/Makefile | 1 + arch/arm64/kernel/binfmt_ilp32.c | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 arch/arm64/kernel/binfmt_ilp32.c -- 2.5.0 diff --git a/arch/arm64/kernel/Makefile b/arch/arm64/kernel/Makefile index f1b798a..ad7158c 100644 --- a/arch/arm64/kernel/Makefile +++ b/arch/arm64/kernel/Makefile @@ -28,6 +28,7 @@ $(obj)/%.stub.o: $(obj)/%.o FORCE arm64-obj-$(CONFIG_AARCH32_EL0) += sys32.o kuser32.o signal32.o \ sys_compat.o entry32.o \ ../../arm/kernel/opcodes.o binfmt_elf32.o +arm64-obj-$(CONFIG_ARM64_ILP32) += binfmt_ilp32.o arm64-obj-$(CONFIG_FUNCTION_TRACER) += ftrace.o entry-ftrace.o arm64-obj-$(CONFIG_MODULES) += arm64ksyms.o module.o arm64-obj-$(CONFIG_PERF_EVENTS) += perf_regs.o perf_callchain.o diff --git a/arch/arm64/kernel/binfmt_ilp32.c b/arch/arm64/kernel/binfmt_ilp32.c new file mode 100644 index 0000000..02a7a6c --- /dev/null +++ b/arch/arm64/kernel/binfmt_ilp32.c @@ -0,0 +1,21 @@ +/* + * Support for ILP32 Linux/aarch64 ELF binaries. + */ + +/* AARCH64 ILP32 EABI. */ +#define compat_elf_check_arch(x) (((x)->e_machine == EM_AARCH64) \ + && (x)->e_ident[EI_CLASS] == ELFCLASS32) + +#define COMPAT_SET_PERSONALITY(ex) \ +do { \ + set_thread_flag(TIF_32BIT_AARCH64); \ + clear_thread_flag(TIF_32BIT); \ +} while (0) + +#define COMPAT_ARCH_DLINFO \ +do { \ + NEW_AUX_ENT(AT_SYSINFO_EHDR, \ + (elf_addr_t)(long)current->mm->context.vdso); \ +} while (0) + +#include "../../../fs/compat_binfmt_elf.c" 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: 101204 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp222573lbb; Thu, 7 Jan 2016 15:39:56 -0800 (PST) X-Received: by 10.66.66.42 with SMTP id c10mr2444625pat.99.1452209996367; Thu, 07 Jan 2016 15:39:56 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id vq10si77790456pab.74.2016.01.07.15.39.56; Thu, 07 Jan 2016 15:39:56 -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 S1754037AbcAGXjy (ORCPT + 29 others); Thu, 7 Jan 2016 18:39:54 -0500 Received: from mail-bn1on0092.outbound.protection.outlook.com ([157.56.110.92]:2593 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753854AbcAGXju (ORCPT ); Thu, 7 Jan 2016 18:39:50 -0500 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: , , , CC: , , , , , , , , , , , , , 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: 1; BY2PR07MB614; 23:EDDlMAchYvG8gTPlNFF8lOcgAETpdh/LmdQVa5rXF2rJT/PS1HNExZBy8/H6dLnbISo4OuJP13Z1Oq/jSXE7d/RGVEhBYtKLcgk8zZk3lho5UVDL9GtHVrHziid9VyQvwHRy7D5EoxG7KVr0QtnQ1Sq7JoyRaPqrNBuiYgSAzfAdtHX/XK6u8yZDa/GCAXmS4jJhUUh6J4HZMGUXw0IRaq2pNaAw9HGMMJG935MDFXeHwdfRLKFdiMM/BXMFno+zLpaDWO9e/oAn3tr58QmVT5tBcMd7A3qzWGKxXpXasNRw28/ERav9wO+6Lgu6X+HBxC3T2JATV+GBo+R/IbcpCEZ28P+dfEVxB0Pu9DWgesYgkOFoIYey2+W3OFH749KLh1gXyaViDKDXBRtamxB9iAF68y/Wt0gIGu/J+RZXzcWhm7TVAydlHRMgGT25B6oRvU+1O2UW9E0/Gs9lvApEXjaJ7owTXmcU5HG7SG78BdKvMhSUo3KhJmphNTfdosd355K9pK0rmxPZLiIc91X03w04Aa0AadPcvA4kkIiyN8ImvTIWi3N8hVEt7dCEhYuR2F2XNlr9Le7ce1kZ5yY84mWTHSLOhSpTEo/foydQvEDhztAWnw/InBqQbWTSYXVJxn6w/pfqLPPwLKONQ67i9Qe2Jt1ZtK5xVcfitnT1IJiCSN61kNLuYOyl5or6hoSBbua4RCL3XlRWrfWB5rO9WgUnw6o/7axJI0fcJB/rgYn+qxnkdZk2Fut+TJhMO5FzcovQ4kiVT+qvJ0dGmqoNG99EGZOr1Csb7v6ussSM1SNSjVcGAZ95J538hmRB17B3zjrtu5muFSVo+h/7I09n4wHW+WfLsVOLqVcdtdj5klzkVFpDXav3cyuYq4x2r++2rY+Acmx9UYJO1Ms7UuqfD/1E0cJ/cV3DSkJdWwgMtZWE0cFgSmXmf1/V6ft8hOdutDeGWEiPfnhudhC7Zpi0Bi1YMuQC90MaiKarmWoRHx42MSGviFlEu6rTRgClu6+vffXQSSP8clrE42yY1Wm/pDJyAjSirYjLEMHocrSQUTHHxBeEKAye2D3eMtFDNDOdyEOpSbdjPWhWngZwT2yyk8X7Ha7OMl4Z41bYgKqcFKPHDKhD73I2ITWyqNHfZxOY3WQ4XERODXN3Wbxri5xb3VG0ZuliAmaKmwyQs3LrHmBrm2EIJPDEOj2JVNQfp31DiWux30c51veV7HaTx26fSQ== X-Microsoft-Exchange-Diagnostics: 1; BY2PR07MB614; 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Signed-off-by: Yury Norov --- arch/arm64/kernel/ptrace.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) -- 2.5.0 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 From patchwork Thu Jan 7 23:34:38 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yury Norov X-Patchwork-Id: 101203 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp223085lbb; Thu, 7 Jan 2016 15:41:15 -0800 (PST) X-Received: by 10.98.71.93 with SMTP id u90mr290136pfa.165.1452210074986; Thu, 07 Jan 2016 15:41:14 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p13si370375pfi.234.2016.01.07.15.41.14; Thu, 07 Jan 2016 15:41:14 -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 S1754140AbcAGXlM (ORCPT + 29 others); Thu, 7 Jan 2016 18:41:12 -0500 Received: from mail-bn1on0055.outbound.protection.outlook.com ([157.56.110.55]:51857 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753350AbcAGXlG (ORCPT ); Thu, 7 Jan 2016 18:41:06 -0500 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Yuri.Norov@caviumnetworks.com; Received: from localhost (95.143.213.121) by DM2PR07MB624.namprd07.prod.outlook.com (10.141.177.154) with Microsoft SMTP Server (TLS) id 15.1.361.13; Thu, 7 Jan 2016 23:41:03 +0000 From: Yury Norov To: , , , CC: , , , , , , , , , , , , , , Andrew Pinski Subject: [PATCH v6 20/21] arm64:ilp32: change COMPAT_ELF_PLATFORM to report a a subplatform for ILP32 Date: Fri, 8 Jan 2016 02:34:38 +0300 Message-ID: <1452209679-19445-21-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: AM3PR01CA033.eurprd01.prod.exchangelabs.com (10.141.191.23) To DM2PR07MB624.namprd07.prod.outlook.com (10.141.177.154) X-Microsoft-Exchange-Diagnostics: 1; DM2PR07MB624; 2:QE+x7RATM013d8f9QKy/uv8uCADw5AIj3Jv43RDNsW8/z/Gsu27sa/vDlQsniyRcbXy9zQ+oVMJQ9JlQeWL+2+ZPezqSZPjlfC6PhS9+ojr4Gv42LHP3BTkhEijilMpjjtdTYyFj6wx8m63fFT/xnw==; 3:aFz5aPfIQwGXsRcwzhpkpByz5YKkPTBDhnUbEvSdEpXp6x34B6BT4n5j94mo9f/Z+7w+2Sxh2wWwZ3/e0H5iePvzIlqDB9cs4b49SxY159XPtTveXCj+yl+iOYYUAay7; 25:RiLqqxw3tyY149EGkwaYACTjibriSPQ8/jwn6JvdSl7/kc1/TBWEsz6XG6oV/PwvPNaeyDbu2d9F+y5Q74P1PB/sJN3I5QgixeS8oKc2ZNvR8EmDnSlcYqozI6AFJROeEBXrYFw4FWSwbQ+ofCK/9I5ylnfFfSQxzklTl9LgwKJzsdyO0Axa2C/RQXiNLlnRMfgC2rVp9xkvyZ17/6j7CeHk8rJWkyyzFSkrExQ6/muydNdVwI6T3KJznbTvNvO/ X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DM2PR07MB624; X-MS-Office365-Filtering-Correlation-Id: 89c402b7-5c2c-4266-df90-08d317bc01e0 X-Microsoft-Exchange-Diagnostics: 1; DM2PR07MB624; 20:zzLVAPXYZhjzDaBPA2b2ahv/r4JT4OZDhdthflOb2lP1suyYMk6IXHaw80j/aumNaBKWZpFkokeHrvE4XNYw14b5jsizXq2IRS9uLrx+ghRDG++ZfPZsvD1KFPutarvk4ZL7p10Z51muITdz6OaATYo0vxjGlC+OY0yr8nZWOKkOiRDmfx6ltsmO7jYhoPYjeQFGrR9DPa6IhNnwiq+VRGLKfrQLTfc8iIySc2G51kLg1iPe15tjlI+TWNhZL369pW6hBV2J4vci0534fSWlkz0i8Gq7bbWCEqGmbBWcThjSaita5YC/vNwtezLdd7zrmcVbkL/cZUDycVu2WyJ0hgHIdryGp44gUpmVxxF4oNdzUoPsMLhqcRqLSvVnjDHDzrL3PFzS/CB3iVZUxHEsYwKdvDPp0QlOw1hhuk6rwwP3w3d3GkJE1Mwmm0nFOiitFDwIlGmvh7mq3B9tNgGHLKGC5F4mQwjuUAgXI2HpbP7GKcM1Bnr72J9nlW6rdwLfGAGxSQk3eVIZgZBRT5VhN4VSfJ8aRj/K213YptTtmKYvrCe2MQhr9a86POS62XX7xb12FgA+6nxlHrn93tvR+RxXJY/+G07gQvipev+5Y/o= 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)(3002001)(10201501046); SRVR:DM2PR07MB624; BCL:0; PCL:0; RULEID:; SRVR:DM2PR07MB624; X-Microsoft-Exchange-Diagnostics: 1; DM2PR07MB624; 4:VX/VjOH8vgtqrfuWgpSNN7rmaZVbkfwn0SP0SReVXI68aBsD8lsDAg3SjB4aDOw+rNfsUux39kQXJP40yTJ5a88aI14g+7uc9/D/ZoTsHGiXe0xVMq98OTCXVroQz0KbkPcMv8pEngjXv3IJqClW/xXK/XICOU7GnU1hunO4VTFrSo70zZhYPYCiyNU/QTd4anHzV9bPsRKMni0lj2jjSXJGaynTOs+o3zaiz7SXgv2g3kF7nDbdsKiQU1ViYyTovmukqug0+hV+t/zwIpK2jaawOWnanA0lYnd4Rh5zbGlO+yjnRZpr5b0Kg7cW2OfVDCl2GuPefRjY4uLeBUx5IKZmapHi9mCsTnbVHoGZdSks/3N6PQvBrD4FbnLcOWPVBbWEU9QflJ/68UhHfbcwjGO7RDVkq3MouibDQTVjBS2e9b0ZrhvJGYm+r+yASzR4 X-Forefront-PRVS: 0814A2C7A3 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(6069001)(199003)(189002)(76176999)(101416001)(50986999)(47776003)(106356001)(2201001)(19580405001)(19580395003)(66066001)(2906002)(87976001)(42186005)(76506005)(105586002)(229853001)(107886002)(5001960100002)(189998001)(40100003)(77096005)(5008740100001)(586003)(122386002)(1096002)(4001430100002)(36756003)(48376002)(33646002)(81156007)(4326007)(6116002)(97736004)(5001770100001)(50226001)(50466002)(5003940100001)(3846002)(2950100001)(5004730100002)(92566002)(2101003); DIR:OUT; SFP:1101; SCL:1; SRVR:DM2PR07MB624; 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: 1; DM2PR07MB624; 23:7slb0OAyB9x5u8I/ntdo7B9GQMkVGZz/DBfkUTJs23ONNVurvLv4NZX7wGktfTWRFHP2E2RtEgqxGcjapHaIPESvuXUsicoxe6NZ8i61XveOJSlTJ6+44kGxK4uVgnTVXoW6bNA6tXfqca+Y3+SeEsppPHZSh/a8nh9IRtzMuXy27/Z40jyMWuITy0SC9YVajN5tfn3PrKvkcwK2P90FQxRAuVSFyQXOQTgheC/vVZwZ6xeZN/uV1iyGv3Un9pjLsU/hJNIsV7zu+qYgIqbodZYRytHl14QvkmidoVaSn0M6/vYmSPVoaNKvrkAyHCL9AcgcV3Ly67cJDotTy1y6TSIPiEc10SeqqfjPhT9efueTgqm+HnY+Uq5TR1mub7ITJbkfHBpdGWCpDJUWjHeIy2WbRiDjcgPSDx5Sd0yiKth7onnNMD5XrhpAxioBo5gffBgKaIh14WPPBxoRzCuYNyehuPB4mtGAmNpsb2XhmvtZfoEMl1Qs2lF3/W+Wgg3fjwM8bwQerRIJb79MsvP3YikamEmflJ2tsDTmj6V3P2d2VLEmq6s2nDHTrbzD1/C7aavjX1JqwplYY7wbVJVDzJY6euyQIzPTTQf5ueNecwyUL5Lv9bPlv/ZdtjtPtQ715Q2fLp2WfcknmTEB2DwQyt9i1I18uRf/l5z6Jcr1S+UkVIeMTFn6GL9Ew3zlOe1F/bJQk41rbrmV6jz+vBHFJd8X3Y7BcSUHcn00x97mw/9NrfUGZDI46Rn1/Qzehhv9X4T/4RQcJDv+mFmoViRSMfka2oiyWUS2UfSPlTQGhRBdv4Ke91eXACXEKEgiTuTmSO9kTmQAX7fKagbL5eeoWWH3oMbXQUq4WOQhrq+k8euk0nP3PlV3/IUJVKZ3bwSfv0xoOw/OGeC6Yc1FCctVhafX4hgODSsxrDNc0BIdFhJgeiyYS9/6WlgCCKPQJMUswdgz3u5084gUzRQyVeW9C1zhqDh0uO83ghOuWDM7OS8+IURIM/aDhJqDUdy3C4x4V9eSjvkd4ZCsp1WlQMi5Ky2ITVH/3xZ3znzvvTHju54nqLCkkdJj9iUvJvnrJUQN536P2XaFxyfJYnSG/Jg+XD3f/a0uB0Xz5F6UJSFW+BwaoX0kCq98j1L5fB23FXpWBb8AM9ZxZo8H/xMV7JViBHF4iiGbTaSdpK31uvhb9Wk= X-Microsoft-Exchange-Diagnostics: 1; DM2PR07MB624; 5:N91/B1s3kXuQuoDVYUtBnYInW5abAEY73OuFs6FnZZZ4raHRTqG+K/UrjIQmA3fhw6Wnjfj9q2+d7Dr/U59BlSoWB71DnrbyMuzZq3oQ2emLtFqTE/wt54pr/app0pk5HqNA3D/stppb8nBvuMC0Bg==; 24:pfQRg16nNgqaOVn5TsJ3VXmRF7gBnLzZYeGoHs/ntmpcnwIOvAa/FKzA0vIhAIL68N8G8qe+g13tPXFiOHMW3U2fSDEWMz1TfK8E2GQ5dwU= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jan 2016 23:41:03.8739 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR07MB624 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Philipp Tomsich To make life for tools (such as gdb) easier when dealing with ILP32 processes, we report a proper subarchitecture for ILP32 in the ELF auxiliary vectors. 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/elf.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.5.0 diff --git a/arch/arm64/include/asm/elf.h b/arch/arm64/include/asm/elf.h index a519233..392301b 100644 --- a/arch/arm64/include/asm/elf.h +++ b/arch/arm64/include/asm/elf.h @@ -160,9 +160,9 @@ extern int arch_setup_additional_pages(struct linux_binprm *bprm, #ifdef CONFIG_COMPAT #ifdef __AARCH64EB__ -#define COMPAT_ELF_PLATFORM ("v8b") +#define COMPAT_ELF_PLATFORM (is_ilp32_compat_task() ? "aarch64_be:ilp32" : "v8b") #else -#define COMPAT_ELF_PLATFORM ("v8l") +#define COMPAT_ELF_PLATFORM (is_ilp32_compat_task() ? "aarch64:ilp32" : "v8l") #endif #define COMPAT_ELF_ET_DYN_BASE (2 * TASK_SIZE_32 / 3)