From patchwork Mon Jun 19 15:49:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yury Norov X-Patchwork-Id: 105875 Delivered-To: patch@linaro.org Received: by 10.140.91.2 with SMTP id y2csp941079qgd; Mon, 19 Jun 2017 08:53:23 -0700 (PDT) X-Received: by 10.98.130.3 with SMTP id w3mr26152801pfd.128.1497887603494; Mon, 19 Jun 2017 08:53:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497887603; cv=none; d=google.com; s=arc-20160816; b=mhHLzbos4QzIUDdD2l103jKzrR36kys8gIbHiK1Z4zdguce+iTK5Yvqe3neY7qn8Ut Aj39RbWcaOu9WM6Oh9TJUV9aJum7O7GtoGu953HEXHBHLsAXFfRA5S+UqjyXjzP5WgzQ wPhAQsx5Xjop2sMWys0QWlsHTeDBkgJJTfLqmsza8Eo9R5hXw+or1GlecL+hR7sppGBZ fw64doD87mzToDqrcuwjSIORc/qscvtYWqJ2GlpmAn9PMgpdk63fC9UDrveeH9/ii2tm uNhV5+RNQk/TVWDjWpHwG/H/Te57bktfuFxNoH1RyDiFzg+YEqKI14k/kVlI9xINwlwN lvyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature:arc-authentication-results; bh=IxAN9JlvAv7V6d5GQvQ1klQkMAlPaxzUh1wSsMTLBQ8=; b=TyfabJxONSSqO+CTSIEjkA+xuxVdQRBcJTpLiW98E0AIyA24ew/KJH1t57iJ3ENOCb eZtfE4DaF0x9314LZYGiobQuCKsaqbNE1OmK/l+lwPdg3aJhbrMWM0qNMyM+jg5Dm37b ul/K5hpvycceGY/8t9hbf7vskNJHhdk56+mLf4nPlSxn1+wFt5gX7xndMdeWkEdvUc4B Pj0MrW+Itaxvw0X5nzDvrcfpaJgPCUEDIh/D44rmvlWTIojggNMuOuAMXx3ovMy1kAlR PmOwFWyzcqGB0J1eWtY/SbMvijVcAJTJO6AIgvgIcPU0clE5ZA431ywMF4tYtoYUPPUK u11g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@CAVIUMNETWORKS.onmicrosoft.com header.b=c58it7Ks; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l12si9274826plc.424.2017.06.19.08.53.23; Mon, 19 Jun 2017 08:53:23 -0700 (PDT) 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; dkim=pass header.i=@CAVIUMNETWORKS.onmicrosoft.com header.b=c58it7Ks; 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 S1753738AbdFSPxG (ORCPT + 25 others); Mon, 19 Jun 2017 11:53:06 -0400 Received: from mail-sn1nam01on0044.outbound.protection.outlook.com ([104.47.32.44]:43309 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752462AbdFSPxA (ORCPT ); Mon, 19 Jun 2017 11:53:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=IxAN9JlvAv7V6d5GQvQ1klQkMAlPaxzUh1wSsMTLBQ8=; b=c58it7Ksf0Omp+Tx2rbB9raFoxhMY5hhzglDp0b8SjmwgFkoJGZYKsjRtrE3BXeAHvHe1ohsyT+L+iF1ugzJ5ebOJOK9u5Bv3isHRhNre4Za09MUlIzgboBhmHZtdhXwJE96RLWsyl0o1LtA+xNPZxoCa5g4cF/7OcealTeNOE0= Authentication-Results: arm.com; dkim=none (message not signed) header.d=none; arm.com; dmarc=none action=none header.from=caviumnetworks.com; Received: from localhost (85.253.137.34) by BY1PR0701MB1864.namprd07.prod.outlook.com (10.162.143.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1178.14; Mon, 19 Jun 2017 15:52:45 +0000 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, Bamvor Jian Zhang Subject: [PATCH 12/20] arm64: ilp32: introduce binfmt_ilp32.c Date: Mon, 19 Jun 2017 18:49:55 +0300 Message-Id: <20170619155003.13218-13-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 X-Originating-IP: [85.253.137.34] X-ClientProxiedBy: VI1P190CA0022.EURP190.PROD.OUTLOOK.COM (10.165.188.163) To BY1PR0701MB1864.namprd07.prod.outlook.com (10.162.143.146) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9962ca2e-a063-40e2-bfae-08d4b72b3aca X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131423075)(201703031133081); SRVR:BY1PR0701MB1864; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1864; 3:ILovznBKgCx/hmi+lK1mOnzbF8nGBVpAAjNLrUwrZf8BtbohYnlEmDtIiaNhruTdggzbTSi8emhcisuKMsj6wlneeEyzFVSQr6eoRufHeu8MELpQueMUSqKLqxq9mrALfLb4Ur3ouqin1BuYPax67YKFdV0aQjzJ/z9K+dnrhidiqV0W98IYo7ueD3F027OfkGdy/B/zgF0aJl2hhoV5H38DIc4Fhq2Y89DCMDNiNjcxGwymnCZOoBf4KdlEBrPLttO//1IdRWUQfkSqIgGDi6SoqsbAZEOJu7dizkXTs5Qpga5FY5GlD5OVJme7sfWyVUbypG8gUVAqgKQ57iRDfQ==; 25:A5/JprNsNzsyKzFFb1Q4Lm5yvSkIALbwOM4cr+4DmDqQ60qkn4LefkwVikSzNq3M2lg8UqEXIrrQNtaMy4/PIDUjHd0eojOc1+9oDOPUyV7P2agFKfKtx1AQx8OqQZrXBXhTIK7lxbmEpgawartFXs47494qIL+KMLYCQLu2tVkK7VmAJa/4StZdJAz7k26ZJ+rDJXkahSKgho4znieP6eXSXB7g7jGwBvzyAOKdjb/RTylhqwDP9ukMnfpawwhUwMnB6c7CFzrICnL6C1eeHRLQEOoGaT2ZNdxV8zMHqZ+rS5vzdCv8KRGIVbqYde313Y7qnkieXiSvbcrqzIwVzRPIc4Epd3f8K5w8V9gzBifIZK1d72lq81ED+fHNu7A2Fds++cCwGprqPjf5EbmkEWkdWTKhaW4dWTgAkKlirs4mX4nGwlZa46R+FyQ+dISYts1nz4kNdMXBVAERN5AsrPB6t+3jCAwrHiTbbv+EMOk= X-MS-TrafficTypeDiagnostic: BY1PR0701MB1864: X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1864; 31:jIo2fu1HWKcquCmkGCB/vyTd9hJt5SdQiYxFi+0liub535RJKmJCPCeFOkcx3Q9oiuYopXW2GX+GL6zfTsNYuoGvliNJR4CGT8i9kp6byzq9mSmlqe9J9fgm9NjTno4v4QyoypXnbrqqTuIYNUz2lU1lPhnAiMSTjS2eE59a7K8XGoGXP4PjHUV53TOJcv6Cab4iWxob0g2wstdE2gS7HYiW1PlPE8usUhXPFScYDRY=; 20:qVpqqaXRtwMrzTqgfx8GVmXb7vntuIRhL1b8+OQWOKP/5jpCXUjYoSni84NJExEpiMV/PwP47P+D6QM7278Ortx45e1/InJw1oQHlr4b6oAcwBXpvqZhPN+IocWLoJxChliEFFTIXGvkm7kHruh9VwLz3oyMVwU6kRvEKcXeKsdBpCW0cXX3J7gXWbJSEw72lAJFEtPLr01xgAjfCNzlX86Rrji0WGa935ZCb/kOMinunwRc21ugnNpULYl3iOxXOHcDWDzPTpjO+b7lS8/dq68iJx9brNjelJtIi3LH/zXsZTepau7E+4D+6ToBxu7SHKWxhkYu2RAJmj2ZJx2obbI+PZ5aVunvEhCD+OZSlMcoxzTKytZ5YQ8/zwVaCeoBgTIGRm9lum7+uL5kPnGW289in60pCz0ZSKlAdGxAnclMK9OQbtLsvjQVtlemrwVgQ2jMMSkIKLid7ju41rEXhGhQ7YQzfI3PNUX0gZsPxXlzjcm2rNPk0RJaxRgrZljhu9wkEuGuI2SYZtuICAZbqCZAVZ+AopXX/sdOwrWxsm7/SPiOXCpiPFxaEMi33HGORZPQX1KLYA+3ZMcziIppa7tJoznxM/NadQmOwo/tKdo= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(100000703101)(100105400095)(10201501046)(93006095)(3002001)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123555025)(20161123558100)(20161123560025)(20161123564025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BY1PR0701MB1864; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BY1PR0701MB1864; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1864; 4:kV2rO56/LVerPOyRwy9lL41iNRY5sCkWid803AzGTagZmYvUAaoTYcTmTWfWGqMbUEMmSemZNXym5JVjXumrGtzTBon1Oq2tcJ5nmuMm7HEK2aaEqtPPv8+N+5byZHXsn3LuM83ANC8QQjTUgkPJyzKZM9Z+E/eMT6VwibRc8Gm/9aCQtERTnm9vmnoubAVvJwuptF2rQtes2Cz3TcOLne6t/VWJFlTHXLYfPPAnnbVD1N9y+4XNFhEuIWoq0UZ1xbDTwqvjxJ+kfJyiFeFGLBEICqLA32w7penOKAadtV+8Lq1daHrYnDxvIrkbAhzFWqeJ2uEWGLL6cEYNOna2WetFIJOPfiOT0ox/4oc0pHvFOGg3M0Err16zmU30+KdyYsd/21SfEhQDeCfdxhlEANr2If/P9S75tUNtBQS0w95mXfR9wrqSxv1zAKFdEjfr71naiSG++JDG6QvW7yZiaQ0E4WCyTRwUECdKNaPfPN4xUjymsDzBePIM3Q7jSxSyeLW2+/+ivHqDeZzXjkQDNiVKUS8sQDuf1RvJm61V5aYMFKv5va2PmniNKZxdLxtwHhth4bcmugVG06/B3PUOliNMpTMdJyedZgRiTeN6d4kqP0Ig8f76irmT/u964K7G7GYylGS3FMjSECES/czEHE5b9k4aOeUxfc6REX8v8+jPhFqkvpGfrecUSkvo26m8wBJMo5Ql2h3ypEw4lYMc7/5kYlVJ7gkneJx9gl61HQzmZzS+vtbszls9M9O+Dcqow0CuM+us0P4CGvNn4srrPcmVVJFJkX77ZI/d97/jLCJPnkGb1wyWRn6jzFKKKphjlIyvJ7pT+t90yAF+3EVcjwC5WRrQxPo4AFn8M4PykppBv3o0TbdDbgHdw3tLpwY1oO573Fseek4C4dGZCobvKHzTkrvCh5RfkbVTAdxVZEdeec3NNqsSWr36zEqKgO7P/F1fbmb8wOdVJ8tLUOzFJwOxeX/Oye1KASnX9BvvXJ2z+FvFPFA8Xkpea+391rIbdZ22V/fKJZDSOBJdV1qVuOqsx0eZLxt/wB1C49MxD/PtDEVFWX8yFOnMOlZdJh/chQQYeu3OgrYp4r58X1txHSDcin5Pwufhk76/OUrP1os= X-Forefront-PRVS: 0343AC1D30 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(6069001)(39840400002)(39450400003)(39850400002)(39410400002)(39400400002)(50226002)(33646002)(7416002)(7406005)(6666003)(5003940100001)(76176999)(305945005)(42882006)(2950100002)(6486002)(8676002)(50986999)(42186005)(7736002)(76506005)(50466002)(5660300001)(81166006)(48376002)(25786009)(54906002)(478600001)(189998001)(66066001)(1076002)(47776003)(72206003)(3846002)(6116002)(36756003)(38730400002)(53936002)(2906002)(6496005); DIR:OUT; SFP:1101; SCL:1; SRVR:BY1PR0701MB1864; H:localhost; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1864; 23:5A5+Mo5jo32yu3Fl7HFZH8Y2k8CgB4NKIg8SMEWPHz+AWO7Aa1XZ+fKOpvwDdZ/l2YdH/rKqnlKnu0HgflGyiaektgE1VGUbxFV4IIhOXLjywhLp5uJ+qwMdSCjHAQ/tvt1K+oGE7GoInqzTPz6nEvmjh8C2UfxbTCdsJ1ebj8fMBMVh8dugRKc+zq0HIHBSteYT9Fq/807FY+A6PJowFt7DnH9yJol+18feyOc2h5yYFtIL+XGOmptmjXeF57lA5isa9tTpCUtNcZhhQeRURt6rl2/dQi/rrHPCrnFzTt8Sx0AAobMsJwh0Jr+XXxiQsjB70M3sA9q3IySAycQZpAKJA8QdKHNtTdap8TceeYrlorEBPU2S8p14PxdusoI5o5sBJI8d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/J1JfKDMHdxlr/qV7NUfHgVpINkGCUV8hx2BVIQFVoWQsrzUTrbDfWuRNztnx/Jh8CtNwqbEd0= X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jun 2017 15:52:45.7987 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0701MB1864 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Like binfmt_elf32.c, binfmt_ilp32.c is needed to handle ILP32 binaries. Signed-off-by: Yury Norov Signed-off-by: Bamvor Jian Zhang --- arch/arm64/kernel/Makefile | 1 + arch/arm64/kernel/binfmt_ilp32.c | 85 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 86 insertions(+) create mode 100644 arch/arm64/kernel/binfmt_ilp32.c -- 2.11.0 diff --git a/arch/arm64/kernel/Makefile b/arch/arm64/kernel/Makefile index de6c84702d83..41d9a3ab07a7 100644 --- a/arch/arm64/kernel/Makefile +++ b/arch/arm64/kernel/Makefile @@ -29,6 +29,7 @@ $(obj)/%.stub.o: $(obj)/%.o FORCE arm64-obj-$(CONFIG_AARCH32_EL0) += sys32.o kuser32.o signal32.o \ sys_compat.o entry32.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_ARM64_MODULE_PLTS) += module-plts.o diff --git a/arch/arm64/kernel/binfmt_ilp32.c b/arch/arm64/kernel/binfmt_ilp32.c new file mode 100644 index 000000000000..bb31325e6f80 --- /dev/null +++ b/arch/arm64/kernel/binfmt_ilp32.c @@ -0,0 +1,85 @@ +/* + * Support for ILP32 Linux/aarch64 ELF binaries. + */ +#undef CONFIG_AARCH32_EL0 +#define compat_elf_gregset_t elf_gregset_t + +#include +#include + +#undef ELF_CLASS +#define ELF_CLASS ELFCLASS32 + +#undef elfhdr +#undef elf_phdr +#undef elf_shdr +#undef elf_note +#undef elf_addr_t +#define elfhdr elf32_hdr +#define elf_phdr elf32_phdr +#define elf_shdr elf32_shdr +#define elf_note elf32_note +#define elf_addr_t Elf32_Addr + +/* + * Some data types as stored in coredump. + */ +#define user_long_t compat_long_t +#define user_siginfo_t compat_siginfo_t +#define copy_siginfo_to_user copy_siginfo_to_user32 + +/* + * The machine-dependent core note format types are defined in elfcore-compat.h, + * which requires asm/elf.h to define compat_elf_gregset_t et al. + */ +#define elf_prstatus compat_elf_prstatus +#define elf_prpsinfo compat_elf_prpsinfo + +/* AARCH64 ILP32 EABI. */ +#undef elf_check_arch +#define elf_check_arch(x) (((x)->e_machine == EM_AARCH64) \ + && (x)->e_ident[EI_CLASS] == ELFCLASS32) + +#undef SET_PERSONALITY +#define SET_PERSONALITY(ex) \ +do { \ + set_bit(TIF_32BIT, ¤t->mm->context.flags); \ + set_thread_flag(TIF_32BIT_AARCH64); \ + clear_thread_flag(TIF_32BIT); \ +} while (0) + +#undef ARCH_DLINFO +#define ARCH_DLINFO \ +do { \ + NEW_AUX_ENT(AT_SYSINFO_EHDR, \ + (elf_addr_t)(long)current->mm->context.vdso); \ +} while (0) + +#undef ELF_PLATFORM +#ifdef __AARCH64EB__ +#define ELF_PLATFORM ("aarch64_be:ilp32") +#else +#define ELF_PLATFORM ("aarch64:ilp32") +#endif + +#undef ELF_ET_DYN_BASE +#define ELF_ET_DYN_BASE COMPAT_ELF_ET_DYN_BASE + +#undef ELF_HWCAP +#undef ELF_HWCAP2 +#define ELF_HWCAP ((u32) elf_hwcap) +#define ELF_HWCAP2 ((u32) (elf_hwcap >> 32)) + +/* + * Rename a few of the symbols that binfmt_elf.c will define. + * These are all local so the names don't really matter, but it + * might make some debugging less confusing not to duplicate them. + */ +#define elf_format compat_elf_format +#define init_elf_binfmt init_compat_elf_binfmt +#define exit_elf_binfmt exit_compat_elf_binfmt + +#undef ns_to_timeval +#define ns_to_timeval ns_to_compat_timeval + +#include "../../../fs/binfmt_elf.c"