Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1694685imm; Wed, 16 May 2018 01:28:14 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrKp0KwLr/ISn7CwKG8qrPX0iQO1DciDWG1xowhWqYj3f7OsXYXaHFKt0+vlDJIO1JbhwGV X-Received: by 2002:a63:7c0b:: with SMTP id x11-v6mr14948512pgc.384.1526459294103; Wed, 16 May 2018 01:28:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526459294; cv=none; d=google.com; s=arc-20160816; b=mFkLvtyl2D0/VNqWvR4CcTfVmQYzppr2P53ZnHJNKDPDEZSS9+J7KwkShJSux+9vUV 3Lp9bW1lAyxLwbfH8DKrTb7LQO03/IGtW5yWqR+WvAQS7iTkfWqtlhAirpHEAVTM2A6H JKifTGBbSoicsQsx/NPjoTFGLyUHzXHWs+PAqlZOHMj3pdsCpfBPaEnVvCFxJ4xM6xoZ nrTA/ylscqEHecwilaxbB3g2R6Jo64/pERxw/OZsLRwzUDnUy66xzeqV21QwBQ19piiz JIL4KR3j9LTCZn7VUyDeVEbsnlk0sHURuXtG4Vky4P0KO8+aXbvOWcH8V8r0g3wXcdyP YSVg== 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=xogTNeJJNm/XjrlfhK3NLi7x/BkgXaItJFu5a1Q2JRw=; b=oT3qbZgbG1Zw0Vv4kHVrPNilakM+CARZ7cYBjr3X9+l4mDgiivkl3a108v8rrfVa+k vPSb9MW2x4I/JirPVGm40O615ITwdZJMOa5s6vLtFxAWj7mihyNfnmTgnPpK5o6XpI6E IhXFOFe7bo1eAuYdmugBYPHV43xOfDXmLOjwL9+kCriobTDTsz++kwdFdvPPhqEoaEqI eeZNSJP8EYVg/bhSdRKlQCtjqLqY03ZV0/abVHxzW85TGcbH1uZ33hLLlPhmtlRKSGqi I82QeBo1i4D8YeT90QtAHwrM7YkCuBxT7Cw9W4divNB5u0Q5ETs6W31qumqe7Fl18y6T nUtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@CAVIUMNETWORKS.onmicrosoft.com header.s=selector1-cavium-com header.b=XMempxwx; 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 v23-v6si2116258pfl.233.2018.05.16.01.28.00; Wed, 16 May 2018 01:28:14 -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.s=selector1-cavium-com header.b=XMempxwx; 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 S1753022AbeEPIW1 (ORCPT + 99 others); Wed, 16 May 2018 04:22:27 -0400 Received: from mail-by2nam01on0040.outbound.protection.outlook.com ([104.47.34.40]:8874 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752877AbeEPIWT (ORCPT ); Wed, 16 May 2018 04:22:19 -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:X-MS-Exchange-SenderADCheck; bh=xogTNeJJNm/XjrlfhK3NLi7x/BkgXaItJFu5a1Q2JRw=; b=XMempxwxxnhyp/V2ktopPvyorSGw+v42tlCSUJq8fQIRx69GKVRtQPvMJ+fDr/fT7l5LxfYSADUZuTOg926V/YBXroeIgrN+Ak+Z7QKAPYwxkpObckCXQIb470+SNEe6rkANLdBdyjsW94kdibijvJKEc612pGOr68D266Xf+xs= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Yuri.Norov@cavium.com; Received: from localhost (176.59.36.13) by SN6PR07MB4384.namprd07.prod.outlook.com (2603:10b6:805:58::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.755.16; Wed, 16 May 2018 08:22:15 +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, linux-arch@vger.kernel.org, linux-api@vger.kernel.org Cc: Yury Norov , Adam Borowski , Alexander Graf , Alexey Klimov , Andreas Schwab , Andrew Pinski , Bamvor Zhangjian , Chris Metcalf , Christoph Muellner , Dave Martin , "David S . Miller" , Florian Weimer , Geert Uytterhoeven , Heiko Carstens , James Hogan , James Morse , Joseph Myers , Lin Yongting , Manuel Montezelo , Mark Brown , Martin Schwidefsky , Maxim Kuvyrkov , Nathan_Lynch , Philipp Tomsich , Prasun Kapoor , Ramana Radhakrishnan , Steve Ellcey , Szabolcs Nagy Subject: [PATCH 15/24] arm64: ilp32: introduce binfmt_ilp32.c Date: Wed, 16 May 2018 11:19:00 +0300 Message-Id: <20180516081910.10067-16-ynorov@caviumnetworks.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180516081910.10067-1-ynorov@caviumnetworks.com> References: <20180516081910.10067-1-ynorov@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [176.59.36.13] X-ClientProxiedBy: VI1PR08CA0125.eurprd08.prod.outlook.com (2603:10a6:800:d4::27) To SN6PR07MB4384.namprd07.prod.outlook.com (2603:10b6:805:58::15) X-MS-PublicTrafficType: Email X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(5600026)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020);SRVR:SN6PR07MB4384; X-Microsoft-Exchange-Diagnostics: 1;SN6PR07MB4384;3:tExdOi5LtHSDJhg73zRqFbO2X3NgBwhFMcD1UVfxyN4TJtPGe/ZJHOutN+S0Dk945zPyaur+Z0tOserRJi4Yej9kxl0L6IXWa84I/hkMKMjypKTfdIzlGcljWc5pskh7wXMHXQp/+hhJMKLCqzhupxNbB4K5pfst4Nma1fN6s8py7MT4Dr0nugg1Fyx7mZ1AIp2N6dbf7Ttm9uhb0IYhj7IVX1ECXLYLaDYeva49THaPUfqBBcSm3uayWGYvod5D;25:/hT2/YV7q8IEnJE8fB/5YXJShTN95IoqeZSMibuHRAg36QJE8kAMhqhmxgzVPymhSmts1R+jo60HGRlg3v7VcPHGawUnaI0UJZu6yoBAZHympVo/h9SyJqsOq7ovcyWocZ4hbEBRwaIU8ZF8LQpdcv3JWfkrfBwxWcgAZQ5PhWyufq0AsqqjNBHvz4y9FCSiQLPIZl7dUsuneK5dOsQ8VzAlJHaaf5YR00bpppCuFfSHl3rxVThh8XSnn1rgphr9XZa3pdmC3XSjxBr24kuSkK29q/Lzb6loLaQlx/tRJ0GHYI+3NR0QuVVwfi/bNoi/LhsNOXzWckAABCDjNhoxug==;31:LfFe//RUAmnYb81MKDge27hdBe+vOU1EzECZ9r27DwqtpnT4A7bgRazZaAtP7DU7Uufazkv5eI8+wWJfuD0lrNo8NaVELmgaRZ1NnZEgdpiastopPniNXkT+psUOg/rEINuJP3sgfgXBRoXfvPpzgNSnX74O1MRcTlwG4j2JOnfoHtAHDDnO4TAPKmB5R52F/BUlOZdTx7IRkZ3lS8rpLBQuMwV7UCyjPSV4Li3EWfM= X-MS-TrafficTypeDiagnostic: SN6PR07MB4384: X-Microsoft-Exchange-Diagnostics: 1;SN6PR07MB4384;20:qwstfG1TKktntLT2wMNnc3EqDeDpFxNTw4RuhknZlRWkSEHSjwO0Bcj9ZRlBeweMs/qrqD8TQJBZrb+eY6x9PGegCuDK8UoEh11ig46ctG9JVvz63VVHdPnkvzGvow8VPhmpcYudnRUbm/CIauUCDkKs+LhzeSc7BbaV2ht0L11g4QDj0ZFLbN6E927OF+3+7ls4PxRXfFi7MuwdEFTRcR8YByKTGGi716JjyZ1g75KL8wDp9LAuGtFFiGwDD3Rt2AzbhHl1cRKkrSsX8S+xPA1qTlt3MGYo5pK7zWSb6sTz2DPh9J0o/5z+aTfoplfCr25sGjLyPHxCZMUPdNlv/TKlG7MYQB7VUXkJXYJXMkrZ6L0xMHCabrZu4L2/Ut3vL9bxGPzGwl80zKoMEdWUdcJC3X39GNsN6G92iHHPjUQtmRxmP6AbjvTrsSz7GGjSDQTE6V8SOxjD9/YROU4tiVUNLIKKI4kYbMdyz8MRCyORvgiG9F3PG7ezd5Ndx5fwqgVm1ke380L818uxC/LTrdlU1+YVBabfrZFqchosXu465KihDqPKVFXB/CXvJVMbcNPCZYpBN0j6g+IHAu4dPityLrlAx3Co4h2OUecK8gs=;4:Vv32BqL1bAFvN0fr2cqxedTz7A1h4YI+QBIyqEUZaIgGtNYXaEg2yu9treJtJF5GEby12B+sAOq6NFo43oLH/kM7/2xDsqNAxr4JNcqJQ0bMGNShwySIHccek3pBZ7F3SAObEe9zSnryUt8nd2lExsxZwH+SqYCJD5KQGD+478aP7ABLDgxXBzHNpFvFrO4fI0Whpq+mMiLx3cX/TVCPlwh/MyB9kOaetZpLwI+lKVGFEDkA68bATHRyEHw++20I6jXDZyufI+RQh+LWFQdzMnyXhaHWERMvMqBXgCUQ5qmh8CDbkPJnqVaY6R8kzjbE X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(85827821059158); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(3231254)(944501410)(52105095)(10201501046)(3002001)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123564045)(20161123558120)(20161123560045)(6072148)(201708071742011);SRVR:SN6PR07MB4384;BCL:0;PCL:0;RULEID:;SRVR:SN6PR07MB4384; X-Forefront-PRVS: 0674DC6DD3 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6069001)(376002)(346002)(39380400002)(366004)(396003)(39860400002)(199004)(189003)(478600001)(26005)(53936002)(47776003)(386003)(446003)(16586007)(42882007)(316002)(11346002)(54906003)(110136005)(956004)(39060400002)(2616005)(1076002)(97736004)(72206003)(16526019)(186003)(4326008)(5660300001)(8936002)(81166006)(81156014)(76506005)(6116002)(48376002)(8676002)(106356001)(50466002)(3846002)(50226002)(68736007)(476003)(305945005)(7736002)(105586002)(2906002)(6496006)(76176011)(7416002)(52116002)(51416003)(36756003)(7406005)(25786009)(6666003)(66066001)(6486002)(486006);DIR:OUT;SFP:1101;SCL:1;SRVR:SN6PR07MB4384;H:localhost;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;SN6PR07MB4384;23:cIqlY6ZdMisA0ea6xGkdWRFDrUUVatQGbYquQdfjD?= =?us-ascii?Q?DOXxHGukHUUiKu89EJWyPCLZ7eNm0RT7UsSxEvg0Kz3MxNH63wRKPOqU3iPl?= =?us-ascii?Q?JAMQFRTd2oKYZ7tHQC+H9zkkChb9eDaUApoGX1mSKoeag6jZvFNip2dyVyT/?= =?us-ascii?Q?DALWZCOhK7yOhk5OPAOtzkFUkKiQ4YgPG46DSNLmU2NUzlBmjxB3vhFPlEWB?= =?us-ascii?Q?FwusMZDNVgduzauUGsL8FolCzsxbFhN8QEq1hlGg08nDDVn88y8d498tyO4L?= =?us-ascii?Q?nng+lfbJk2QlluJZXoVwNSQqTGRXUYcu69VlQL9SwRLYNd3UsI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ZeaHDarVtVihRF360fLOZ6U1pySXVREaw7BbHRy9yBCeUss22ZQhhXiU6yvu19+URtHsA6bNZmMD59U3frtcEk245dE7vJhiC18= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;SN6PR07MB4384;7:9AKULjwZD/IsBg/kJJ7m+jqOTnFfL1iTn9eDyp3jKXmxO7iCU5seX4u9dTPGmLUZVRMxdWFZodS70LESMf6oqEjgB7VtzMT7JLZa3rws2FMpIwKxO8ACyWapiN57zPJDRPqnw+8GU7RxrD5N2QF6mBZ9DGzdN4AuO+C6kjGp68I/nfkTzSMATW49N4sgEq7jAkPk3THJHgECTuvPy0AQ2XhVVpCg7kBsyxgQ6DKqn3Ow0R4wvfKpeVftAe2If/p2 X-MS-Office365-Filtering-Correlation-Id: 537bdfc0-4d83-417a-485b-08d5bb062217 X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 May 2018 08:22:15.1754 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 537bdfc0-4d83-417a-485b-08d5bb062217 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR07MB4384 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Like binfmt_elf32.c for AARCH32, 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 | 87 ++++++++++++++++++++++++++++++++ 2 files changed, 88 insertions(+) create mode 100644 arch/arm64/kernel/binfmt_ilp32.c diff --git a/arch/arm64/kernel/Makefile b/arch/arm64/kernel/Makefile index c63e0164fc12..3114191750ae 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 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..26b2477d190d --- /dev/null +++ b/arch/arm64/kernel/binfmt_ilp32.c @@ -0,0 +1,87 @@ +// SPDX-License-Identifier: GPL-2.0+ + +/* + * 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" -- 2.17.0