From patchwork Sun Jun 4 12:00:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yury Norov X-Patchwork-Id: 101362 Delivered-To: patch@linaro.org Received: by 10.140.91.77 with SMTP id y71csp495020qgd; Sun, 4 Jun 2017 05:03:21 -0700 (PDT) X-Received: by 10.99.136.195 with SMTP id l186mr12529114pgd.77.1496577801019; Sun, 04 Jun 2017 05:03:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1496577801; cv=none; d=google.com; s=arc-20160816; b=PIgcN44MCcg5Rmb4J/lGB/kn8rai4vr8YdLjVfIiUqRPgxtwaees9JY1R9EMWaI7ov Rks1z9U97ql/CGwJ9ReQ5BQKTArv6Kx6Aek7JmfoVdpaAsg8YL4PxBzs6eQY8YrkKWV2 jrVQqpHpo64ugtzJTbSIUN2P51FLvpSyigjv5HYsg2x9UryXIpoz7M56UfBZ2zdKeEWo G4t/qZzLCjaTpsDQtTn7MvPPADwNIYbnLBsBKCiKyd2i9nxbh1V9FRfSG+N4tFygZcbw Ef/g5xHp77jYIAhX2dJoL9CU5ZGqgpy2KxfMpAeWN0J+tDuax3y8r06MVpoi3DR29HRO lJWg== 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=8hwlnHBqHK5ZqLeRfZuodE9nlk2UDd39cB+MbyTk6uc=; b=tnJcvVwpNDzwjOEy0pTC56hrmjeusdVeC4hfUj8uMuuL+AUl4Nc0aK4eVZNBPDo2Zr KDJ/63BMDQ1jK5+GUvNiz7dlrHc9nU7W/f+rDW9RVGfqBos1UFoOij38zcBbqYNxIftS 2AQ9Cw9Ji8OJMqrtJsJQPuJiBy4KjrVEbwR+PEvSeZv+tck9UpuOpduzk7ZQEgp+v5uK ANA8Z72QTTIgze3xWRqBgGpoKZQvNHwrL8pigZz6h96p7sPdgE+md+F1w+tIRRrCKhZF ZNW6xMB3b3M/z0dBgRY7R4tvCIl4nh0vmBiL7TukrWZXuqOpL4hdfvT7l1+cZphvaxXo guww== 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 g25si4620870plj.529.2017.06.04.05.03.20; Sun, 04 Jun 2017 05:03:21 -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 S1751247AbdFDMDP (ORCPT + 25 others); Sun, 4 Jun 2017 08:03:15 -0400 Received: from mail-co1nam03on0049.outbound.protection.outlook.com ([104.47.40.49]:2560 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751178AbdFDMC1 (ORCPT ); Sun, 4 Jun 2017 08:02:27 -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=8hwlnHBqHK5ZqLeRfZuodE9nlk2UDd39cB+MbyTk6uc=; b=gg4ZWTxguQAVlblvSyXeLfy4Ee0gNkfNT8XQUJ3yLa4gePin6nip7N0TzSK7g0RfReat71VPEZNSDOcjOI9swD0IWLHL+n5ZGKMYHYUn3oDvtiU2Wg/Z2W3V5cX6Z9377tqNRXjrgaB6LfCefjyQOPUc56Rw6MOlbjjM+hm1Khc= 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 DM2PR0701MB1279.namprd07.prod.outlook.com (2a01:111:e400:5118::17) 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:22 +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 Subject: [PATCH 11/20] arm64: introduce binfmt_elf32.c Date: Sun, 4 Jun 2017 15:00:00 +0300 Message-Id: <20170604120009.342-12-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: HE1PR09CA0069.eurprd09.prod.outlook.com (2603:10a6:7:3d::13) To DM2PR0701MB1279.namprd07.prod.outlook.com (2a01:111:e400:5118::17) X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM2PR0701MB1279: X-MS-Office365-Filtering-Correlation-Id: 8e4720bd-c6cf-4bff-75cc-08d4ab418f68 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131423075)(201703031133081); SRVR:DM2PR0701MB1279; X-Microsoft-Exchange-Diagnostics: 1; DM2PR0701MB1279; 3:IqZqxKat1r9GX7OC6BxZwuCqjAdBBQVyNDE14oSSmAwSdDNd3zDA1yqQmYII2EnxFu3pCf5kruuqbqysWuNOtJvWF+yCLvle5SFfcvkmaz7fBYecav6cxS1lrCC7M7ORLxEwt7qUCPZP51nQzHGc2YGzNxwj58uvshitkB0irgQ1SIOXCFHapYf1RhAg9LyYw6t27Sbm9llNYOjgkq46ZMCxvjwHLgoBweLbTOvhPQDnMVL0GUgXmbGcZSMKAJ9MwbbCbt/etv/qE8OKOP4hHpv8w2HeJCfjEMmMqbj2BrfnVhVAfFIVe9AZbmqQb2LKY0mVDDAnaUV/kZVqI6sNXg==; 25:fL4nHEWicBmftrVJhdbAu4Gpr9I1JQX0bS0/m6fdkGR2rbHPbnjVVImmaY98cpNpWI0spqMAB5HlDSrdxWMQDaF/5eVc0JbsFPWYzIbxqMU9/LrbpIa6z8VD+OnBB94QZuBV8/vHGrFZtcHzKt+SjIQOa5k11tWleriLUTPto/2P93FEs87TwwvziktWcqTDzDkfqShAxRrkRwCN3S8rAYQ13ZdpH5UC2lMGD5yKT7+epP2wSjAYPeC/7+rJrEwn45BpvxprXkSNIWyxsrXgitkscnx5yzb53kGlmfMZXC76nr7k4rPY9xFDZHrXRK1Srg5JsEF4dNEF4401VMXdi+6v03I79fqQ6JyxcHL7g49EKefKMDvaDIZGRziPidXcbhfS9xhY7USa2qvpZLR6B44gIY7TU+L1LVL4PGSEgbfnmBLAG0mTPSxDpSHuYEY1AKEjRtx6sHdia+R0y2dUdn8YwnWNzK1xcoqoQ/t7Ngs= X-Microsoft-Exchange-Diagnostics: 1; DM2PR0701MB1279; 31:LhgtX4djspdKKqT16iDo0qOB+/HLakdEwYvqCtu6S3RRuzxrmirCMJNddsnWxL+6MfsJIIGxjnt4pgAt2mh5oFNz8WdRchjOL1mlzv0WftaM9aMcX8uuyL5fHO5pyIUk5YD/0v38pN+sDlv2/yM1LXGP6/5ZhywQtzhmtYrivbjrkyY/T85hR24/oBiP7P4d3G4i1q/CTfQqipSpbUobGWHqMLBOrM+W1z9zYM7bR2g=; 20:T1GNne3gzUgqtOm/47Asd0y3KboCIFSxdyXHoZxffEPwVRZLgL2l5LaGYx4T+5p1A62lrfjJsJi9wmoieleb1/8w79/FcmGKaSQmK+7/skI0I50QdxYzBC7fPNTn4+ljQlfxEF1bxducZlQVO0+tSpfCE/j6spk5Sm0yaieYHRt8atK4WrRh995DNyNAmsdmlJ1L6W5yUMcYaINwPGZYuiwBA6PNR6ALnta2DyIsdMWsmJpw/4Ky4V12eZcffwlaFDrr13mGq4sLj7ISBvoDELYHpJZ9FgVECAwrEWer4GhcSSqyDlFrfcCYuA27bi9/GsvnCe9jW4064Z0qkqArgXYlHvR9eQnltrLsbvlnG7jgTg33bzAYcOzj2L63+qBYXbYQrVn6nr8Xh7L03KIz6VLoPQFijjPh9BJd5Hf5cl2lhcD3ci5GFKmMk3+r6T5gmXdErMGq9otkz/Ap6CVeDElebpmwjnrAKEMRRiah3/+RaodwFW+WTzGumLOxh5kFMGaVdo1mo9BpJtcppHj53bLmeUzS8C+JyatukERmr1pAkG048zdavTMS+7JdGNykeTbLUow0G2pvmIhwto2iQnKC+2ZO+l2GgV3fHqayV6s= 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)(3002001)(10201501046)(93006095)(100000703101)(100105400095)(6041248)(20161123555025)(20161123560025)(20161123564025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DM2PR0701MB1279; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DM2PR0701MB1279; X-Microsoft-Exchange-Diagnostics: 1; DM2PR0701MB1279; 4:7hLG98Pr4vSjCa2ic2oWnWVnDxd9vTQ83k0HY20lymzi7TouF7KRA3JNpDX0Gja9FxXLG+WAm/5bHlIO+Fu2y535NzAHrdtlUEdAj58X4MRFig9kQe+LLQ1UZ7u9UQ5OSp7m1V22Jaxq+2hroVxW1CrP3o7QIENxpeC2BbjfMHbOHoYEE2nK74HR9JxsW79sVBXoqJaLN8b3bJ9aT2VddwnThRdHUwrjNAWe+Ildzuy3tVHh148jq7Um/UGuKLa6C/oEjIU1i0zgEu1l98//1sBwotz4KBtjons5bjvUuqh2wSct7eNZFsLImSnTFdZ6dMZFvSs9PdwmAHU/ZsJ1sKV5hs6Qy8Mb6KbxN/N4zb4U9KEoMPnteCLpPfwK8/9b21OBkMJ5ijOCUXCMWUawwjzMn/N54MzSj1HG6FcsCnO2XB5aGAXbKydgyzofpaP1ydMkZbTTa9HvhVF66r+HZZh5WUMTOxJbNQsIFJ7QaSy7TtZjWsCmqsnNfo92rhTnbc5ZtVKNzQvsIKFK9/b4Mfr/C/Cdd6VvUjfYrqchU84JjXTUC+SM13zJC0TSt7xKlLRdlRL+D45jWmGnaYkrt8E+JYcqzoCvcRdFwCm8oGTuxd56bYDVKvwf0qelBmzbhbCstVbcbTlXwpJ9ilEuYHQjtBTj7/xTVl14D5dr0ipJLpv16lVwD1lawlm65Bjayxuv575wU2DsvsioFYVi/BXXSvvXIfYkcsN6YJ1qjt3xvwrToQBSuBKfGi+FvgQOpNN///RtqrAr/PjJdTDxgw38+xpYzoiHJ3PD610ln18ZjmHtYWT7OPmhyK9Fqqs0ZtHY1qrLxMctrmN48iAZx9JzeACUW8CREqvU8+V2/9Yt8HAzpl5dwPUiWkHbeIklg41AeAXGWlQ/aT9iA6EiJ4fz6oMiTpjVn5HImR1Xna1Up5K/ANOujMc+qlLC4YnB5lb8R9EbsFb5gxmkpyOAy/3iJQGmKQcs+iK7RjRGTA0eixT9jQ2dl6n6zXvJJkIWVifXIbbrvXTVhhEcM5rWwM8CmfdFIQvWLrJ5FJLzr9oGczg7hTlNwyqqZRb+2Cd2m/WDSDVQp6lpKFqQSAYyXkeRewt5r7vHLroXNRopDbs= X-Forefront-PRVS: 03283976A6 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6069001)(6009001)(39400400002)(39850400002)(39410400002)(1076002)(38730400002)(2950100002)(42882006)(50466002)(4326008)(5660300001)(5003940100001)(54906002)(6116002)(33646002)(6496005)(6666003)(53936002)(3846002)(47776003)(50986999)(76176999)(36756003)(305945005)(25786009)(66066001)(48376002)(76506005)(42186005)(6486002)(50226002)(7416002)(8676002)(2906002)(81166006)(478600001)(189998001)(72206003); DIR:OUT; SFP:1101; SCL:1; SRVR:DM2PR0701MB1279; H:localhost; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; DM2PR0701MB1279; 23:YtcUAHEp7f1O9MotKNrKkYSX9veFDOaqUA62iOyQTViUDw/Vc/JBTCdvT11kUppWIaC+rTgFT7S/nvbBpTHYxKaNEbCAuh70LNgvS+L39RMVl5U+BUxEAn58Nta/FUgO0xpXfHLCjlPpRfj2Tv7lCE46j8XVr5BegPGfsFOZLt9RfSVnzoFq9j8Kr/951os2Z/J6THoNIb5viCHcx+6dn0LAnz+telxDt+0DwEWmnhrmzAVJEAZW6PmR2syfVRedXPGuEK1iixW1oRax0pHGQFc02A9YlDCkXHmxMsWehyhB+FFryiuoxCGRolZh/5FowbsMTgWePBdPgQb5aT5WCDdaRFiiXlK8TQvtBXiOUnePllCSVDjs80Yzn7S95DnJwTY3nL+PjgaHqziMwqGUK3Mn/jCK4c4FWbnLbzF1olq913CxyYCqEBXAabHCIhicQVnd8ZGb5cizBQg9/oaCYdR45VYHIkE/TAYMn6nB7i2KuCh85ggJpvF2ptnQGUuSjACHTMqqm+//oCrSNTtXcjQfVheel9t2WAC0io5NT+eFO0EtWQETRcU63xZ02p5V9f5XSkw/iSoa2TwhKqOB/NhlOpZzIem1R/m/xFtKwkcOZeMPF0c4AytMT7XS+AShVhGhs+PFjmOoTG+0kMro1iBpjsE4lpA1AFNPKY6mt8UXwUyW+lgT6Iiv+0JNdr0m7jCMBkwcjR/E6Sx+jnNdChTuEY/JxFjJnEUOc0hAMzg8rSdXmv8xskZPDjgSe45YXN2a59PhIjdBASoJCxNwtDOvWWyOdmHJSIFtE+CvCMKQTVsT23WOd7PRV8UJzdW1QYtyTlhsUZA12Ji68iMekmtFcJiJHGLKwGQr0e5TbDe6c2I5gSZq6zDbg8KonksHQyen8F4UySFi0l6ZKFtg+MfOFwCo4gKd9dM8hgd8OQ53xGlTvbJ/yufY3hVXO164xH4ClKNXHrLtN/VnBPLkO02crgbvONDd8B5tES1mt+KByK+CRGhYV/UY+RK32cTo X-Microsoft-Exchange-Diagnostics: 1; DM2PR0701MB1279; 6:B+t/fprxLPpjibozjzRbMIEs8U9zrYBZdmYZtBiJHsM8LVZG6PPqS6pEbvbVOI9op+HHpNDUZ5bg/R3nDfMs0d8FefOReOB/Fxp2uxZogTfeSipTTK9Cxl6zsbBVuVDikacigfBcNBuuLjkFyjd7sarg4LQVsbhMZ0wmUM4NY7mNGnkilLAy9LQ4IZsnAT1ZzGQvLPTq7LpEH3Bz/bjodVxPNcnBvos4+GKRiwdFX4p0eHnyephlZ+BdBaXu4j2hp+SJsLHEy6EoSb7SF5NmhPULV58gNYta7elR5wqpWUV363z/5EzdyWP3np0SvPd2E6BMd1KzHSGm2hWcok76K/53svVEmlzWVMpHGFk1DRRl3CJJgf+SSyESwd8GCJ1qQMAj3EpD6LvcG3ILQ3b/wmS638NxXto5mh44rhNp8uPhpx6AOoc0IXw1eY+cjBEB6qG6TKlomhO6z3ag+ER518LHvI+tLg/YFgXmL1m7okALpGUM9TjOpPszgtCew7cgHBQ4GeqAD5xZON52hQ8JDw== X-Microsoft-Exchange-Diagnostics: 1; DM2PR0701MB1279; 5:Mwe+zhS3xpzFB6jlzKZerQloDfk4Co5WME0Ib97Wz7NuOmtBaIVrCicUib6F0uHsrH6zxX7h4aMBtZ9SrI1zMHhGpJuzkFsl2X8R+8PVEc13rs0oaculBu4DKPfOeH4kp5SEPjCawawuF2VSvGNdRBMMEwR24CVkZhVdUnrJN8ID9NxMiRnwYEeVwjJ2xfH9DP3D/VYCfNzt+V7Ah8tbnKebH+O93ab1qZdV4dptz6RI+KxonVjkrt9J6fxlmOKai+c5HTkQkGSb9LjDUbhAQ3l1AadH6a/YzJFBf5knt7fi1rcq0eTTILn6yH6N3XumcQtea/OfYqx0MBe6E4LR9QGr+MKLzxJJ5vsgXeJRlzIXleatRBDF7rrjfP3QjlIfL3V/ZF3vV2yM6S37l/2Dqkk6FN+9YpfwcSIxSSUtA2R7CR3Li4gUcIcu+TwMwevgEG0wXSe84ucQT6Z6liXu6vjzJkCmBvdoeAJGMW0pqL1HhGbBqfprrG3jBwRkj6Wp; 24:7PoKTYSn+1bFUIchpDV4uDNhgQynzexKyJe24W+/j2MdcboqUDG58X7koKkC1hQ7bTNOR8EF/6qtMMNs/373MwYZ3Ryv2gg2bndqta3Ngns= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM2PR0701MB1279; 7:A+ALI1dZZmvxX5ETENJjlrCMgS+iJlWrmyakbpCh9M++O0Fv+fBBvgU5ZQ0ePbr5RjFG7HbDnzIoSAo14HtTNx4zlWhiK0HP1peGa6D93/AebFQDxU1tm0SLhbckJ40VW19Xk7+HlcDB6Pom6Ew81wsYP0rHYmE6QupEmYnzkBXsylPSw2QS56ua4YFpnJIOthow20ynOG+KyYnOq56+fxz0R7NtkrQCch2IqJYMxSWRjAAQPNrzbLkHCxDgfmmn+yA5vn5etJShQjb+n9vneEbOpbrfq+TpkSXzNRS6jvALJXB3u4Vok+NBS/hQ092htsBwZG1pHfpU4fzLq+sOOw== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jun 2017 12:02:22.7200 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR0701MB1279 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 | 27 ++------------------------- arch/arm64/include/asm/hwcap.h | 2 -- arch/arm64/kernel/Makefile | 2 +- arch/arm64/kernel/binfmt_elf32.c | 38 ++++++++++++++++++++++++++++++++++++++ 5 files changed, 41 insertions(+), 29 deletions(-) create mode 100644 arch/arm64/kernel/binfmt_elf32.c -- 2.11.0 diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 417760b2663b..2275db8dc7c9 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -1069,7 +1069,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 COMPAT select HAVE_UID16 select OLD_SIGSUSPEND3 diff --git a/arch/arm64/include/asm/elf.h b/arch/arm64/include/asm/elf.h index 8f7bafa60d01..f57a001a70bb 100644 --- a/arch/arm64/include/asm/elf.h +++ b/arch/arm64/include/asm/elf.h @@ -177,35 +177,12 @@ extern int arch_setup_additional_pages(struct linux_binprm *bprm, #define COMPAT_ELF_ET_DYN_BASE (2 * TASK_SIZE_32 / 3) +#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_AARCH32_EL0 */ #endif /* CONFIG_COMPAT */ #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 3c70db6bd570..6f872741fd3d 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..de84bd206960 --- /dev/null +++ b/arch/arm64/kernel/binfmt_elf32.c @@ -0,0 +1,38 @@ +/* + * 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"