From patchwork Sun Jun 4 12:00:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yury Norov X-Patchwork-Id: 101363 Delivered-To: patch@linaro.org Received: by 10.140.91.77 with SMTP id y71csp495114qgd; Sun, 4 Jun 2017 05:03:35 -0700 (PDT) X-Received: by 10.84.211.13 with SMTP id b13mr9609552pli.112.1496577815418; Sun, 04 Jun 2017 05:03:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1496577815; cv=none; d=google.com; s=arc-20160816; b=XKgBKQGhSUEAl0CvmJib06dnklOm//5+em/O8r/eSYaV8M8fCoHocT4hlaPqU9cqxP ctJiPGcYaYk3cnk6OKvXLBfbMQgwdCc4nhW7rxwPd1aymA7OtvHY3qvmF9/StdekcGHk q/53rMS+Yb2KpLvmRf1IComozkmTEkEjN0TbrooQrecV+QsTwASdHBTWcLADb5HxrkOG NgY4AZkUtfApFxnDgadZGE9OPyWeiKzIvWmaHFSg5JhfCAdZrPmiWVZ4OAYex4hx2vlH 6V+P/OdmzqhHeQHTi/S21Xm0xFaSwWon8mfKt/E819LZ0o9bWEaKIbHV+SzYVG/nW06H ruDA== 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=AJJRbePolITYgolidYy5IgllW0fhY11cXDXXtBxn5RQ=; b=yH0QlDc4rpks0RTizkccOjWhajnTYppjQibUuxB+ZCF/B+5ycwwqM9AHdWEFN34tKr jzHWOUVS8F8qInFtwoIyqk1GtDQB7nz+EKCJpi1wn8c665o2P3Z9S91nJzITOtaHI8px iSdrA/At2dygJnMfjbT0GSivTwFi5uPCbMlD0m1vEXomBlFJCTNERXlOcu1Gm62sOetA KTM+j7DUIhi0jijwZ3656LQjwu2MEf7R+FHvhYUi493bNsURW8sTH0mjz00ohmrpFGsH Ac/51u/M5AjgHooCjjMXsIpeKgPvNNFqgodtQkznW0ZIepoHCw8J/NmS5gictSydH1rh 1wKA== 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.35; Sun, 04 Jun 2017 05:03:35 -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 S1751411AbdFDMDc (ORCPT + 25 others); Sun, 4 Jun 2017 08:03:32 -0400 Received: from mail-bn3nam01on0070.outbound.protection.outlook.com ([104.47.33.70]:13920 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751356AbdFDMDI (ORCPT ); Sun, 4 Jun 2017 08:03:08 -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=AJJRbePolITYgolidYy5IgllW0fhY11cXDXXtBxn5RQ=; b=WK3/myuHVnfDwe9J858t1Uy/4lBQ3UNuzWnWodacMoOU4JSP1oj0anuEionfrnxrcKS2xLi44rsg/+0MlFku/96j3YTDTozo7v8n5tBfh9lCOEOXB9s6kDWI0vv1/m20nrjxwvePqsAT1Er4fhWgEgCVWW4GjKOFT6+HMpkdRYo= 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 CY1PR0701MB1274.namprd07.prod.outlook.com (10.160.149.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:49 +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 13/20] arm64: ilp32: share aarch32 syscall handlers Date: Sun, 4 Jun 2017 15:00:02 +0300 Message-Id: <20170604120009.342-14-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: HE1PR09CA0075.eurprd09.prod.outlook.com (10.174.50.147) To CY1PR0701MB1274.namprd07.prod.outlook.com (10.160.149.17) X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY1PR0701MB1274: X-MS-Office365-Filtering-Correlation-Id: 4291d74d-e98d-4743-b30e-08d4ab419f58 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131423075)(201703031133081); SRVR:CY1PR0701MB1274; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1274; 3:tnjUG0Tc6elxGS9P3o8xCvoUeuZ1/IG9+z107JuVonoRIxmePKkOv/8KgtemKUEMTdpRTRFG1nAQqEpMYsEvANpBko1Jvx5QatWSPGeZKtDzxfbIuu4VAV7e5nG3OuYzI8bTat9vR6uaJHSeMuAWW8x+Ko2kfzZ91WVdRoxVYh64pbsOWhc9v+jZ2s1sayKne0bU1xFRvwVzGIaHuzCGqfNdC6pxiJKbEgfYVxvZyodU0yyllWJD40GJjgGO9qjUn2/8cPvkGaO3kfhcsAnl4b6T+lnlC/TgbXBGVDqdEDTEiSn3GsZnqRKkoAWt2hGkWby4l/f0XD+F5MI7l0YFSg==; 25:73u4rgSZfTvOHwbz7D+KOpyiiapi9PSuy2a8qjMY3vDOgY0IuWmMankyoDLqFHwC5qJkVnELiHGj8k1ZyoiH95TXM5wb7iNONdOL+/LQO+bOpxpUNTqTEjpuMcsG+DYkx7eek5QAgzcIqypeB6ieHWCqnBkg5pcDxI+/84xJnZWqQza81js3gXeR7gvJO1tA4zOiF4sN3ETQRUIwmO0HTHPM7irtA+NbQ0/NcvKswD6QIIrVfMkmSz2+miTU53Hclej+3lStW+TMViPBjos5zl64NmfLH26sTwm09WgrQqtYKEDB3Gb+45A/65bZx/9ZuWSHLPAApviKt0AY5zoIx2vDgqr2wx5BJL0uySGTr6dUTrfSmKABndp/v3atMaEj4+ffoOylU7YnyoiGvckdXVOCdIHoSJY2TYNSZQASgF7mW2V5TVyaGL5Vh8kR4tB502UjxB6kjCypFfwn+GeZ5GhiWmNlB+kRJKAgDcbaaoQ= X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1274; 31:sY5FNmkGRPnYz0P60VI6NGxHMLNCcZ4U22YyQHsn1QiPL0wcBE2uSbRM6LCxzMy/4vILsNe/xpI+yDqUiaKT0XQEfoQkNk/v0GvXjKA2fv4MkgoLd4ldG7NifDY3b36DhOPk+SNJi/8xaEVKSOkjfNTpzk1KZ1sbQEWLECkPwtno4dtq+5UaMdfhDRfz09nABxrTQjjnc4PFLNXQ86LWrI5bNReII0h2M9NPP53Eb/E=; 20:EhlHOEWEVQnHUkxRl5OdEiv1CfmvogbRAq2nN0y9L7dlBiSp22OIhL+lAwbt74o3l8eGetM8aQc8ZwZd0S7OvazouhqDjEcJfC4uJmA134sV8QwA/sli3BOMn2MyggTqS/W9n0FX+/T/n5nJTVz6TXaZLI8f5QaAb38hSqxf2UDnUjOM02Y4cN1BdKwH+2xxnpKm+lLHIENwJRPU2VNt2l5EPTGqOSxXzfLsprJTbDW+S9INqUJ+I+WnnXPH3XdKWq3ugmNCiS7kmrTzvb86veOgjLZFmqaTI4AjlXogWYx7qJ1LpffLHH5xxECZOY3e8NegOUMuk3fH1Rxsmd0Vc3flRwXGfxpcRQzLWYqf9R/uURixR0i+OQu/8vLXsijsMm/SvdfDloIR5yTPF/bhcM6ZF8OQJeM7DEni/RCZV4FEZH7FkW90QY8hjnTUiRW+q0l3nDfGHn9CU71FDfOnwB00YChZoIB5JcAnF+SX4SeNd8nhhTbYvBNroI4vVWnHjErd21WpKFW/zXjF66srUYjI5V1MjGuiYNJQHu6E12Ix2rCuX7CBekdsswKjHn+pQH8uvyclfZzk2DFh2lPjFgYiwqFmhGxeHvTYSEmmeN8= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(250305191791016)(180628864354917)(22074186197030); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(93006095)(3002001)(10201501046)(100000703101)(100105400095)(6041248)(20161123560025)(20161123555025)(20161123562025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY1PR0701MB1274; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY1PR0701MB1274; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1274; 4:A4DIYkIl+APxO3xfPLgGBh0omAUqhTX2IO8g6PonlOPGRsZ6nP0/rJAv4E1zVMFrGotRDYgIbDp0jug6kak7lsg+jIxJlDVazHzrGIpVwVxn+fX2ZqiQTFG4fsqd7V4da9VEAQdIK1U/bJUMpZsBiOCLWR5cJ3SB61NqSua6uLMgLPXD5m9fVaxKICwKkjp7c46qeaHrC5WFJ9RFb3yq+CiMCp/Yx2kvvNFtePLaOaqlFSYA3LCY1xqhEb1HLumOrmM1udpm/cY/vPQSheiGpnC2o0zejYDHbfzPlhdaUWYIdDWCnjulTMchK6TiUKXUMY0RIqxhI9j+NsCeB7Ro0ZuTV+JL19kGZCLhvnNN6SLxp3fQaIXC+xIG59CLYlazvBHQwXnv0fAdyJ9wj4Y3180wkc1taO5PvzU9QRbiqvPxXPD22wkHc0tLbkGFvWT+/w3ml8pd7Z1AJcm5KDjyTrnKGP9sbdGhE0NdNH4AwrnwEna/4Qf0cmeVpM5gvuZ8aORF1Nf9mRzzBvCIS6GDYiGFhT2wsz52u6lbEbjyLxbM00rTLJHM7DuJZiAaLFTXM6L7rVGtS3pJ7IVjwlSeQglqXi83IfwvWps6VpwqTi8mulLjxvVjNfUZTbarhEdBrnQ3/kW3A3q/7FHucHVYPTkzFJAzA11OCjM0q9BjsPaFOk/fNnlg+dByxTHhItPwjYfM9kT8ndZflj5CYJPuSffg4JQZ0Oet9JpVhy07m6P+LBh97bzqoqZ9wr6so3i9HP7MOAnOJD+rNinJ/U9bwwR1jwGgKjetdzeB/qqEOCUxCG2nrt2fOemP6aOpLuDsM7I+bs8ei0D5Ck2ZiRsRreY4y0pZMBBYi/AQIEyWlXYEOwmonAyM/4dKeoUDIzCjq8L8ZCY2mmQHkj/NYDBklZhrSx3mxtaw39LGW/t6XMKusufjP8ZK7q1k+NBa9kKrw5U0JvVw91BZeEHyHF6hZ8dF4O6E1vavBUrDVZwXHLlDwMMyLHubxkj6mtp+jYgSMMQ4t28qiyivlQrraBO8UiJtUfqsX76SZq18OrEBuTKldydRZvNq2ah4zAvSkxnJOVp9Xg9c2odogiSHVg129xKepKsM8C9GJEYuGibgT6b4YOBLIRglHiHos6HBJRieLOFZvK0a81Q145yzQXggG8fvO08S75+S3YFyFVeHBcCalK1yGrx5G/i//Mf6eUE55p3xRnXQW3NHoBmA1szEA+Fc062AL4k3KaQkLOQ/9dk= X-Forefront-PRVS: 03283976A6 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6069001)(6009001)(39400400002)(39850400002)(39410400002)(7416002)(3846002)(4326008)(6496005)(6116002)(1076002)(38730400002)(76176999)(5660300001)(25786009)(72206003)(2906002)(478600001)(50986999)(5003940100001)(33646002)(305945005)(42186005)(76506005)(189998001)(36756003)(66066001)(42882006)(6666003)(2950100002)(6486002)(6306002)(48376002)(50466002)(50226002)(53936002)(81166006)(47776003)(54906002)(8676002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0701MB1274; H:localhost; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1274; 23:7giLwfB5YIuIRb6oGNAZLQJ/CrIRmj2Z2P7UI5HLMJua2XjloVX0uPfpeiq23OmgZPf8eW3hb+nY62s/YCnHh7Dw876E4yX77JGjDXONynhhx9KIYOfYX0gic089Hix0Nn1meztAkYxm3ikdlaNcaNLvuzLF68d7aZS2g+kHOGF6rbFtjW7KCe3bPfruCKLW9DYDMbdmRpBgyzNAajoJidEpum0CNtth3Hp7dehFgh0GwRM/4yXR9kyaPRnPDB6KVK0BhbsZcbK7oyPrwwjnPssK64+oK+LXudmocRjypXz2dbQ5QS6nDX/TlK+FI4ss79ZGL7M0BalrgRT1PKL/+mZ2nR3ziZkFiWDWBjw00tLUUGBwcCS/VvRFvZ6iUnH23pGRwl8OeSmhCqLbZ0zTXMbjmix9aB2vP/a0FitA1OrvGHJ0/IFx1o6t+QJvCkgY/9i0KhereX9i1mVv35sJEAvHQdi5lAxfiZM2xUI6yMMSZLqm7pTx29T13UAbOtvwF3ktrumjxl6o4SLr1blf06aXJDZiymaUlTiygPy0StPGT59BzoMyTZt55cOuLkWNkFmKVRT1588Yz/nMBgWPGYIJSLGRB7zPfy3Vdmc1Jc+gbl/2Io+SWujFp/0nPwZ+ZQDuVwF6E9LdLjI6Tkk1JIlps7Ty15LB5Sayk6tun7kXHU7fitxm0XelBvD67W9xptuFksRZweCM8fgej7zg//qHkTdcbH+XhNMdGD5898awByGb9A6QJoghyrGn/lVAqEjf2dKvKHF6nAXijvodNZUrAyMk+i9WklC0LAiht4jaLQn2kBr09n/JiKOpGi7PjAT4NoqUWA8N48Vv/4R22cN9kgeGgY9Y4Ds/5Fz7Lta6vkgT2xifkZ8AtDw794Twi46YihrYRwCtcy/oIL7QIdBesGxFWSOS8KyBXhB5QdzpFRDnRwgDpAE/ykBSV4g4jmwB/RZG73jvwSxCygc4rEUr4zrgd4J0zd+VmQGd1G6aubHUVXJxYQPVFsijDxOMF8ejr/obuhetdIFlZhYu/A== X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1274; 6:PLrRVtEbPNytfk+Kik03EPgeZODuWtTxBt6JgbgDorNxT7oC34nMl4q5fjkZg/Pt+dw3pAvkmjvCRx9DMbiNiKPbhCtXGR1WOtLas/VoZl3DJtLan021mQZkp4U1HSimWzFlCHr81k+IqAwqjtHQr8L+kNtlzuCc1MzDpIHeRCyZN2sjpr0NUizcg/pznXnGNDwzFJ20mjPnBUf4O6ijx8bU/kCCqiCJ2qPHphi4gAs4KGLRcx1vMBxNebOYBE2LzOFMv/8T6dqvyw4Js2b7jOI7hWj0vZO9XBYy8gt39etkkX/kmlCVsAQyLrmat28va8vczGPUjdyIckp3ZaLgJKHSbGmPETG1JzETqb1UAYDv67s2T4pM3dMLKf/OsfvHz/5ivTwSRHbQmvnx2V4LMMt75cdqsgl/vrKzunOnuy14N+h8a0eczm3gJ0YuAHL3vNzpUupnymdlc6jmSseBiW7jui/gK2NsaljrQ9wz7beqCDJqKlJbs72yoQ9Z8vLONxv3As8YZkqnkjHavSi+fw== X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1274; 5:jJ9ewyeBn/5S7mlb/neQKwofTpq+9THe6u+6ppj18O+iIkiNJzmzSVQssBfker62sQ1r4RFgXgFXFWMhyFqCg33FsLRROys0pR6FAtE+Uur40NVP7/cC9B/qonuOdHamlRPwQgxSudb/Ng/3Myobnha+m3hpMxXP5BpGrVM5KqJOPQsalIweopot0m0D9v1trxis0o1GW9Nj/LbFeY1scD8Tjhyu2kDSI+I87sqRXYcIYM2i4lT+5YWV7cReS7LecG8kV2mMLizyse59EEsivxdYcskKQxcE3T0RN3wvg45dho74yhS5j2mOR5ppzAdkWcQ09WdG+EoqcMI5v6fb2M3PP5X3Qd42RXNgGGsJ0Ve2/ZeYCkyEGJ7VUyZJr01un0H1IAEKt9LC93QL/T65GmTVAK2MnWbq95ju3CH6IYQEZvu+mJHStYRt5zS96RVbvsdZDzicox8Bs5R3rNJA/xPoc6jomehabqm+aIWk6NaNzQByUkPghBAxUyCgTtt4; 24:1DBEM9c3TFaEpxbx2C7o4wF7gjVwh+WdnGlmGDLxKRGCHEh4TnLJriHtPILdOWO5BAc+kqk8eRIQcPiiyNvDfXQmwjvK1yIAhwIZ6XvBObc= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1274; 7:8mxM7W67C75YSL402sNM+GlnUqXwQ/MbTq/dkJHuL1/9+N012RM5ociElOGsaP+J8OeJRVEnO18PQ/VnxyBRQGTdDtzcuE3az6j5jZxWekruMhlVLdXwQc0IcgbgPFA6229W64axKGeKyAzebZYSL1TEvr1PmZrVsTIEe8tc+vC8P7lhlfA52sTycmr/FHTfzqS7A4+BC2+IssZmj0XzRfNib3jTMT5SJIFYsrH5xbPxqFu+xxOCehw1wAbI+W9BHJ+hTWOU37aL453Fz6qtucXRJd0zGENRimRQIexW/E+o0xMQ2C9KMMhbokayedyiMtOXyNpZNOmHgJEGuqG12w== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jun 2017 12:02:49.3040 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0701MB1274 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org off_t is passed in register pair just like in aarch32. In this patch corresponding aarch32 handlers are shared to ilp32 code. Signed-off-by: Yury Norov --- arch/arm64/kernel/Makefile | 1 + arch/arm64/kernel/entry32.S | 80 --------------------------- arch/arm64/kernel/entry32_common.S | 107 +++++++++++++++++++++++++++++++++++++ 3 files changed, 108 insertions(+), 80 deletions(-) create mode 100644 arch/arm64/kernel/entry32_common.S -- 2.11.0 diff --git a/arch/arm64/kernel/Makefile b/arch/arm64/kernel/Makefile index 5ba41095c466..f6f12e2e5010 100644 --- a/arch/arm64/kernel/Makefile +++ b/arch/arm64/kernel/Makefile @@ -30,6 +30,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_COMPAT) += entry32_common.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/entry32.S b/arch/arm64/kernel/entry32.S index f332d5d1f6b4..4bede0324440 100644 --- a/arch/arm64/kernel/entry32.S +++ b/arch/arm64/kernel/entry32.S @@ -39,83 +39,3 @@ ENTRY(compat_sys_rt_sigreturn_wrapper) mov x0, sp b compat_sys_rt_sigreturn ENDPROC(compat_sys_rt_sigreturn_wrapper) - -ENTRY(compat_sys_statfs64_wrapper) - mov w3, #84 - cmp w1, #88 - csel w1, w3, w1, eq - b compat_sys_statfs64 -ENDPROC(compat_sys_statfs64_wrapper) - -ENTRY(compat_sys_fstatfs64_wrapper) - mov w3, #84 - cmp w1, #88 - csel w1, w3, w1, eq - b compat_sys_fstatfs64 -ENDPROC(compat_sys_fstatfs64_wrapper) - -/* - * Note: off_4k (w5) is always in units of 4K. If we can't do the - * requested offset because it is not page-aligned, we return -EINVAL. - */ -ENTRY(compat_sys_mmap2_wrapper) -#if PAGE_SHIFT > 12 - tst w5, #~PAGE_MASK >> 12 - b.ne 1f - lsr w5, w5, #PAGE_SHIFT - 12 -#endif - b sys_mmap_pgoff -1: mov x0, #-EINVAL - ret -ENDPROC(compat_sys_mmap2_wrapper) - -/* - * Wrappers for AArch32 syscalls that either take 64-bit parameters - * in registers or that take 32-bit parameters which require sign - * extension. - */ -ENTRY(compat_sys_pread64_wrapper) - regs_to_64 x3, x4, x5 - b sys_pread64 -ENDPROC(compat_sys_pread64_wrapper) - -ENTRY(compat_sys_pwrite64_wrapper) - regs_to_64 x3, x4, x5 - b sys_pwrite64 -ENDPROC(compat_sys_pwrite64_wrapper) - -ENTRY(compat_sys_truncate64_wrapper) - regs_to_64 x1, x2, x3 - b sys_truncate -ENDPROC(compat_sys_truncate64_wrapper) - -ENTRY(compat_sys_ftruncate64_wrapper) - regs_to_64 x1, x2, x3 - b sys_ftruncate -ENDPROC(compat_sys_ftruncate64_wrapper) - -ENTRY(compat_sys_readahead_wrapper) - regs_to_64 x1, x2, x3 - mov w2, w4 - b sys_readahead -ENDPROC(compat_sys_readahead_wrapper) - -ENTRY(compat_sys_fadvise64_64_wrapper) - mov w6, w1 - regs_to_64 x1, x2, x3 - regs_to_64 x2, x4, x5 - mov w3, w6 - b sys_fadvise64_64 -ENDPROC(compat_sys_fadvise64_64_wrapper) - -ENTRY(compat_sys_sync_file_range2_wrapper) - regs_to_64 x2, x2, x3 - regs_to_64 x3, x4, x5 - b sys_sync_file_range2 -ENDPROC(compat_sys_sync_file_range2_wrapper) - -ENTRY(compat_sys_fallocate_wrapper) - regs_to_64 x2, x2, x3 - regs_to_64 x3, x4, x5 - b sys_fallocate -ENDPROC(compat_sys_fallocate_wrapper) diff --git a/arch/arm64/kernel/entry32_common.S b/arch/arm64/kernel/entry32_common.S new file mode 100644 index 000000000000..f4a5e4de6201 --- /dev/null +++ b/arch/arm64/kernel/entry32_common.S @@ -0,0 +1,107 @@ +/* + * Compat system call wrappers + * + * Copyright (C) 2012 ARM Ltd. + * Authors: Will Deacon + * Catalin Marinas + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include +#include + +#include +#include +#include +#include + +/* + * Note: off_4k (w5) is always in units of 4K. If we can't do the + * requested offset because it is not page-aligned, we return -EINVAL. + */ +ENTRY(compat_sys_mmap2_wrapper) +#if PAGE_SHIFT > 12 + tst w5, #~PAGE_MASK >> 12 + b.ne 1f + lsr w5, w5, #PAGE_SHIFT - 12 +#endif + b sys_mmap_pgoff +1: mov x0, #-EINVAL + ret +ENDPROC(compat_sys_mmap2_wrapper) + +/* + * Wrappers for AArch32 syscalls that either take 64-bit parameters + * in registers or that take 32-bit parameters which require sign + * extension. + */ +ENTRY(compat_sys_pread64_wrapper) + regs_to_64 x3, x4, x5 + b sys_pread64 +ENDPROC(compat_sys_pread64_wrapper) + +ENTRY(compat_sys_pwrite64_wrapper) + regs_to_64 x3, x4, x5 + b sys_pwrite64 +ENDPROC(compat_sys_pwrite64_wrapper) + +ENTRY(compat_sys_truncate64_wrapper) + regs_to_64 x1, x2, x3 + b sys_truncate +ENDPROC(compat_sys_truncate64_wrapper) + +ENTRY(compat_sys_ftruncate64_wrapper) + regs_to_64 x1, x2, x3 + b sys_ftruncate +ENDPROC(compat_sys_ftruncate64_wrapper) + +ENTRY(compat_sys_readahead_wrapper) + regs_to_64 x1, x2, x3 + mov w2, w4 + b sys_readahead +ENDPROC(compat_sys_readahead_wrapper) + +ENTRY(compat_sys_fadvise64_64_wrapper) + mov w6, w1 + regs_to_64 x1, x2, x3 + regs_to_64 x2, x4, x5 + mov w3, w6 + b sys_fadvise64_64 +ENDPROC(compat_sys_fadvise64_64_wrapper) + +ENTRY(compat_sys_sync_file_range2_wrapper) + regs_to_64 x2, x2, x3 + regs_to_64 x3, x4, x5 + b sys_sync_file_range2 +ENDPROC(compat_sys_sync_file_range2_wrapper) + +ENTRY(compat_sys_fallocate_wrapper) + regs_to_64 x2, x2, x3 + regs_to_64 x3, x4, x5 + b sys_fallocate +ENDPROC(compat_sys_fallocate_wrapper) + +ENTRY(compat_sys_statfs64_wrapper) + mov w3, #84 + cmp w1, #88 + csel w1, w3, w1, eq + b compat_sys_statfs64 +ENDPROC(compat_sys_statfs64_wrapper) + +ENTRY(compat_sys_fstatfs64_wrapper) + mov w3, #84 + cmp w1, #88 + csel w1, w3, w1, eq + b compat_sys_fstatfs64 +ENDPROC(compat_sys_fstatfs64_wrapper)