From patchwork Mon Nov 2 23:30:41 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yury Norov X-Patchwork-Id: 7538891 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 725439F327 for ; Mon, 2 Nov 2015 23:39:27 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8AE7F205E3 for ; Mon, 2 Nov 2015 23:39:26 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9CA1C2057F for ; Mon, 2 Nov 2015 23:39:25 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZtOfS-0002Sv-EI; Mon, 02 Nov 2015 23:37:38 +0000 Received: from casper.infradead.org ([2001:770:15f::2]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZtOcl-0007HV-Fu for linux-arm-kernel@bombadil.infradead.org; Mon, 02 Nov 2015 23:34:51 +0000 Received: from mail-by2on0093.outbound.protection.outlook.com ([207.46.100.93] helo=na01-by2-obe.outbound.protection.outlook.com) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZtOch-000813-GK for linux-arm-kernel@lists.infradead.org; Mon, 02 Nov 2015 23:34:49 +0000 Received: from DM2PR07MB621.namprd07.prod.outlook.com (10.141.177.140) by DM2PR07MB333.namprd07.prod.outlook.com (10.141.98.17) with Microsoft SMTP Server (TLS) id 15.1.312.18; Mon, 2 Nov 2015 23:33:47 +0000 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Yuri.Norov@caviumnetworks.com; Received: from localhost (109.252.143.100) by DM2PR07MB621.namprd07.prod.outlook.com (10.141.177.140) with Microsoft SMTP Server (TLS) id 15.1.312.18; Mon, 2 Nov 2015 23:33:45 +0000 From: Yury Norov To: , , , Subject: [PATCH v6 12/17] ilp32: common 32-bit wrappers Date: Tue, 3 Nov 2015 02:30:41 +0300 Message-ID: <1446507046-24604-13-git-send-email-ynorov@caviumnetworks.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1446507046-24604-1-git-send-email-ynorov@caviumnetworks.com> References: <1446507046-24604-1-git-send-email-ynorov@caviumnetworks.com> MIME-Version: 1.0 X-Originating-IP: [109.252.143.100] X-ClientProxiedBy: DB5PR03CA0013.eurprd03.prod.outlook.com (25.162.150.23) To DM2PR07MB621.namprd07.prod.outlook.com (10.141.177.140) X-Microsoft-Exchange-Diagnostics: 1; DM2PR07MB621; 2:VxdHXm2HHXryGZE8dCnzCCLJ0UqKI6Ul/dORO9Xz2Dp1Ury63EIBIZnyAIHa7LF3TSF9J0JJ9LYKJ+wKUkdJl8P0lnyqU7XJ1DDs6V0YriX/K6GmnzPIbO3pO6j6jbNk44Xi7XTmIn+tippN+RwGmsgXwB17Grs9iGjOfj7GKhw=; 3:yOVKkBK4IftcPQDHJZEbWMyyt17GMqeR3U3+xF1GKgp+Xp3RZVJoOfyO4j4TedbRVyzHmgon7e2htn7OGP/1D2rypwfxhFzF/ODE/uNVo6p9oQv3CwS+acFzl8Q6IEsgYE2ZJXmkiYvCCJycIjlvBQ==; 25:xM/UuWXdOA6f8YdMB8faohKwdXLvumu4LFC38G0gSaeWSnucjWJQjCDYtkoo46k/7T5OQ1peTR1mUvEL8jiFL1p8HGVmttcNbMHt8IvLjIFP1t3ryLMR64yRW5H6M+h90monAXtCX5c/h4/JuwzwImOPwq9p/6diyhV84+0gV5k+QB0xLWjej+TBdQV47IFMBqgRCYbkGcrsBkUUIUxiscB3eb6TYzHWMo2a+vPakTqornNJEMJCT1DnaAdKzwLO9pV6ONOQ+tPTzxH7FkpM+Q== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DM2PR07MB621; X-Microsoft-Exchange-Diagnostics: 1; DM2PR07MB621; 20:KDkh/eU6u5XpqnMo69R8Oh8OD4g1R3Jm/Nl6utn08bAWrynpgkAQP7PsahBOXbWAXQ18iLuld6rRIekZmXHP2geD+NsoM3rhc5rl6JLuoVQ1wIFTCcO4R2JbsPZEu4hM4W0Z/3OBhntVFPLG/Pl0O9Wy1hU91naJQWsABFcNgvb6Ix21APHdCD8nZPQbu07zEpFPxeQ7THPkolDH1/9JVRs5GqyidsW4Jgj3lkaQ8SMMqbX6HX0KPO6Y19ohViJ/ib6wHQCTSxhd9oWUrz6ilvQXarwo1gkPB1LEkBjrX6ar5fbi8AlVzAnAS08pi403F136DhYlpBumqHdQ8Z/dCJtVZV8d/bsuKDkhIp49dM+cahon5kcfzXfgqN7gkcOy35E4fmP4tXLXGBLXzCmw2HLv92qjL++bSOomccJpwsQhFMOfk/Cs1+fnFsleBA0v9VzEw7BHD0oKpoEBZ0CiuDto7dR2kE9F6w+jLbZE8nrinIi6ct0TFblOmK31Eg4WsMOz41kNF8ExgSmigE4w5AJU7GkB8BDSeCpDSSGpC+MV/sNmBQww+vI7tiesm316StdGEXFdPU3HLLyQ7i6kbhJnIs7pdDt3NVKtDnpVDPc= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(236414709691187); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(8121501046)(520078)(10201501046)(3002001); SRVR:DM2PR07MB621; BCL:0; PCL:0; RULEID:; SRVR:DM2PR07MB621; X-Microsoft-Exchange-Diagnostics: 1; DM2PR07MB621; 4:r1kuGhVoxaiumMkVwx8X5Ft+6aZsOpHv0QE0lZq+wyTyylmwJD8kBSvB41JZuAoGOLBW57DuSiKXkbcP44xaJNOJ/l8YYkZawE8ToBt24HWFZEnNF/pavdieOizZhg9XQR6xV6N+T4qCbCAubxAui8pjdLsuMKk8E/7CX2xPJr2qq9k5C5gM/yKChraABfnOYdugHe6+WS40hb9TQCdM15WY7OvxGsmjil5zUnKfCsdozbB4TF3zuSr6wrnfjvo1fsMv5eqgwnFX3dvTxIt1hCGC6wmMFnM1FnDmAfuvFEkE2RHYEdTYSBqqPu9Z+OOYCNCY2jvN3nQqHtniVQV+u87RKT6OZtPs2CUZQBicb/0dlYiEIUgi6h6F+AJJTn3L X-Forefront-PRVS: 0748FF9A04 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(6069001)(189002)(199003)(50986999)(97736004)(5004730100002)(33646002)(19580395003)(81156007)(5007970100001)(2201001)(5001770100001)(19580405001)(47776003)(229853001)(40100003)(105586002)(106356001)(122386002)(66066001)(50226001)(87976001)(5003940100001)(2950100001)(36756003)(77096005)(50466002)(4001430100002)(5001960100002)(189998001)(48376002)(101416001)(76176999)(42186005)(107886002)(5008740100001)(76506005)(92566002)(2101003); DIR:OUT; SFP:1101; SCL:1; SRVR:DM2PR07MB621; H:localhost; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: caviumnetworks.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM2PR07MB621; 23:lH4gNQ+q+E0hLjTNGztF3LnEYDIznugsjSXFvNC3FW?= =?us-ascii?Q?xS70XtSIYD6F7beohZxsDInsUayBwn3yx1F36gr058cVa1xoGnij0TEaCbVq?= =?us-ascii?Q?Z/pwhE6QzYnzhM/PXlLYGup5fnzftFhfnssPeX0r4dOFlV3hVsS1bYJ0du0g?= =?us-ascii?Q?2G44cxedV+zK/+i4j3Q7sCk3f0ebhhUCC6k1iOFBZ6rqi6OeGa1HvBbVsHSK?= =?us-ascii?Q?F6jg6/oJc5KVOX8NnsMteQqTeeI4+wBvVIZmPycFb3JLg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ics: 1; DM2PR07MB621; 5:i28IWpQSKZhmg9usRBny02Wnklb27qf+supnZYp2lvfXn3+nmpDzZRumRFg5/KCHmGn4fb2qQL371exRHUuf/SuT9NoQfXc6Ww51WCcueJEgIEiy4xBkutr07ttWJa48s8UwcHSHUC2oFre/+Bj4sw==; 24:+7bUorxQJ5R5En5tgEWQIHoK73ecEclj1etx8MWlF+bbmvIFfIq8jIH3s5uBYmCdej7LAICkHp/7VNjYOS93iHfsNoY9sGAHBv9n1Qp03ck=; 20:bF02grF0ROsFr4QOmDYZ3opH9tvdx6wHDxotvkc7OAddRgdMx79RZ01CBKhxA6QNF4p73pKHJJyz7zhi3L0t9Q== SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Nov 2015 23:33:45.2502 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR07MB621 X-Microsoft-Exchange-Diagnostics: 1; DM2PR07MB333; 2:JDaxrCoAyZXFTCvE3ZzZoiyps1Snht3zx/2aO1i30VAlzfoFyobZ9KFaSzgtQyZ7DBzbeJk+hpyu62rhNsw22NZlpAza+1lRaoQ3cGt7GUoxI9hrw1QCNh3k/8Req1lX3Gns5upv3ixP/xn89iClZ4MrnsEx+g9FGO/3GkEHt1A=; 23:HRaxEcwYGIbzq4OebaTibKtX9UMhzB2dWQUiCdNsQTlatD3O9Xv0b2fVsaGDggMuG4v2QhazRHIBtg6sbzAwCJXGyPKPD+x1gSRubEX1znO3dLjmHk3GBKEh+9YBc6TjOor0dXwO63ssIdEPQBEcjTfFMOSInMN/ctmtb4PYQI4Uyny7XvhjSxefLhJyUQhB X-OriginatorOrg: caviumnetworks.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151102_233448_019604_8F38F2F3 X-CRM114-Status: GOOD ( 12.68 ) X-Spam-Score: -1.9 (-) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: pinskia@gmail.com, Prasun.Kapoor@caviumnetworks.com, Nathan_Lynch@mentor.com, agraf@suse.de, klimov.linux@gmail.com, broonie@kernel.org, jan.dakinevich@gmail.com, Yury Norov , ddaney.cavm@gmail.com, bamvor.zhangjian@huawei.com, philipp.tomsich@theobroma-systems.com, andrey.konovalov@linaro.org, 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-Spam-Status: No, score=-4.2 required=5.0 tests=BAD_ENC_HEADER,BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Jan Dakinevich Signed-off-by: Yury Norov Signed-off-by: Jan Dakinevich Reviewed-by: David Daney --- arch/arm64/kernel/Makefile | 1 + arch/arm64/kernel/entry32-common.S | 37 +++++++++++++++++++++++++++++++++++++ arch/arm64/kernel/entry32.S | 29 ----------------------------- 3 files changed, 38 insertions(+), 29 deletions(-) create mode 100644 arch/arm64/kernel/entry32-common.S diff --git a/arch/arm64/kernel/Makefile b/arch/arm64/kernel/Makefile index 1470332..35a59af 100644 --- a/arch/arm64/kernel/Makefile +++ b/arch/arm64/kernel/Makefile @@ -24,6 +24,7 @@ arm64-obj-$(CONFIG_AARCH32_EL0) += sys32.o kuser32.o signal32.o \ sys_compat.o entry32.o \ ../../arm/kernel/opcodes.o arm64-obj-$(CONFIG_FUNCTION_TRACER) += ftrace.o entry-ftrace.o +arm64-obj-$(CONFIG_COMPAT) += entry32-common.o arm64-obj-$(CONFIG_MODULES) += arm64ksyms.o module.o arm64-obj-$(CONFIG_PERF_EVENTS) += perf_regs.o perf_callchain.o arm64-obj-$(CONFIG_HW_PERF_EVENTS) += perf_event.o diff --git a/arch/arm64/kernel/entry32-common.S b/arch/arm64/kernel/entry32-common.S new file mode 100644 index 0000000..2ad5912 --- /dev/null +++ b/arch/arm64/kernel/entry32-common.S @@ -0,0 +1,37 @@ +#include +#include + +#include +#include +#include +#include + +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) + diff --git a/arch/arm64/kernel/entry32.S b/arch/arm64/kernel/entry32.S index f332d5d..8026129 100644 --- a/arch/arm64/kernel/entry32.S +++ b/arch/arm64/kernel/entry32.S @@ -40,35 +40,6 @@ ENTRY(compat_sys_rt_sigreturn_wrapper) 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