From patchwork Mon Jun 19 15:49:54 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yury Norov X-Patchwork-Id: 105874 Delivered-To: patch@linaro.org Received: by 10.140.91.2 with SMTP id y2csp941076qgd; Mon, 19 Jun 2017 08:53:23 -0700 (PDT) X-Received: by 10.84.233.131 with SMTP id l3mr8064085plk.298.1497887603111; 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=bFqQdyxsj/aS1SiAjAyNJDE5kHDMdHczWWSfhh7+6AdLmmiDNn58cThRrnroKY1AcF X3H9/GKlsMiIgqJp4UwGFKis2qscRzyjbTOMNDcFV+CBbvewMv4+q6dAM05MNHH3fJVE ywPUwVvg8M/ad+lVqg0Jl5gm07QZbnKLe+OOluOzjsc0BhvP84mD1oR0is6Cad1mNmKA d6FHShHNg2MlhmNxb56SAU77jJX0HRWii7zubVdE3r1JuqbM+qPOnkfvHccjoy52jwb/ LdUNmN7eWsBzE6Mwqr/IhHnbnQmhI7tEvLTuReNKRhd7vg2Arm+qrfA+tZbZUWSBcx26 8ESA== 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=pw5mSZxj/HF3qvUlzLSrJX/sAgzNqvne+gh0ZLmthzo=; b=vw0SI+lVGMLvZTCvzlv0cT8Z5jnm+EKPeHYMabJXG2drG2QY4QnsrEzFgyNw6WVS/G iGF5fxm/rF9b2AgSZZJSwLjEWr/cGeCQjeKPi1U+NS9UvSAludpvmfRj5iaGF3c1ejyE TAKmXKyUfhSwgm79LIR3PmKO37BOzJdXMKvsoGe1v7hCpjteaO0W7fQmpELL0khFdBg8 Mayqlu7VqWC+m1IPbU+SDxwsqLXTk9sKDrjdRpy63FDKhnA9y2ThWYvXqbXdX2JB1kPZ xy6Z+oHj1m+XunIv/g+SZPEBQEIwNzDyDH4xZUi8nLv0o8QNUmGNKfKPjYxPE12YaSV3 eW+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@CAVIUMNETWORKS.onmicrosoft.com header.b=nEmt2vEy; 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.22; 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=nEmt2vEy; 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 S1753845AbdFSPwt (ORCPT + 25 others); Mon, 19 Jun 2017 11:52:49 -0400 Received: from mail-dm3nam03on0057.outbound.protection.outlook.com ([104.47.41.57]:46891 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752637AbdFSPwp (ORCPT ); Mon, 19 Jun 2017 11:52:45 -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=pw5mSZxj/HF3qvUlzLSrJX/sAgzNqvne+gh0ZLmthzo=; b=nEmt2vEyMwCTXwdYffiR1yISf8SF2MD4Qy+04hj2VHsmsSOTkeOmfwsht5YnB+kNWcDr4geCHVdQG8fOdhzOFJvVBwBupiNYo6JGF8UHSupv2+Lb6zXIOTj45fAc/gAQ+yj3ULab411uYPEIWFqMCZXTlXnqXlECSP/tVYNFXaI= 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 SN1PR0701MB1870.namprd07.prod.outlook.com (10.162.100.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1157.12; Mon, 19 Jun 2017 15:52:34 +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 Subject: [PATCH 11/20] arm64: introduce binfmt_elf32.c Date: Mon, 19 Jun 2017 18:49:54 +0300 Message-Id: <20170619155003.13218-12-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: VI1P190CA0006.EURP190.PROD.OUTLOOK.COM (10.165.188.147) To SN1PR0701MB1870.namprd07.prod.outlook.com (10.162.100.20) X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PR0701MB1870: X-MS-Office365-Filtering-Correlation-Id: 992fbadc-61f2-4499-def4-08d4b72b3431 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131423075)(201703031133081); SRVR:SN1PR0701MB1870; X-Microsoft-Exchange-Diagnostics: 1; SN1PR0701MB1870; 3:QhcVuQBnlv7RLFq8/bAOndI4fVqzjghmBEcgZ8aqAWgoJqFJTFg3YTXt/lsuD9v0/ZDMlY5CKHNdGjqHVTzbkVbquznt48toZxvckXqQ7yixlZrp786EV2shXTpDAU4fCgjvJTfA6KlKi4AuS30Q5RTuSD3axwE5fiWhyz1eqINruDxcr6P6QsJSndTjwAta+c58nqQOEkg1j0gGZupFuQKz7g8leNWF+1MnH9FhPM3Nz69T6OyU4iPxiQvo64dWDmOn9+U9SuT5LeL/8156A/wSWMxU6s0UDXJXuHf20T4Z3fFzGy6EwKiSczeiXjhyuPqzePpwRyy76XsshQfMWQ==; 25:2a40/akSlDpVgbLalhwcMoMQlEuMmHQlF/pKUy1z5SiiY+cMaYTVPmTv3eelVeGDcPw8uNBdODWir9/OneFg17hKuZT1ygtSQwuUI2vlUApkTJdlgMgW9c4hFB9GET09N08mWbc6bIVrQW4njSZrjXaawVdUxIn1iBtYL2BgLUmE2eqwILvR8xA9BDil8nFXeKFX/6PySqa0/UuU8Bml7hbmJn1WPB+B5C3qxNaYYmHjNceBCrEZ6jxd83CddNhL3iK7j2BeEoocR2kNKAlC/JDU36Vaz2JrSg5kEebqA2CIIL/cmEQZcpvmQd7wM6kjJc5qMWUmNTkH8XkmxfXysxebN8cZ5e/iOLvTYP2VZX4bDvkOlMSesL+8P58sLJKaf2UR+UTI+pDaudyYPf5UZ1lwvGygQ+zVuUjR1vXmLMqRERIcq0tbkds75FtFUQ4HkmHJnGq+hSDwvuJfnjh1WkihAPHD0gsFjibyTiNI1J8= X-Microsoft-Exchange-Diagnostics: 1; SN1PR0701MB1870; 31:a2vQTMZ5FtkJ5TAO6F2FzWL7cEy4sG2Rz6ppqGavxKh/62f95pMKPSzpjWSl3ZWBmSSAvqttbDBfi/gNX7wulS95ZwSfP5jG6ittpsBDVDlyA+0LdEUu1zLyKi3blYw0GlWFgqa6n+nq5sV6LxOdyfFWiruov+aBgbpnRuq7IRAqINJ8fxsdQiQ5fXEbVIFB73qm56oIR+jxz6UG0P7qwPnJhAM7I8+1uEWOG6WApCA=; 20:ONcpCi/O5nNlStGTHm2T7U7xsf+wNeghebMJPKxG3epJIq8/gDH6BaH8IftN5kh4qzU2OFz/yxSN8RNuqTBh8NZYjNUz9yiHVQC14BWRIMwIJTT5WhbPUYhBQ8p3DCCfIkba63KcpbJrM53kur9p3Qct6moLCvwB2rmgm4L340dzBpYPYx7l2VeUmMvtUG+aHanZ8DV+YsuQAyQsZjnNRLD4G1ZQfxda6XSprg336YnecEFdSEoozxhhEbG/AbRM2TcqUAoV+CQN6ehw9l/Jlldn+BYgxBnEMyJTx1Lr7yGlo2uxhUkyu3Xx5wfVsFofkjFt5GzVDMomAFPaPVNlkFclLBiy84/TOU11NA5ibvbR6iUXGVZJVjdZ4EKrjn+66CR9baoXlU1ClXYwHtTLW+Yhmh5dxHEYIgCo7rjE83J77HDYU9wCwjpbqzbGZhEuWU+T8fR2D5K0TGjYiVogiWqIGfQKzygUvsykmXaGohSFfmkSFw/5HgYbFRSO2ZyK5HWWloENYiRcov0sXtiZMiQ8E3HvBHBl+/NxtETOaxyTAh4Hf9CyA/u04wuld2+egtOPW5Dn0Ae/TxNumyTQ0kn/a5SP01ZqtsY4N+UHXj0= 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)(93006095)(3002001)(100000703101)(100105400095)(10201501046)(6041248)(20161123558100)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123562025)(20161123555025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:SN1PR0701MB1870; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:SN1PR0701MB1870; X-Microsoft-Exchange-Diagnostics: 1; SN1PR0701MB1870; 4:F6GycshF0Pefr++1VwfDTPgOCyUMJmZRKiegYAadjAN/yne8n3sFn8yvHqFwE35RvEk8NjzHxAOvUaZJ1U9CT0ul/5jW4cSA31oR81lVqW2V1jfdzdmDT2FapVwsLZveSO4Rs4WeJroX18z43apCLhOMbBwDq2vPlnArZRhOnfvLRDvN0pZ2zaLTnJi1N5VV5/YTrBxz5kCEUGCFoxU1fiw1aoWfyG4Jj4OfAbdvg6T7er+SB0VGJFk93VpjbLaiXqQJdPq76lMbsoQQPY7YkBMZTyZ0a+AtdHRT5iz5leT9nuLILOyWpu+QXjukOrTVtBxvV58lcrmuC7U76CK4lwTdd1SFbxkA63ufgj/C+f7S+df8m7EbPsqG7FqjXgXcj6sAXJObzWKnPGf3uIITnCAv2I3iATVmuSOBcvxLycU7LtcoIdkE3uNiNXn5D8/eKt3x2jxyQnvcZSk543wgkoj924OTLMQcxZv18p3Hbsg4Or8D/1h52l1NtPaUNMRA4SzG6m1PpfT91IzwClSQv20Nn3rB1PAXeEvyyaR2qqyM5Y5gpVTZ9CgK7cGtcNhXW/jjt17vSmUi8KEP1NR5Nat8zPk86HRpWE5QVYZpSn1vwSGw0pAi7J93fEem1Z90LcBg2OPIeWZO436jWBHqNMzE0jB5Shq1GjiHYezq9HguJtaRq3to7zyFT40YpXXjc30Xx0zzpGk6TnV4JOrnJqMOF+XkEZJ5cAr5EAVuXGozvgkbqtmO5RfPQ1v7M9WSvXDcU6pjE21im4JqBZ/afVRig5mTlRQEnMIJSbov8OLrY1jhaAK6v9/RRqiVaXXRFNaLj+402hAx0V31365G69ocBLiameIOSnPiJY3kK/mPOvj0rgA7JNa607C5D4rU3J6NR1rKMmkb9UEFugl1CYFEqB5XOrO/lBJf6RXdY143sso9FSLWMfpsEPU0dm4OouCkByb5iMKLfUHXeJZF7k8nQlCh5ldDsOP/QBLT6501gvuQ8oJVnmnSR4BWViMS3HIYMOWUu5MuQLpIwQ+Ri0jfthQg7D/afa8Xm93FQVJ9KmM6788Uc6H3pAVsgdsq3wScUyc2oSf3W1ibaGiDzwKIFmpfId4hoTW1WO5YRQw= X-Forefront-PRVS: 0343AC1D30 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6069001)(6009001)(39840400002)(39850400002)(39400400002)(39410400002)(39450400003)(50466002)(5003940100001)(1076002)(8676002)(50986999)(33646002)(48376002)(76506005)(5660300001)(25786009)(6116002)(2906002)(47776003)(76176999)(189998001)(66066001)(3846002)(50226002)(81166006)(38730400002)(54906002)(478600001)(72206003)(53936002)(6486002)(2950100002)(42882006)(6666003)(6496005)(42186005)(7416002)(7736002)(7406005)(36756003)(305945005); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR0701MB1870; H:localhost; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; SN1PR0701MB1870; 23:grUtECPT8p6IC4T3gBKkDZ0/W+cY0xYUd5YeYrPwI05ijKgZ29ZmTNPq/wopixIVNEDw6/uNh+Hr4fxxsE84ZE2WTLEqrj3V6mCEufOP/rs1Ed7cxIsx/KP3N1NOqSZ3UbDJ46wv6E0qcIUEo8q71hKeoypNwCV5H6npGcHMRZKQ4/RiC3HQBWZcIAeW/7YaI/q/tIT/QzqSNY4mA0n6CcieGP/n5XUpD/T9ptCRXs+kORDVzvRsBMJ+VVK/VrW5hTVq1FrqMw4qURlClU9787RtD6YxXdu3WKlNIULovO463LUgNzcrK/9DMhotSuaUwkvbICPVCBAeu57oa1R/ZP/q/yGk2CaXiIeOJu5TG2q9zhzD5RPRN765iVpjW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s6hsQNDouH71bpY1RiFwC35nySjV3MyWEYjNk+1nZ2hsVmlPz4PTzBKVfSKMcNF8PJSuMfBlC52eE0CS8Fr0O4hVrzDVN5rD3rE= X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jun 2017 15:52:34.9180 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR0701MB1870 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org As we support more than one compat formats, it looks more reasonable to not use fs/compat_binfmt.c. Custom binfmt_elf32.c allows to move aarch32 specific definitions there and make code more maintainable and readable. Signed-off-by: Yury Norov --- arch/arm64/Kconfig | 1 - arch/arm64/include/asm/elf.h | 30 +++--------------------------- arch/arm64/include/asm/hwcap.h | 2 -- arch/arm64/kernel/Makefile | 2 +- arch/arm64/kernel/binfmt_elf32.c | 37 +++++++++++++++++++++++++++++++++++++ 5 files changed, 41 insertions(+), 31 deletions(-) create mode 100644 arch/arm64/kernel/binfmt_elf32.c -- 2.11.0 diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 8713a2807582..168ab2cc426b 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -1085,7 +1085,6 @@ config AARCH32_EL0 bool "Kernel support for 32-bit EL0" def_bool y depends on ARM64_4K_PAGES || EXPERT - select COMPAT_BINFMT_ELF if BINFMT_ELF select HAVE_UID16 select OLD_SIGSUSPEND3 select COMPAT_OLD_SIGACTION diff --git a/arch/arm64/include/asm/elf.h b/arch/arm64/include/asm/elf.h index 8f7bafa60d01..2a727658f51c 100644 --- a/arch/arm64/include/asm/elf.h +++ b/arch/arm64/include/asm/elf.h @@ -174,39 +174,15 @@ extern int arch_setup_additional_pages(struct linux_binprm *bprm, #endif #ifdef CONFIG_COMPAT - #define COMPAT_ELF_ET_DYN_BASE (2 * TASK_SIZE_32 / 3) +#endif /* CONFIG_COMPAT */ +#ifdef CONFIG_AARCH32_EL0 /* AArch32 registers. */ #define COMPAT_ELF_NGREG 18 typedef unsigned int compat_elf_greg_t; typedef compat_elf_greg_t compat_elf_gregset_t[COMPAT_ELF_NGREG]; - -/* AArch32 EABI. */ -#define EF_ARM_EABI_MASK 0xff000000 -#define compat_elf_check_arch(x) (system_supports_32bit_el0() && \ - ((x)->e_machine == EM_ARM) && \ - ((x)->e_flags & EF_ARM_EABI_MASK)) - -#define compat_start_thread compat_start_thread -/* - * Unlike the native SET_PERSONALITY macro, the compat version inherits - * READ_IMPLIES_EXEC across a fork() since this is the behaviour on - * arch/arm/. - */ -#define COMPAT_SET_PERSONALITY(ex) \ -({ \ - set_bit(TIF_32BIT, ¤t->mm->context.flags); \ - clear_thread_flag(TIF_32BIT_AARCH64); \ - set_thread_flag(TIF_32BIT); \ - }) -#define COMPAT_ARCH_DLINFO -extern int aarch32_setup_vectors_page(struct linux_binprm *bprm, - int uses_interp); -#define compat_arch_setup_additional_pages \ - aarch32_setup_vectors_page - -#endif /* CONFIG_COMPAT */ +#endif /* CONFIG_AARCH32_EL0 */ #endif /* !__ASSEMBLY__ */ diff --git a/arch/arm64/include/asm/hwcap.h b/arch/arm64/include/asm/hwcap.h index 2c7fc5d89813..99dfd9277559 100644 --- a/arch/arm64/include/asm/hwcap.h +++ b/arch/arm64/include/asm/hwcap.h @@ -47,8 +47,6 @@ #define ELF_HWCAP (elf_hwcap) #ifdef CONFIG_AARCH32_EL0 -#define COMPAT_ELF_HWCAP (compat_elf_hwcap) -#define COMPAT_ELF_HWCAP2 (compat_elf_hwcap2) extern unsigned int compat_elf_hwcap, compat_elf_hwcap2; #endif diff --git a/arch/arm64/kernel/Makefile b/arch/arm64/kernel/Makefile index 49fefa42d136..de6c84702d83 100644 --- a/arch/arm64/kernel/Makefile +++ b/arch/arm64/kernel/Makefile @@ -28,7 +28,7 @@ $(obj)/%.stub.o: $(obj)/%.o FORCE $(call if_changed,objcopy) arm64-obj-$(CONFIG_AARCH32_EL0) += sys32.o kuser32.o signal32.o \ - sys_compat.o entry32.o + sys_compat.o entry32.o binfmt_elf32.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_elf32.c b/arch/arm64/kernel/binfmt_elf32.c new file mode 100644 index 000000000000..ff1f192a738a --- /dev/null +++ b/arch/arm64/kernel/binfmt_elf32.c @@ -0,0 +1,37 @@ +/* + * Support for AArch32 Linux ELF binaries. + */ + +/* AArch32 EABI. */ +#define EF_ARM_EABI_MASK 0xff000000 + +#define compat_start_thread compat_start_thread +/* + * Unlike the native SET_PERSONALITY macro, the compat version inherits + * READ_IMPLIES_EXEC across a fork() since this is the behaviour on + * arch/arm/. + */ +#define COMPAT_SET_PERSONALITY(ex) \ +({ \ + set_bit(TIF_32BIT, ¤t->mm->context.flags); \ + clear_thread_flag(TIF_32BIT_AARCH64); \ + set_thread_flag(TIF_32BIT); \ + }) + +#define COMPAT_ARCH_DLINFO +#define COMPAT_ELF_HWCAP (compat_elf_hwcap) +#define COMPAT_ELF_HWCAP2 (compat_elf_hwcap2) + +#define compat_arch_setup_additional_pages \ + aarch32_setup_vectors_page +struct linux_binprm; +extern int aarch32_setup_vectors_page(struct linux_binprm *bprm, + int uses_interp); + +/* AArch32 EABI. */ +#define compat_elf_check_arch(x) (system_supports_32bit_el0() && \ + ((x)->e_machine == EM_ARM) && \ + ((x)->e_flags & EF_ARM_EABI_MASK)) + + +#include "../../../fs/compat_binfmt_elf.c"