Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753682AbdFSPzc (ORCPT ); Mon, 19 Jun 2017 11:55:32 -0400 Received: from mail-by2nam03on0055.outbound.protection.outlook.com ([104.47.42.55]:18144 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752599AbdFSPxB (ORCPT ); Mon, 19 Jun 2017 11:53:01 -0400 Authentication-Results: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=caviumnetworks.com; 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 13/20] arm64: ilp32: share aarch32 syscall handlers Date: Mon, 19 Jun 2017 18:49:56 +0300 Message-Id: <20170619155003.13218-14-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 Content-Type: text/plain X-Originating-IP: [85.253.137.34] X-ClientProxiedBy: VI1P190CA0008.EURP190.PROD.OUTLOOK.COM (10.165.188.149) To BY1PR0701MB1863.namprd07.prod.outlook.com (10.162.143.145) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: faf958d8-e5f7-4949-53cb-08d4b72b408d X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(201703131423075)(201703031133081);SRVR:BY1PR0701MB1863; X-Microsoft-Exchange-Diagnostics: 1;BY1PR0701MB1863;3:7AEzKCVLgzFLi5WpmyvUQJq9O7mA9qWjX5Mc+7nMkESqYoEZe+j5AE1XiiZQT7JmXVWpj3/+/yUeeAfk8TBalB0RyHo41pvZs3+39WPtzosaywZH1CWmGYh1Bwdie/o2ImXmKv0xH7Cdkqctlj91uWp16KwiMTSqMOzKyW9W6MJvAlJpuwj55yXjiczw3/5MzbyMcF0KUjosm4KAgRjA3EbRZiP8fJ2KOdFLFfjNMeNOuMp5ZY+DVcpLk4t8LLfN5dqqOuHjhfSEeayCdahI/srZTuaAOwDkjrr8sQxZqtUS84eDvDQB+EOcayiSgyfpEtV4Xj1l+udyX4RNEpjZ2g==;25:pp8w8XhNf97uU2p5zrZJzrS4a7TQZTnCvV/77HRrflfjSN9JfWYPKVWoAvsxEW0oPipfgyhfnCDykeOQsy0/qhfnSCf1FP78egJPv8N772GWIFn05cr/GCYQBH7TYVIQ5AkG8w3nA5ZXocoTnJmKCSZTO87xs4C+ZYg7mhAgLWz8pvl7ZG8ZITYtprDSBo0o0b3hkIKdMRhoaHT7adikb/UPOYrdz0EhG8JWLab1k1hiAsDPNpRWwWm51PhbOd3prH9EWFkix8W8dlZ/v7GGXhjqMcaFnjlGGdozgVjB8FNkAhOOFkl/n3mfzESzcKwue4sPp5ZrIbffMLJoHBRR6gDFAdpC1xe2wRyly1nsYucXC1T9AgeTh1e68ufZ3wf+IfsrxtFe4CZgyahOFf5Znz0f8YmegJ7cbXDe6W6fQq50Egxt8YP+0ZEvelCKweDAGSg64gGlK1pvg4HhS3mwr/3vyJht+WlbBMi0phJKxgk= X-MS-TrafficTypeDiagnostic: BY1PR0701MB1863: X-Microsoft-Exchange-Diagnostics: 1;BY1PR0701MB1863;31:eljj4hA0tDrVWZxjQ8QRhKBiV5X1yK3xHc3BZuibu0/VColVR04qcbonqnpSu1hFNaLAVAtnYroT3q3dlaR8+ncDNWDU4mprtw0l0alzYqIy6iQl06agXm+KsWV8225qSBLSnV26JeUnIv8kYH1RzGMfgafyr6LPGPzXLUT/8IWkIA8qm3zSW2qavmnS2ONK+k2fQpATGI7+p85tyNNyO1G/P9MWzWs624kcvi4pVv/Vqu16P382f3RBuE5BqnXydDXNarKTvf+3BjoDXh0/yQ==;20:lCHQLmfrBjQx7o7h6y0mVIOeU7QQVLN8Qns+lgX6yPxus6gG+oi+1SF3MMBwifIvalfF29tRLwmXUGBHkvl4moM4yNuCEtR2c7DqYTdMMXd+smiE+gWnzQh4AosMVdPqKDVnx7kIzi3N2UBFVf0swKnScNSmOXjKThlMhGQBAM156nSvERoN8lXwYlzO/QG9oGjqyhwi4dhQ3VwdQBLwBbqTyPy4Z+LQ19sYkPL+JL0XS5yMi3LnBQYs+UVYDxtGwKWD6NALoj5dhfjtXsvbFdvdbv70SDhZD5m1f65Z/EbQSYdA0yrQB3IUSX/PXT7JIckq0FeRIkxkK85M1HWJiQp42ja7jFVOT1CGLajNAbC1RWLqXw+7aqQ5Hb5k38lwrqCMyQv3bh6QvlNGiJW+BZbU2OLmPXfHK4VECUeWAnjYMLHY0Djmp64mai3eq6Xx1uMPOm6gfvkItNjY7SgWXOixnNVNXb0623LGlfFRwAZvXyizTLuYuDnFRL/wK6L6KqPyo6vRNKXDntqgJxw0/l0HtOlO/4cVKLCyklfK+WYYpUSdFCObzg1m519iJCg9u4cE2pdQE6ZkbC2U+q6U6zhfgFhO+XulWucf04Ucy6I= 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)(10201501046)(100000703101)(100105400095)(3002001)(93006095)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123560025)(20161123564025)(20161123558100)(20161123555025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:BY1PR0701MB1863;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:BY1PR0701MB1863; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BY1PR0701MB1863;4:Xqc41Yy1y2ao0RUtV3CdUvcA3Xx60aQn+Cg4eeSD?= =?us-ascii?Q?Id/WdNSHc0SkYXF7XLxwQ9Zeaa8GNbEBB4xHa1x/SnjbZBCZq85ctaAqDBMR?= =?us-ascii?Q?DMWP7lQASPgRNxBaF1JWYfArokl6cb2FbhSp9O1/W1rPfeNp3TSchD4esq5l?= =?us-ascii?Q?YwWV/dGRhFRvJ2NiUOg7YY6eZGtmelclFkOELtmRcMDOsy/1MgXS13xtCpUX?= =?us-ascii?Q?NSygP1oPswhftHBq1VkAXLUdVg50ceTm+UrU/Fxtq540MlnT9Lg6/fBt4mNe?= =?us-ascii?Q?fYa1+c3+jjkEvxUV1h4w2mKecQBkM03gLJg/kgNi0d9TT46VMZ/NiXlqTdhZ?= =?us-ascii?Q?pJShTadnzM/FLx5RHol6aX0LKzuhtKOz7lI/2XhwxN04QKTv+0lDPlgltQ+c?= =?us-ascii?Q?4mtbn0z/J8zKJA2zRMniXTO58RGR+ypWemQGozuEBHcQi8HYGpqH2DvDljUu?= =?us-ascii?Q?/CjCm08Xe4S7XpCAV0UyAQYYHPm22nHt4eHRARldZRwbZiSJettGAe6pP8Av?= =?us-ascii?Q?z+CZqWNczvugHz37gdhUbhse4wwxf1OYr4J+CMVuDYAWOUbWNu59G/E+8QnD?= =?us-ascii?Q?9Zp8SMFirVqdhQEikz6zAXwEkk41JayQjartG4iP3gkrLj2yt9SG/qOi4sHF?= =?us-ascii?Q?kN1wgTPvpPQWYQ59Cfv0BYXyTwtrnhRNQv7y8Qsp5/YZSCWXU9B13wqBtjzk?= =?us-ascii?Q?faeh3ZaDvU4Xz08ckzpQpRerOv3uFzH4c3rfJa4zTPjTL30nhKE4xcVmk6zE?= =?us-ascii?Q?yGHE/mSqyuStAfiMf78kHrWNIDHvGP8g38biZU0Ml8qA2i4f2LRnMT6KRL4j?= =?us-ascii?Q?0EKxV2mMPuOtgUORk4xnLIg2M05lyq5/2cV+3A/M7WHis7M8JMpk+/6hH+h6?= =?us-ascii?Q?4jhnoiZf+3A31L+KuoBpNL0hr2VzXZf7Zh9QXkUA4aekQx+M8zFsP4Jt2iUH?= =?us-ascii?Q?OMYrM01oT7makMfPIOCi8q6Z5S/B6iboJLXqbqtsQetbyOlGhhtOrp3J6l4q?= =?us-ascii?Q?eI+5TnQdemKRhPi4fqFaARHG5gFmDZVf4xu0FmgfEcXQ0O7UWWeGocs5zbQy?= =?us-ascii?Q?vriexqyAXMjJ3J9gJD4gVKcTD78/3fOewULptN6VMFNAMKTse34Tz6Ls7qZ5?= =?us-ascii?Q?dtmItxqUx4TNo5RmcCA9ZhF2r40hs8S894i4yx20W7jZNZFZPwiqowbGZGKg?= =?us-ascii?Q?yfrczNHUBWPe4T8C3R6/KeePv9Xj77MDop0i+P7+OQfpzMuiMkHpNrhoD/ww?= =?us-ascii?Q?Fg5b4IR88nwa7s6cm1k=3D?= X-Forefront-PRVS: 0343AC1D30 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(6069001)(6009001)(39450400003)(39840400002)(39410400002)(39400400002)(39850400002)(53936002)(50466002)(189998001)(5660300001)(48376002)(2906002)(33646002)(38730400002)(50986999)(76176999)(5003940100001)(6486002)(478600001)(72206003)(6306002)(54906002)(2950100002)(6496005)(47776003)(66066001)(50226002)(81166006)(25786009)(8676002)(1076002)(6116002)(3846002)(42882006)(42186005)(7736002)(7416002)(36756003)(76506005)(7406005)(305945005);DIR:OUT;SFP:1101;SCL:1;SRVR:BY1PR0701MB1863;H:localhost;FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BY1PR0701MB1863;23:443dr6Er9QLRvuKEvqLCeKmxzOdIH18wQHGMaEO?= =?us-ascii?Q?PravOAl5Fr39/8mhXEFVSRHQ1OtkV3yrqhrnYtKsD7956RU+EFp77gwpT2wE?= =?us-ascii?Q?H+dBij6fPzl1zbZnUfa8Ag+0/gPdu+VX6uVim2pScxPFpoJROILEEtxhulMB?= =?us-ascii?Q?9NDHvxjDgZyFNdu4Zd6KGbILD7YQDiCAo+FqkhInGAwwuJgxV14lQLolT3pp?= =?us-ascii?Q?yjts1xCECxONT7R/DzIapJB9vRsd+PH4QvGbZFaEM5U5Rz8J6B6QHMe3q+hp?= =?us-ascii?Q?H+gXjZZdcIqi51xcZmzaA3Vn6lfIjJ4M31Jgw61Kedsytm9wzxUk8W0WUAFy?= =?us-ascii?Q?dbqv4gKm/sVXKwislVZTAhHcjiJgA5jESw0iRlVfNtxKbdApZNJcAuWqgTS9?= =?us-ascii?Q?ntELfJsZrcxZnIy9az08N4c4q0zI5BAH7c+hvY8bnMt6BRPHXloW1dkgtbx8?= =?us-ascii?Q?X2r/AsjKy21bgFR/AdbyxrpiHsG3OFZxDouzqV0TK0EiP6rhnf0s/OfEv9tr?= =?us-ascii?Q?hCCv7JF3F3ICodt/+BYPsDL/hgmLPP9afbOH52GFui6UQ2aKG7muVjPKg8eX?= =?us-ascii?Q?Sz76P8ybVekBZwLjezgeZQ/SGkh2BDSj+LQfhYsT07WlWIO7tnTGsmYkqW7K?= =?us-ascii?Q?IWqbMWngUTTXw7FWrzM9eKafKfGuQfOnSOmsAHTMGipwyNFb6ShLPjBFZA5f?= =?us-ascii?Q?T1PaP7A8kD/im5CW8jZYiVDsaNGF2ojlI81UhUvUmO/QTsfUeRzIauj6At0e?= =?us-ascii?Q?qwj/jtmW02WfGX6sWfwJJ8wrvnGH3Vel+2d8sGmFLXDQCOCu65+aVPFri4iU?= =?us-ascii?Q?WkhTf5+ezhSCUiuKn5XKzlcGA1UsPutywRouv7gy2Ku85tSFvyWn07pYvlKY?= =?us-ascii?Q?MAlfXevXZp6D9ENqL+u7bLVGm7rGCnAcpvWEbRaF6I2LU12ooBfuC5F3B2uJ?= =?us-ascii?Q?uULHPWVE0pl3wPJKKqYY/ad803QTynIazC0QKXljRU1QfVfZ9CII7vrkyqWH?= =?us-ascii?Q?VIypd0oeJkl+V59EsFYVaFr7+s3ektRawrihENHW9NyIxEgbHcRwz5YC+Z0Z?= =?us-ascii?Q?jQU3/Ggu8Xn4img5In8YdJLvLnH8BBLTZ71XH1Ey50zXegsglPw=3D=3D?= X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BY1PR0701MB1863;6:dIB3Y/cafoBmbS9JMm4ptvfUnI2kOpbh5E1Z/zv8?= =?us-ascii?Q?YMlsiC5AUTjlXTiRQIMyvLNmIgWdB/hr9s0hNHasRnXGTI1jA5VLhPB+DQ3C?= =?us-ascii?Q?rHMITdqHlkCc7MN9s9C5WTfBPJ9JAEWP0KWfzSKvbfOljOd1WPRy/jg4RKP0?= =?us-ascii?Q?/ctTMURKH9dQho73p/Pp1BXOsvZDOSk5DX70I6SFMJB7dPcQvgRfgQn/5yIL?= =?us-ascii?Q?v1qHtUQbDJBYVtBhxyQDoe34FfXlENeowp9f753pYJMte+vz1nwIzfbd04z8?= =?us-ascii?Q?Qun6fzK8C+iqflBCI4aGUiFVbdoUfGlFMbn8vaUuRlJ2krVTAijYDBLZQUDo?= =?us-ascii?Q?j9NDl9ByhOsbJYHoJnBSte+9trFE5T0xag0yY2YftrpU5nsnktu/qfAU4SFq?= =?us-ascii?Q?fSmbJWfXraXUXxtCYobNZ3yqQ6l3J1x2gra+1xrzX3bQPYe8jxOcf3afVSx8?= =?us-ascii?Q?Zncyk8Vh/QnANpImxmY8b+OyrHZ9aUtAqgvJPOBs+tZ2VAOJV7HUgxUlEoSU?= =?us-ascii?Q?UZ+R2shm5mCnA5tFfse0MLotOIUlCXc6mkJF0f6K4dUy+FtkT5mSqL2r7vrv?= =?us-ascii?Q?H5sZ4tjQ4o/M3Q+yQPLPwZ3TvZXw222Ej1LZtV2pSAdPfDbFlAAVg4gzMyyW?= =?us-ascii?Q?MQ8nLP0f3DZyXUMPvDMJZiJTsMb9wSHXFn/G7mqra/QKC7TWcGYMZzem/BFa?= =?us-ascii?Q?0+C6jm5hgpoDgZSANU/RSwCn+XV25R3k+1fQ4FiCcnqeJZ4mAHeAIWlq279A?= =?us-ascii?Q?joeheSO8N2a34bMRcnseEdW0MEOT3ldJTLN65gNRhRbg1n8199mWh355YRLP?= =?us-ascii?Q?thXgc6HdpOXxyNZW9E3xnI/Z3C+uVWQ2LGpZat6XgT98bufEO4tfvRbtmNeP?= =?us-ascii?Q?onn6hiUDT+rChI5hpVxZHmJs7kAzvsuEHitC+qjt9hF72UlCtwHCWWxCSidt?= =?us-ascii?Q?bknf/OhWf5y7F7MNDJkvXwNDWTVtDPX8VFPTDxrVT3Kix7HUOShGgIxSn/us?= =?us-ascii?Q?gDE=3D?= X-Microsoft-Exchange-Diagnostics: 1;BY1PR0701MB1863;5:Bh9oYx1yserdWd88Aqj+NXZHe66yvHJU7coVht/2CzviBdSU2lVwivenMDmGG8eQqyPPCthXN5eqZVZlygDsEYn2ju54mXduP7iZMsqW9+4QaKkkZmOV1Cq5Hf1P6mdL/xjuzABX9hHv48wdLL/IlArNKrOuGwMtwNdgw/CDGc2GY9MO09017KVUOPu16HzDOMCQnldGtU1haDkhjdCFHdWQ9qjsNo03b8sck2e50vWzh6W+xcz31pchLeqtvYsAPioav2zuhLUOtxYmNoE4AqMYMdIhe+SWL/LO1Z8KXF8FxzfrXF38/HmMsygjefzLssw0pIj1zAH8YqL2SMoWgcrkHl6Z5eNBd07m5R1a5+o47Dh8j/f6vTKurdHfItbwjH0roki+P16dRFifkEm98/342OSxajl9hOdC7UOxoA1GHIqssNw0BOF0Ar1KOV4PbBYB1B5IEIHRvE/SurXnsn7sqUmvLWde3zlIwFpD4RwEpGF+DvswaHRwTWVi7YDz;24:bnzAlkdhyk47S8qUDbhPQtCOsclf6YdkEYK9GeoNY3gq3S4GG4XyH0q5wvIaFk+pFp3pbki065KNpAuWQyh3Xv7TdTAuxetKZSVOwURHcLc= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;BY1PR0701MB1863;7:vQu4Zc8GmMRgXas7PAiTmPggUZcElaR0TvexPFWS7gYyaldcM2xIb/fzyfbJO+T83SFSQ2TC2zISLT8ebkGOCOdn0pa5tWUJ0EExY0o53NPDOPP5LknYsVpQpAL7aFAl5xIkneYEH+C++gqeCPjFfHa7NbLP7yIDbnpPT0XDClB+iKIlRLRZkcQCMh1SDG+DmTvhmklA+2QFmc1KziyzT4ikpk9OiateaH4IHOmgVstX72s73KZSkrrnUy0CmhP3W9pT0RDZOyakVq07s7dkDxlvvurDxk81ogpIjzDb+OMfBAYujSz4Au3Q6lbni0hylgMzh4xwGhmfQcD5Z+Zdd885iFj+K6jQ3MfHwmkQn9HKoQ10IOZxY6+kh/WPJ8NudU15GWPNAv1kKklf1lmyPaP3CHByF6XTagitHmJJ4ZMlCrbYCG7E/GWX15Das5ZUMx6bMUAssq+EFnOkxtM2KzVLkIszVWKLYRklWQCEtw2uNAEFdupyMYhtQwrMmHnUpjcmzbzRfEcYc3X5I3C4diNjo02aMmUBWBd3im/qrVqxkSksuybHmfyO4y3MQqjlGaDzFAM9CWum6bLHGuy3if00CsvPIAtCo3YlAsVK7/qPSe7W1JfBWww9ACVQpH9iq4ZuJ4AGMz6z0KS8ylYITdXU6ONpfp5IHS8+fAMzpY8uoPZJe+DgWw+Pti9rEaYvR27IXUopdjkaowirFKDZKurhjWRjknr35latBajizXO45Vomzv35tebu+h1dgc4fv+1VjGwtzpbORwz5W8FalaRDSmlOW/eE7z05JooN5HU= X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jun 2017 15:52:55.5563 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0701MB1863 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 6473 Lines: 227 According to userspace/kernel ABI, userspace 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 diff --git a/arch/arm64/kernel/Makefile b/arch/arm64/kernel/Makefile index 41d9a3ab07a7..7243ffe358b4 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) -- 2.11.0