From patchwork Mon Jan 9 11:29:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yury Norov X-Patchwork-Id: 9504497 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 99A6460757 for ; Mon, 9 Jan 2017 11:55:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 78328284B6 for ; Mon, 9 Jan 2017 11:55:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 69B0F284B9; Mon, 9 Jan 2017 11:55:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id DA218284B6 for ; Mon, 9 Jan 2017 11:55:20 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cQYXm-00021D-Ll; Mon, 09 Jan 2017 11:55:18 +0000 Received: from merlin.infradead.org ([2001:4978:20e::2]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cQYXk-0001zn-AV for linux-arm-kernel@bombadil.infradead.org; Mon, 09 Jan 2017 11:55:16 +0000 Received: from mail-sn1nam02on0049.outbound.protection.outlook.com ([104.47.36.49] helo=NAM02-SN1-obe.outbound.protection.outlook.com) by merlin.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cQYCq-000777-7k for linux-arm-kernel@lists.infradead.org; Mon, 09 Jan 2017 11:33:40 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-caviumnetworks-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=zhBFHjv5Fbkd2e0mz4oS1KobxAMGPJQh3JadQpa/CZY=; b=X7MWuqsEjRqHZFX2HsTamNedXgolic09yMu9DZeyaZezbTHoOxcwKq8ScnP02JIOVizBY4SYA4/vFgXpHF0n+KUv2PknjdtCRMSATknvnvoBPgJ0dQ6imOV3CyBHp+BAd4oP/Mi3/JWrGovnwKXsBCbPW5SaZ4I3EBO6DR6/qUs= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Yuri.Norov@caviumnetworks.com; Received: from localhost (103.78.20.242) by DM3PR07MB2249.namprd07.prod.outlook.com (10.164.33.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.817.10; Mon, 9 Jan 2017 11:33:16 +0000 From: Yury Norov To: , , , "linux-arch @ vger . kernel . org Arnd Bergmann" , Catalin Marinas Subject: [PATCH 12/20] arm64: ilp32: introduce binfmt_ilp32.c Date: Mon, 9 Jan 2017 16:59:49 +0530 Message-ID: <1483961397-8599-13-git-send-email-ynorov@caviumnetworks.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1483961397-8599-1-git-send-email-ynorov@caviumnetworks.com> References: <1483961397-8599-1-git-send-email-ynorov@caviumnetworks.com> MIME-Version: 1.0 X-Originating-IP: [103.78.20.242] X-ClientProxiedBy: VI1P194CA0017.EURP194.PROD.OUTLOOK.COM (10.175.178.27) To DM3PR07MB2249.namprd07.prod.outlook.com (10.164.33.147) X-MS-Office365-Filtering-Correlation-Id: ea068ee2-017c-45cf-b354-08d438834eb0 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:DM3PR07MB2249; X-Microsoft-Exchange-Diagnostics: 1; DM3PR07MB2249; 3:oPnyCrQIaqfNAqBUA790Bief58/ZKvoSBR7DXyTS3hl/v+yQHBrDPkzxGn2DwfKXefKfXR7ITnYeh1bIsThLVJyVPug9GNYzLa6bgWbSd6DZ9hovkXevyMA426aWq823bM05Kf1E64dlBpVEjwqKCMa1SgCebgPYoWFQ0tw/X+cTnzks+OZ9u8StIA9QXo7QHsyh+QeFdcW+5aAakIZu6/sdBm3zaBD6NG4zJrIwqk4FdQgf7s67bHcQJLG6kECSYXwa0jfoctU0ZRAK9+tWPg== X-Microsoft-Exchange-Diagnostics: 1; DM3PR07MB2249; 25:KPbfaLEtj+skMEIntd6P8vAsfStVfQAiIdCjDysK+XTBsahHFX2SAjI2MbJ9P9Y7q3QYlT3nl9VSVjXKkIoCmHrIHtmkMbYORd3xVlhw532SwhjSgD19RNq09PWEBJlwiH1ElBeJHC6W/FVG2iO9yBdsTeYrsf6OCIOn5yf5LJVgCpdTPUUEx7Dsau8KLTfBOLBGl/jINCKcWDK51lCbs7dbYEtBX3LyNAx2Yqd31GOBkQ1FmFvMAqPq1E65dzh8W/CHetA0z0OMvd+qZOIu8lucpFFwlZzpYk8BGCSVaF42PXiv8QAnMNmkxr78wfxFUa5QSd8Vb+0enEdO/EiIxfiz7WEviyMHysR0DBXUtW0ZSwZ9GfplgJT72F9VpDcaxmNt5gI439oPosD7KNdqa4W02uVEcEwWGaQE6p5LyaOLJqwEUx359CJEvrAiFaBaigShu5lWOB5Yqd2hHb/smxDMjTZu80jioXVtJ4Z/WAIJyS1/g2CBXsXqdbL+sKN4dgaCGk/Htu26uwADRnqKF4M7Tg/7ebOpICSIU5KrK8LEHxyRqbnkqDBDIH89uApkX5sZCa35tVnZUb1PMYqS2eRsZnt+YfCP6m0HAwqesEBkp5+dgc6mpMsCYIGzXew/MyILVwftxSsobKei5Jmn/EdBUoun4r1vuZ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-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(6041248)(20161123562025)(20161123555025)(20161123564025)(20161123560025)(6072148); SRVR:DM3PR07MB2249; BCL:0; PCL:0; RULEID:; SRVR:DM3PR07MB2249; X-Microsoft-Exchange-Diagnostics: 1; DM3PR07MB2249; 4:Sb3iT+IH0UzoE/+nsJOv/kSQzbGECt4AgrpiYZKV5VvcQ8N04PihvSAqM5/RRO0MYVRolY/Yn2NMq/AK/yIEpxON71bJMngQfZtn1VSJQyc69SJ9aP37BF5mTcLrxLUhG1dmbx4RrL2NmX/R7+SOjUjDcUB7t0j1mOMqwp1xdSdsjZw5VXU/FzGOC1btsiw4eS7Iz3ob9sO6ue3u04MmLKWtebF0FNfWhSb9xvUpyCNoK41NbKBaSHEDnhFN5fUh9KJ8mo0XWUgq+q8aPJyBz+z5oe8C+Ygbh6dRJJycTSrOKcR0OVdXyfyD9JE4BHVbd0uaCXSdEFE9Z4ky9dt0ZDxokgMbj/w1MDnEQZsiw/zE5FxKDy7qpqJaY8hBKhlHWjSPc9OjoccwrF11JoOujlp985kErkblisklAAZo08sZqVlQGflRFjmkgDkt/LP9SuoPLIeZT+9ck6VD0i2byjXSf5uitUSn3MhlCczzMUV1Z5ohXjjEdGIl6uCYblob0g9NvfQLXgVxllR3ERQ/jhgFcvQUMGq4eQAX3iiRixOFrL3OQf0sTRh4ke5g4D2IyHXpvu8yqOi1VDslT4NjMg== X-Forefront-PRVS: 0182DBBB05 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6069001)(6009001)(7916002)(39450400003)(199003)(189002)(50226002)(5660300001)(7416002)(305945005)(8676002)(7736002)(50466002)(48376002)(50986999)(76176999)(5001770100001)(97736004)(189998001)(92566002)(2906002)(6666003)(2950100002)(54906002)(6116002)(33646002)(36756003)(101416001)(2201001)(47776003)(3846002)(4326007)(76506005)(66066001)(6486002)(6496003)(39060400001)(38730400001)(81156014)(81166006)(25786008)(5003940100001)(106356001)(105586002)(42186005)(68736007)(2101003); DIR:OUT; SFP:1101; SCL:1; SRVR:DM3PR07MB2249; 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; DM3PR07MB2249; 23:zdlhf2okU16rlmmDalda0h3z5d3vVvLlk8LEk4iu8?= =?us-ascii?Q?yP9fpkiGgc02SVW14REQUTD+x1+FdIhf5dgpp9CDB3HFsmfiJ5gilu4nt6Y6?= =?us-ascii?Q?ecM2A1B5C0op4UIifeu39Xx4baPQE8/8MXGupYZH38Fj5t7lXc3czSh6oinJ?= =?us-ascii?Q?VQ6D8sTOo5FzyMadVxVshioK+zYBqBVv/FD2d7BAqtYD96nS+Vt41xeWfewK?= =?us-ascii?Q?u991eJ/J6/pERp+fzYv70M87zQlHGhGqJ66HtGg+Xgt4Wg+wwtavt8SJXghS?= =?us-ascii?Q?XbZjvqMeSXL6GYQpSu28o4NzVR4mVtHP8SzsOSUyZDtn3Srgs2aZ1tofgzuL?= =?us-ascii?Q?hcKspC7JvKSm+MBWw2PUs8OvzwKoFuUuiOBIUVfhZZzPygPDcxKkjIYUz9sj?= =?us-ascii?Q?UfTvMwOMlC4Gf7rYTFNjcKLM4mzyeOF54TegDliIoWR7RBpWyLXGbdeYnB+n?= =?us-ascii?Q?SlRTdF2SVatZ8xj78/229idxsncRkf+4unSOIlVxHaZh+t9yLCxQng58djGw?= =?us-ascii?Q?5uDw1n9Q/UHV/aaTcSwNMI+jKnk6qG7DtCEY946D2HIov6E6xV1ALI0FeaHY?= =?us-ascii?Q?WersOq3tXFGLd/WtKDGGqJi9jtguprovyTVC34xjzZJmcJEdlDw8GElzDtgM?= =?us-ascii?Q?gEuBWtMDFdehs8UOV0Mv0atcO05XFsD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; 5:Nxdx3dszpfNrgcEDekpqAA771Bf2zaRiJ2u7k0yXJfiK2INTIc0tO9bJ9jBwkhCHbzdCBDct0BMP/2qd3CYxf7/RBvaz5Dsac366pqR/BCq/yf/L4W2yYRR0/qhvrdKvYW3JbX0uq42ofg6QKYyV3Q==; 24:W+X0D/kbWAGXEs3nN43wrIhTLsIWcqxAhuM2CPnYIjVv7a8109plP8RfSVEXoLuqejqo1SHlRAqD3bbQiEEWxC9k2NSS54xeY8vTv3ACsHg= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM3PR07MB2249; 7:pj982ktMaTJS3cxd8URiqv/HDwCPjgVuc6NqyamXTZiWNIDsR79DJ8FBQRi8RCx2KQbZbHpOOl+Kxhrm8dcDGqvUUcteTMA7WAgkKlJc1rx98oADIAxXekeNTkhN7FiLktWpuniZ0wqGJSIEF6AMOaOtsIpuQK1yqrh2J0pTe6cRhtia4wafmlG0GijPiVkvDO4UCI+NV15CVwGMR1m1jnLT2ZuB236fUuykir4pPCGR67u4m6bo7xSlPkI+/XnsGWRJcnlFxDPKpaSefMieXZwxTfkUgP4+xtlA1v4dUCAITmPoBDYT/KxGYMVxJX6KCc9ji2zNrCTKiFyl9PYrwRz7fW1YD1643/3ElVxhpeqIikHCe7ZGBWJLGGBopoNfRGw4vcGKesK4H8R58NJ4ZW8dVCBJrpf2gwNr5VUolfz6VdIXX7PAVc0AYSvhP8+/tfM03Ls+L7tBzdErkBdv/A== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jan 2017 11:33:16.9840 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM3PR07MB2249 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170109_063340_451901_B6F00B84 X-CRM114-Status: GOOD ( 14.54 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Pinski , Heiko Carstens , Chris Metcalf , Yury Norov , philipp.tomsich@theobroma-systems.com, Joseph Myers , zhouchengming1@huawei.com, Steve Ellcey , Prasun.Kapoor@caviumnetworks.com, Andreas Schwab , agraf@suse.de, szabolcs.nagy@arm.com, geert@linux-m68k.org, Adam Borowski , manuel.montezelo@gmail.com, Chris Metcalf , Andrew Pinski , linyongting@huawei.com, klimov.linux@gmail.com, broonie@kernel.org, Bamvor Zhangjian , Maxim Kuvyrkov , Florian Weimer , Nathan_Lynch@mentor.com, Ramana Radhakrishnan , schwidefsky@de.ibm.com, davem@davemloft.net, 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-Virus-Scanned: ClamAV using ClamSMTP Like binfmt_elf32.c, binfmt_ilp32.c is needed to handle ILP32 binaries Signed-off-by: Yury Norov --- arch/arm64/kernel/Makefile | 1 + arch/arm64/kernel/binfmt_ilp32.c | 98 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 99 insertions(+) create mode 100644 arch/arm64/kernel/binfmt_ilp32.c diff --git a/arch/arm64/kernel/Makefile b/arch/arm64/kernel/Makefile index abe5040..f661888 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 0000000..d667a6e --- /dev/null +++ b/arch/arm64/kernel/binfmt_ilp32.c @@ -0,0 +1,98 @@ +/* + * 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 + +/* + * Compat version of cputime_to_compat_timeval, perhaps this + * should be an inline in . + */ +static void cputime_to_compat_timeval(const cputime_t cputime, + struct compat_timeval *value) +{ + struct timeval tv; + cputime_to_timeval(cputime, &tv); + value->tv_sec = tv.tv_sec; + value->tv_usec = tv.tv_usec; +} + +#undef cputime_to_timeval +#define cputime_to_timeval cputime_to_compat_timeval + +/* 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 + +#include "../../../fs/binfmt_elf.c"