From patchwork Wed Mar 1 19:19:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yury Norov X-Patchwork-Id: 9599075 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 3B6AD600CB for ; Wed, 1 Mar 2017 19:49:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 296C72856E for ; Wed, 1 Mar 2017 19:49:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1D79928576; Wed, 1 Mar 2017 19:49:33 +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=-1.9 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,DKIM_VALID autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 913CC2856E for ; Wed, 1 Mar 2017 19:49:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=k2PV7lvHHOAxmKwI4ueWqyI/4Ob+5vDkT9kp2U7rzSM=; b=hqeAaNW8GunGoh vngsV3JAonUhgy2AY1LvG8BZSc8tPZjhOKUi9cIQqt5+du3sPgSXbwGkrS+59eBj9d+XkK2tbMG+V v6rcwYVLi+7y6spFHq/bB+UzifsU/7koyyaWsyBEMVzvo0Z56WdERlG04FEV25bAEpsM5kTfsyIfN hCIGceO1h8joRgw2HbQNillZOoQhDA5fdsb+6i+ta2iboH6U7l2v/gW87mcO3LPCbnOQmkgE97KqN drrrMhzWzb8qe9XpHOfcQoB64f7Ijpl+kQ+x3HJlsCCggfgfSMhhWSEGY1gAoNu60gnl6b0PzazW8 5X65uzrCxmunBUEC4vgQ==; 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 1cjAFf-00042V-Vr; Wed, 01 Mar 2017 19:49:32 +0000 Received: from casper.infradead.org ([2001:770:15f::2]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cjAEW-0003ET-1K for linux-arm-kernel@bombadil.infradead.org; Wed, 01 Mar 2017 19:48:20 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Type:MIME-Version:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=T+loiKAjkJBtF5dnj/oPsY8ojqFnkbLSGTJIR7VW3GA=; b=a2omstdo3A1vfK3QPHOVun8R0 vzUkHbSfvDttuxZoMi9EY4xCul8tO0/apqMBGzcMl9PpvTd6z5xjaB8gHEsghfKtReeoyewby5IH6 F9aNCZFGb54Yuuw5w08NAzvTXWwL++Z94LiuC/sI0lbjR+zunPdInMFSU8HT+rbfJH89HEjy6lQGn BW/x58lnP4iPP3N2j0yf7u3jsiNQJ/HoJxQJcgTDBOITERMYDrAD0PpE898L0g++TRg2QTh6nQGjQ zPvUL5c3x6QebCopfgdrifm4bKfZ+MKQMF3ffrytWHeIqNB/R8QZc3cGpfpAqrf4V4WjTCrJPNoX9 J8Dek1Kww==; Received: from mail-dm3nam03on0068.outbound.protection.outlook.com ([104.47.41.68] helo=NAM03-DM3-obe.outbound.protection.outlook.com) by casper.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cj9pC-00083p-8K for linux-arm-kernel@lists.infradead.org; Wed, 01 Mar 2017 19:22:12 +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=T+loiKAjkJBtF5dnj/oPsY8ojqFnkbLSGTJIR7VW3GA=; b=ieHZop7eyMjO19LVr71dINkk4iXdGfFnc5LRb/rRorQZvWG3ZgpA92BdpEYPocMBTD1t/234Uv2Hdo3YFzfEarUzCeG+543dFgoEFJc9wBn+mEDI+nMeMTch2X8ilupu3cspIFCWRN8dmN7In3HuRsLx+nbygyEthgFc1Qzz+sg= Authentication-Results: lists.infradead.org; dkim=none (message not signed) header.d=none; lists.infradead.org; dmarc=none action=none header.from=caviumnetworks.com; Received: from localhost (27.97.135.110) by SN1PR07MB2254.namprd07.prod.outlook.com (10.164.47.148) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.933.12; Wed, 1 Mar 2017 19:21:47 +0000 From: Yury Norov To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, Arnd Bergmann , Catalin Marinas Subject: [PATCH 11/20] arm64: introduce binfmt_elf32.c Date: Thu, 2 Mar 2017 00:49:19 +0530 Message-Id: <1488395968-14313-12-git-send-email-ynorov@caviumnetworks.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1488395968-14313-1-git-send-email-ynorov@caviumnetworks.com> References: <1488395968-14313-1-git-send-email-ynorov@caviumnetworks.com> MIME-Version: 1.0 X-Originating-IP: [27.97.135.110] X-ClientProxiedBy: AM4PR02CA0006.eurprd02.prod.outlook.com (10.165.239.144) To SN1PR07MB2254.namprd07.prod.outlook.com (10.164.47.148) X-MS-Office365-Filtering-Correlation-Id: 729a6682-1c69-4e01-84d6-08d460d834cb X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:SN1PR07MB2254; X-Microsoft-Exchange-Diagnostics: 1; SN1PR07MB2254; 3:vnyKzOB0xyVgJmAyfMlmSMhHlikKc/W0PvFh2sMhVwZ1Nc7IUSdsyIwpTwEOE3zn5WkoXl5MnB3emggxWLJF/NT3s3+xA3IcjpgI8JLYiJZi7ewW6voC2VV10zmYui+Wc3I9Q6JxPCN+9YsdJMjE1D20JHZ/aty2ngxrCqAZW1U+lPWB+rYd1D50mT8eDP7tDCy9Xj/K0NVY037r80zwsRuFZlVeS2eaEROy5dOUtr+9DvWRCsKl4f5Q+Tpet5cqYynyrq+alNPuU8PplHZbGA==; 25:KslCciL57Q71rS4G449o61egUfEMgiOwd9V7pVZgRqJVumzaeH1QQO1wonPKKK/sWUUxpBGu+AnqJUsUB2cE8lwtfMPglKrsXTsroCOQLXRid3gx5SaOfenOQM02v0agdfKf1NmU6spsrdwDDN910TPyT+W8ZmJ1+SvBHmxQLVMbOwWxbt9Vs35GpuXBeuwbXGKICpjzssC+py4RFUQpZXwczfUWoJbkpy7iZJYig79+Kr5MwWRu22Pf9UeEhRtJAlsdATRIGhfny+mMzNiiqO9+8+0sEEWWJET92w6kQFgNAe+DMBBq7tHCocajeWkZvgAv6EOYx6KTrjz+TDNAjysZBINbIgp1uRhPZNzTTI5Bmpu5pL1nroBXTGoJZew1wRmgrpoPKFCWqqqAOl2w3zVZN8Tq0y1I4ESZOGnTq8pXaBTQ5O1PBLH2GQpuSiAe5r0Hm5os5rAdp966YeAx4Q== X-Microsoft-Exchange-Diagnostics: 1; SN1PR07MB2254; 31:YOtH7O6uXipXr8tQ1EX5yvZcofSa/UD+bkPNuVdGONwzaU+z6FbaKgzcSSLtNWg8jc/+9OQIPDETKAJbbpgEkMG+Vb/1Itm5HOLl9NcUQYHJ8BybaL5yPQqHCDNWKW4H47+C9kQTr0dxrij3z8LXHRd75m4nLhDMps0NPSQzkxfNnfJ0DBSdpFH83hrZwgcOSBNzsO1T/ecpwx9/CNVq1t68JbmRlDLHnzz7qZC6Hpk=; 20:3BdNn3g8ibdysHEkV72Yh7fskMOEtystXtApaRyMIV2mCstLD+USu9vpGfLo7/qoRJulvWTZ2uFAYiZyJJv5MF+/oiWmi5MLr5ZPEGVApdVvIZf9/ZrDh6fHtPUmcXFITMWxZgglQo9/cTmTyorZLqT/RHOVyNh2AyF4maUvJdsYik7Qn+ibsPPMNqn0q9BmpTLOP7MireRrrb8aSg+h6v8BxNWaEgVtfLu0xo89VsiGbSl7WQDvrlqHSMBFMLFref4qnJzLc3CKKe1X558pvTsiHJdMLPJrtvbnXAYyJCp7/E/VO1mGeGJBzKmm76pGaZyUASOjUuj9t4QbJq4/5ifSIYiSHBSjFdBvLOPXftNjEmVwb/ZS0XRXKh9xDTr+EDWUzA6VDusggA3lpLJpUOJ6zMX003cHj51o04LhZjPI35XCkPpj2p4m3z+7jEkA05Z6SG/fqPkVdI0Hz95MAaa1HaqWbhXyUhlIEPAalm8nBmyUjLqtX5h1+2JIlQKwxnTIBmGNBsuU0PR8yJWDFcHs5n3YaKBqWgwxJ1rMxeh8CmB2EeGh6w5Lh4mbTwLh4NwZLnKldmAEN/FAHQJ1dnCC3MBznmd87WIaRxT0q34= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6041248)(20161123555025)(20161123564025)(20161123558025)(20161123562025)(20161123560025)(6072148); SRVR:SN1PR07MB2254; BCL:0; PCL:0; RULEID:; SRVR:SN1PR07MB2254; X-Microsoft-Exchange-Diagnostics: 1; SN1PR07MB2254; 4:CXPrPDwVj36UYP03JNdjJf/40hwkPSIgElccLj9/1uhdFJvMBr2rLiArp6EddUc8bS+cI7auBsMghROCyDJn4hOIRW5eKbAhApney0lDfs3rVR/5JyIrRm7Gfh6JeZtA2ESHvFOP6e0zoS1T+KZv5zYVg/WC9yYRQmcaY0S/56nI+rMxMxQcD0QnS1LMSS/WNzwK5BXQ2IOVEiD6miMQTBekfKrtpHcbfW3axQEkzbGdRgH9RuOE02y+bA8NMaaCKhpFzOttOvIu+JFuKOpmivGMNHyigCaqctVv2Ipb2qkQssxTB4bSzsrc9lN6bfLyVqGCugpj+JlKjteOTg//Zf3426Q4GI+FtpEXzkTSifaqo8+yT6izHFZDgGTCVzX0YALpkvN3rQdVDbRLNipGxXCNU7VRlw2Oj5RkL6GPxIX3N4EhP21CKMLNzCPsrKTjd17Eng0YYXfwbcJh7Q+I5HoCcGXNfWQQihcXSHCq+AdTM37N00y6TMqY7GHqqCYfwIMGi5LX56Xo7hx2Xk6QXyMV/iNciWv7cAR+AuQeNVbVw24RUm19bMxcNyxaq8YjRQquEifqpl0K4niTrKIyhnBNaV25lxlP7p6TA9sfM5E= X-Forefront-PRVS: 0233768B38 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(6069001)(7916002)(39450400003)(66066001)(2906002)(54906002)(5009440100003)(36756003)(7416002)(4326008)(305945005)(7736002)(2950100002)(6666003)(5660300001)(92566002)(38730400002)(53936002)(76176999)(76506005)(575784001)(6116002)(3846002)(50986999)(33646002)(6496005)(81166006)(189998001)(8676002)(50226002)(48376002)(25786008)(42186005)(50466002)(5003940100001)(6486002); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR07MB2254; H:localhost; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN1PR07MB2254; 23:xNQCNC28OovJqyvN98NkAdDSv9PcB77i05ZPaST1I?= =?us-ascii?Q?qRKypgQ4tV+WRqWH2pylPW+z5be7/yTmTNJMw9B+GMKDzM/M+Fn00yQcl0lD?= =?us-ascii?Q?zUR5DEtCZ6+EiMc0f5PRunrIY2r/96AfCKPYKMQF/4aIOJI7A2NtstA3pPQK?= =?us-ascii?Q?pSuiM4Xj/fDILns72uhE67X7R9aDkSUs7SyBI9E2b9nGoa82ASfi2y0GA33y?= =?us-ascii?Q?PwvwjuX/vkk/3RQjI37xoCRDIPoakRakQyY8GJe29TGa0gP8Yl+MxrTZ6j3A?= =?us-ascii?Q?xmRC1lrDaJ+IBzTLXVLvvLXwwU7dlD10vivTD+A5qOekcGGoe+uUvqr12uzk?= =?us-ascii?Q?o9IhXGTe9UXAz2iud98Tsvv7y5fVrcgBlIYAtq/wsZ5TEP3q2/9YikFRXR9E?= =?us-ascii?Q?n0aCHMrCONJd/+64RTpISxewQewPnCJ+3gjjYyAfSXiYJh2dpTIJu57+bYa9?= =?us-ascii?Q?WjRnem/9OAdiGBz+YC0ETgXPzH7BDQyhpRpbL3O/dVa4JxQYGsmX42Y6p49T?= =?us-ascii?Q?sSRpzPD7dPO+jw+ff2Tf/2piP/3dHVA/qx2CNVNuWe2XLAf3/N5XBJu53w92?= =?us-ascii?Q?QhaqAT+3I47u2nljmI7onNTFiNBEXaoqDoepC66XgTPP51AEZ/NbLHMEXlzT?= =?us-ascii?Q?cp+17ZcYwCI4hsLejjmh2SLpUsnoW8wgbbL3ICXEvReZDqxojiFNXvY8Rhr9?= =?us-ascii?Q?4lJvistPd3RGr7JXFV5rEdHNGGGx0VzlQuXC4SvqFUSFeGvA5o96AaGrjfqN?= =?us-ascii?Q?/E38WYZXSQsUPAlyGGzlfzKi7sSdInW7NZienkyTZrcAkbWRh/jIvAulpHbg?= =?us-ascii?Q?Bi7pym7Ilgm4QTCEVtG/bE9Y7kv5iHxt2yfG+Um+yLQSuPewkTxYDhjQ0Zb8?= =?us-ascii?Q?m8KMX8rq+E2moHv9ssLTvgg8cfi0hGg7i6EkfbHd2ImXt8A0dwg6NchQE0Oj?= =?us-ascii?Q?WwMWBb/7VeZSIrnL9zvoPeHYKEP/jiQULIoaB82KQ=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; SN1PR07MB2254; 6:wXvb0BOuEX2KKWAwbgcF7htDMYmPkiR2BitFir/sco0RWE7WP83QIzYa9MnK+FGXs4IMnzG43HCl4FPRUYXCxufP9jn5HcFLV99CQelU9rQrHOJiYvXOhUCF+S2PtnR7ZAbfh59NMtBcnB+y0Fyc5OSsGvn0DFlJzDrSTDNcXUahT+Ew1YykO5jvSqgGUmggG1DNtLi6D2WPVHqY+afYU+BO/5lxW057MAIXAMywpB1w58ln+8YNiW7y39kfLwFQaKYc1U6HJcpL3J0b7YUgfS31Q2kvNUptIR86TprXFTeeDMAIAyPDgamy4fnD9lHSzIrUD7AiGGRhEI1722Owss4pRVFgLqfdHbpGZ48zMjnIIZ4qxsXwmK10YAbW2SMOgYEe27xuMbx0xQmgrLCiCw==; 5:RizZebw0A9kO1C7q7IkkI4DHeJrk3syLI+jOcmtw3ScaRs1X4z6Za/WThQsnFD/yyq3iK5h6c79krQ9JUY4TQgG1h7S4MYaDVWHZZ4S3jOpX5w3QnKL7elYbsr9kDv0Z8V6lAcWs3yGqVs61PIeu7d8mY8barfHF6NKhoA2sU2k=; 24:SSLyDMhL+UBo/g7wl9WKca722HZkWIKjeA9yV31DuU8mwAwxtLUXu7waPsTWMlMhBz/ePa9sb4uRgY1/FdfXNefULY21GttPnaVzWDHqJpQ= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SN1PR07MB2254; 7:cCgC/hhEI894OQgsGVqE3wFdH9tkXSk3v+Mo3Tws5r5vV7rvw3BmLeS6rqtrCSqDH2GU8nD7nR0pWbw+s3e4iTv+bMIpK4TYPamyR+avCzj5JU5xO+drvn4Wr6FVk/4ynKwXgdlhz52peS/GNzkX6fnmVGAdsvJr05YEByUG3xM/G3YZEYfdmkv4DqyNejtOqcB4ewObDPOrYbXLcrXtz2DZu0M3MF6ELOdRiIjKrTlSS3N3wK7pCQTmE0RPQ1XFLxmGuJETCoFzfiJWHWIOoeS2S671cbr4KXpQp/3ePqDJxIZHruFlwKUJWi8fNo5y+2GZEsTaFrSfK62fFe4J4Q== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Mar 2017 19:21:47.2756 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR07MB2254 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170301_192210_541748_9CA1BC9D X-CRM114-Status: GOOD ( 13.88 ) 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 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 | 22 ++-------------------- arch/arm64/include/asm/hwcap.h | 2 -- arch/arm64/kernel/Makefile | 2 +- arch/arm64/kernel/binfmt_elf32.c | 32 ++++++++++++++++++++++++++++++++ 5 files changed, 35 insertions(+), 24 deletions(-) create mode 100644 arch/arm64/kernel/binfmt_elf32.c diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index d35cea4..d059063 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -1049,7 +1049,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 a0188e2..453e0da 100644 --- a/arch/arm64/include/asm/elf.h +++ b/arch/arm64/include/asm/elf.h @@ -176,30 +176,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 -#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 2c7fc5d..99dfd92 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 b688bcd..aeaf474 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 0000000..7c38a22 --- /dev/null +++ b/arch/arm64/kernel/binfmt_elf32.c @@ -0,0 +1,32 @@ +/* + * Support for AArch32 Linux ELF binaries. + */ + +/* AArch32 EABI. */ +#define EF_ARM_EABI_MASK 0xff000000 + +#define compat_start_thread compat_start_thread +#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"