From patchwork Sun Jun 4 12:00:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yury Norov X-Patchwork-Id: 101364 Delivered-To: patch@linaro.org Received: by 10.140.91.77 with SMTP id y71csp495272qgd; Sun, 4 Jun 2017 05:04:05 -0700 (PDT) X-Received: by 10.98.156.133 with SMTP id u5mr14757799pfk.76.1496577845512; Sun, 04 Jun 2017 05:04:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1496577845; cv=none; d=google.com; s=arc-20160816; b=W4gJ0xziqOkzho5sPnwrVFFrWeR2nyy3jlfON7TJDqNGVC2JMSqHactTId3k1ZBErZ MvdHhMv6zlp8PWds35yQLpgnxVNZLD1rKu8GJ5PaRpiwXK84YBVkUH3xgoEg63wKdTr1 /e0gLgEE+lRZFH8G/Yxzazge4Smx0n3Sxv3nmGVQ1HV8O3g4GpnsJnHxEELzx50BBTXe 5CFSY0aa6e/JQRjhLzbqXNU5yh2rlAlVED2JqwJkokoEOEKOE1qOuMBgELul2lxkcABV 5UIFoF7CRHBTnASIDjots6QxkLh3/yFb0LPfXTb1wHE12zpDVYZsve1Qr+9u+L+Mlpf8 wkKg== 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=QIxeISHmHiVRY+LqvDVJdJG2Cqu6YtEOcUlcyeZ8140=; b=MXyePjxRDm811aadCLGQuR94pddlHtG1rgks361CyNHZRs8LjrboiJV+unwJz8xPXT q5Hq4o1szIuxGkvb7mcIgqwDe/ZB1Ww55vkvsRnmA2bed2TzRBabWQ7jfQ6nsu4ShNPC EiIzKfpNbFB6Q1Yn5JBnxaEY5QhZjxp1nUPJQT81sP/9sC8igCVo755QWRQHZm6EQqwU ZvZF1facaYEJUafcm+mv7nRctr4zmGwvVqXB0/qD5hvWHX/bHqpze0Gn+bt1BOOMVOZh Jxymb0xepWWyIdbHzi/gVipcexTkRSPCwWu0wxzA0rMIQixfrxxyXc/h5HEHi3lz+wT4 74WQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@CAVIUMNETWORKS.onmicrosoft.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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g25si4622106plj.529.2017.06.04.05.04.05; Sun, 04 Jun 2017 05:04:05 -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; 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 S1751359AbdFDMDq (ORCPT + 25 others); Sun, 4 Jun 2017 08:03:46 -0400 Received: from mail-bl2nam02on0044.outbound.protection.outlook.com ([104.47.38.44]:47264 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751230AbdFDMDJ (ORCPT ); Sun, 4 Jun 2017 08:03:09 -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=QIxeISHmHiVRY+LqvDVJdJG2Cqu6YtEOcUlcyeZ8140=; b=TU+jE6JZOcUBKt1ZNqQqSrk6N9r9sUVE7Hh69mFioEUb4CX2O0VhV6jU3gT2iM/vPumyRw2svcVgNzyNWwDWFN10tqLn+lMdEBzkYURQukcXCvvbf3NpwO4/fx/8yqRE0SpS58zoIQ642psMXAko3Zafx5bzLBAWSpHxkS29CqE= 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 (176.59.55.28) by BY1PR0701MB1272.namprd07.prod.outlook.com (10.160.108.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1143.10; Sun, 4 Jun 2017 12:02:36 +0000 From: Yury Norov To: Catalin Marinas , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, Arnd Bergmann Cc: Yury Norov , Andrew Pinski , Andrew Pinski , Adam Borowski , Chris Metcalf , Steve Ellcey , Maxim Kuvyrkov , Ramana Radhakrishnan , Florian Weimer , Bamvor Zhangjian , Andreas Schwab , Chris Metcalf , Heiko Carstens , schwidefsky@de.ibm.com, broonie@kernel.org, Joseph Myers , christoph.muellner@theobroma-systems.com, szabolcs.nagy@arm.com, klimov.linux@gmail.com, Nathan_Lynch@mentor.com, agraf@suse.de, Prasun.Kapoor@caviumnetworks.com, geert@linux-m68k.org, philipp.tomsich@theobroma-systems.com, manuel.montezelo@gmail.com, linyongting@huawei.com, davem@davemloft.net, zhouchengming1@huawei.com, Bamvor Jian Zhang Subject: [PATCH 12/20] arm64: ilp32: introduce binfmt_ilp32.c Date: Sun, 4 Jun 2017 15:00:01 +0300 Message-Id: <20170604120009.342-13-ynorov@caviumnetworks.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170604120009.342-1-ynorov@caviumnetworks.com> References: <20170604120009.342-1-ynorov@caviumnetworks.com> MIME-Version: 1.0 X-Originating-IP: [176.59.55.28] X-ClientProxiedBy: HE1PR09CA0085.eurprd09.prod.outlook.com (10.174.50.157) To BY1PR0701MB1272.namprd07.prod.outlook.com (10.160.108.18) X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BY1PR0701MB1272: X-MS-Office365-Filtering-Correlation-Id: 2c915528-4c40-4716-bec0-08d4ab41978d X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131423075)(201703031133081); SRVR:BY1PR0701MB1272; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1272; 3:Jk1Ev74GdbiO2oAzRbBxdEssntpu6wVxN5NFazoq1YMRXdjXEOO8QmZ0kKPquQVeGKRz6Vpag7fctHipG2dMp5gmfsuEDXV8N3oRWx0dchRFeohCvWNdFM2KQt/Kdp4I1rFip9wQe8z67c92f6/8BGAInKhSgnDhiYooAWymsDAQw4MRcAljm9/8T94xqE49qaWc1M8tcbpyp/2tkcw89coUaVFkI3p6YLnS1M+BqXOihC0yQIp8y4mlz1DIAxz+X8lvx7zIE8y5jLm5fLNLgP6hIy2mqtXM1S6LsAYV9qMYlyUCVimHH883BWNry9kuKRrpTQpJqv4KT/cC9aSHbw==; 25:fL6TVdGnANymKksiTljXxolvsXPWbUZa8UEUdUMqUuws6euhdxa3Ugr9IR5EviAveIPcx3TLGxd7iwgkJPPpqNNfV+Ls4z9q+VIqgxOOyo384g2hZyp1I0UuEnjfF6eu7WAstg7RK7BL2m7XGTG+9OSYfq5vsyFgTI5tzlxakXVZnvh8K14hiuA0Onght/bTrMoRme1q9qjIHqoshmJsXXB8IVf8bmtiha5dCgvKtG5PRhb1BDBLAW5E0dE5VwJ0sAYjtluoEWK/fBiq3C49kyiBRYNdxq/6kZqm99SW6c/9sS38caRboI/iN9pBjUL9wfiq9gKOEIrsKdbJ1rcYQgBEsHD4gISUEXRm2PB+O13mxFlrJjSDrLAlHAOSgNpHupZEY/7qeVH6wImWVgEL0pPmp/fS+BzqcCuh68onLCICSCkLkov63Cws73RcC3soZZZcFdWmQxOV/z+PCJ32W/Ciz2gGQPc1CtlcZwl8hn8= X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1272; 31:nQA4M4UzT312d0XzD4Q1pf2k0W8qPIXwW9yZW3DZ35AyE6pcZJx5tlUGa+30n276+F3bF3FfhVP/EJLhi/R5/mLtBYixLZ9fSmERZvjlfi/748BJLBtNhATCw0VeN4wg+g6izDjNKNTU44liccxPagaRoPl/XDKDga32CmSjxYa5OkZktoFXHH7EJWJ3zbuku9bBV7fSotiIlhV1w4naxJ2pKbmIoTTwTUOEFM3cIVs=; 20:KlUrgOg2+GaT2hEP447EAiMiKyHVSjt6XRYASOyO01mNLUTbFx7Frr9yFWNfGNDxZbO9nYR4dMDt8N4pUuglTyJ3Cb26R1MCSi71ef6nmmoeq2oawi9qzuSz3Tk8f/Q/TkPLNpACjGvyMBf9b1OOfm/bkLpU0LBqUtDQq8Q0zYwxrDOCkjbLGNxdwA5J22LVa1VCsfvkE7pqFn56dxVqQSf+IDVyIO0pebNT02DY5zAJiPmxrQ2w2shj4Qj54r36OliduYd7fTQiJ+NMnxUJjlqJ9mblBq7/nA9ZngWyEKTUocaNO+1xYLvoZJQLQHsro2gyl2F7ZEuDhHMM8ByzwyiNbAPbDkWbEZohviyfAUZV3MURQ0nUeotm4bt751VsTEGZA4REDPGfe2+QqgXXzqeuZL6YTGJ55OZ3Me6CYRrUjLYmZgz/Z4t5nYPkgs+vfa8HzpJYwXKc0xWgNqY1CE+jMbnSbKFn7zxAQ2+SThI8+gY/8C9LMbTApQGrd30/+4NhwX3lczw7OoF39Bm5LdE4ihYt07DLhYKltd6MXDWvmOJW/V5+2FYo1ctk81pSVMve5v8qVi42MKf23azRkVK9wCKk+fkeJ+Jf2M4U2iM= 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)(3002001)(93006095)(6041248)(20161123562025)(20161123560025)(20161123564025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BY1PR0701MB1272; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BY1PR0701MB1272; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1272; 4:XQ5CIMfSAeXhUm2/9F8yfAxw3h0vD75dnvOmwCl7KjJ1hX5CxD7EiGXQ2O6qkCw6UmRuSkxSuYI5npSlrPUr1y3mSYtg/h8uecR8Avaz0GPwvM3FJ9gPhH/IqMK7XouZ93bDoR5mF5ej3Z2B/G6s6M5ubqTxyx3EANkHAiMh/6qEW7zNrbQyVnI6KTJHHpvespMtZlcV+J6k1BRTkOgbuTm8rMUS+WKlmDfRjcyKEx5NQv5V501cgsV2BxlqaO0Yi0zmsLK8T8MBJ3pkF4OJAwF9jrF8SeSJJseyTor4CQF52vVrEU0vsJ+a/z0hzaFJJ9xeW4lWYGocC4LNPAJP9/2Jezlft3dZIUzng1aSekSbUFTycX3DpNBS362nPe2f7IARa+Yiv0POFXdWWs07MtyvfQttyAxvhgwemJ+GCPVDqrF9X7nj42UCfORtke9ijZ/oYw1jpmABKp5dTD8dis51r6B+G+1yfiO7IBjKg7XFlAGvYoylPBfyHzQsHJv0Eb0z/WymU4r930VaAwBON4Ho43/+fF8Hk6+GuVFgqH2SRYchpWxfz60SgKe2TgOnRXlLiwwfZ0w/D9L50GbN8NiF2TsK/yWDxEPLxUh3TOY09FAybp55b07PFBZd64oI+YAjl2wAiOVB6DTXsBIiYKYY/f+6oG1T6oQnm/I15mpEsnhcioe8RkBXP0t71qjKNz9z6bnAhRU9rVNA+3ZV61EMO6UbEFE9MhFRX37FjTG7QnTd2h66qefZxXarvogdZ+kmGGGqYO44qer01UdP+qaHNVpsYmjCqEdJUmedZEVOTugUBzr6NuKdSNvZ540vsBuZHZWJUaTbkteTkXB/PDAUlIETcaYwfy0cnEjkuLdpZbvyMN496ZeYnb4Pno/stsAzz+jot/+f6oirRBIr3Ya3E/SuCY1C8gQUrUnxYtAZisbges9Vm7qeKXZMCgQmY+Xz9cvv5h2ue5kG5gsZ3X8UJ3YMRYzicXYyI0LsCTF9FVwqyZmZVsIs+SuSskOmlpHEEHQsEILvKZQpQbxyQDqB6Zsg/gUQK/cckUEUnxeg4fOmm+mQAtGvZXGzQsI90WQo/t7IOBVByYo5/kAMZg5cbYhPhNH7Ya5Nu713G/0= X-Forefront-PRVS: 03283976A6 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(979002)(6009001)(6069001)(39450400003)(39850400002)(39400400002)(39840400002)(39410400002)(6666003)(42882006)(2950100002)(6496005)(47776003)(38730400002)(66066001)(36756003)(6486002)(54906002)(478600001)(48376002)(68736007)(72206003)(2906002)(50466002)(81166006)(76506005)(3846002)(305945005)(53936002)(33646002)(6116002)(5660300001)(42186005)(50986999)(25786009)(50226002)(76176999)(7736002)(1076002)(4326008)(189998001)(8676002)(7416002)(7406005)(5003940100001)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:BY1PR0701MB1272; H:localhost; FPR:; SPF:None; MLV:ovrnspm; PTR:InfoNoRecords; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1272; 23:5Jz2XF+ZesuVTfTSLbaIwoLclKpaCEus1soTA+y3jYXu8RIYaetPknxmwaFla6CQE1AmEIDrJfHj2VqUkpcUcX01NNWUvMWLVThw+RYpOpc/mH64NClPKRuozQ/BqFR44UebiGVyUlV/9unWieUXMfYkqQEcHjnSJ+fczZQ5DRRfjpMvBTzid7HyHaSfSl+vPz5k4YbVo5ZqZgld0As11yJNn3l/7/6MS5OYwWmJyw/tle6/5Iowdlojl2Mi4lDKfUoiXTMlk4DT6/W+uIJ57jMdB7etkOMHvN6otIeDLFXe2IxALt8CCdVWESXjaZXT74jSMb3Lx7IAb7dqqOxhQI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osticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1272; 7:gBARX+zW6lgElS8wSqoVjF0jZ2pZPzsg72r38ybpP8dv4bfYirAM5uHgTnKi2MDvZdHtJeJE80NOg5Ok+8nf7bqsPGxIvG3WYmp6QcoQRZrZL6HiX7+q8CpXLstG05rzHWH6D8vYcnku/LAugSVk/ZkzdMK3umcsPG7wjIHTMYPToFUTMaaAHDthg640KLiY3vyLpDy0YNIyptxs/+HYvUUKPslC+naOT3FGd/kzAiEM8NqQ7o2GKVt9sumq4F+7vvX5qyKh7LQA9/C5uph1fHJ/kMks5PsL/lUJWEQIun7EbsT2zp9KjcxUgn2x/TqoJSvEx4R7n5wGxwPu0tRGNg== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jun 2017 12:02:36.0580 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0701MB1272 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 6f872741fd3d..5ba41095c466 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"