From patchwork Mon Jan 9 11:29:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yury Norov X-Patchwork-Id: 9504441 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 B76C26071A for ; Mon, 9 Jan 2017 11:34:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B0918283F3 for ; Mon, 9 Jan 2017 11:34:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A50E82848D; Mon, 9 Jan 2017 11:34:00 +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=-4.1 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id DB6FF283F3 for ; Mon, 9 Jan 2017 11:33:59 +0000 (UTC) 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 1cQYD7-0005Km-Cr; Mon, 09 Jan 2017 11:33:57 +0000 Received: from mail-by2nam03on0056.outbound.protection.outlook.com ([104.47.42.56] helo=NAM03-BY2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cQYD2-00059N-9r for linux-arm-kernel@lists.infradead.org; Mon, 09 Jan 2017 11:33:54 +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=ELf0yH8nUZaXd9HKZRV+cfMFm5V7wryoqmtIURJAFe0=; b=AlBgw0BQkocSakfZ8M1Ko4a7A39ltFpIliXqFKdQpuj9zXLARCZ9u9+JtX71tZJjNOOCAh/JsMBiZGZ6ucId3Cm4LeJr9VK0QFRZlrpQlb6iICLBI/LjlGJxueJCQYHw3bq9/HNyK9PH5Gu5n84b20GY52Ts9gy1SeQxkhIV+ds= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Yuri.Norov@caviumnetworks.com; Received: from localhost (103.78.20.242) by CY1PR07MB2247.namprd07.prod.outlook.com (10.164.112.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.829.7; Mon, 9 Jan 2017 11:33:29 +0000 From: Yury Norov To: , , , "linux-arch @ vger . kernel . org Arnd Bergmann" , Catalin Marinas Subject: [PATCH 13/20] arm64: ilp32: share aarch32 syscall handlers Date: Mon, 9 Jan 2017 16:59:50 +0530 Message-ID: <1483961397-8599-14-git-send-email-ynorov@caviumnetworks.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1483961397-8599-1-git-send-email-ynorov@caviumnetworks.com> References: <1483961397-8599-1-git-send-email-ynorov@caviumnetworks.com> MIME-Version: 1.0 X-Originating-IP: [103.78.20.242] X-ClientProxiedBy: AM5PR0101CA0003.eurprd01.prod.exchangelabs.com (10.169.240.13) To CY1PR07MB2247.namprd07.prod.outlook.com (10.164.112.149) X-MS-Office365-Filtering-Correlation-Id: 801bade5-49e1-429d-374b-08d43883560e X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:CY1PR07MB2247; X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2247; 3:PTMnWp0lYfLAfjWv7iBU/+25RPz4+nBpdp5HosiQw/N5A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-Test: UriScan:(250305191791016)(180628864354917)(22074186197030); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(6041248)(20161123562025)(20161123555025)(20161123564025)(20161123560025)(6072148); SRVR:CY1PR07MB2247; BCL:0; PCL:0; RULEID:; SRVR:CY1PR07MB2247; X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2247; 4:eWKgydZUxOjblD7VaaVF0kzbMO8QXT6jQ0GiQebVbk92WvYWGpPzcmHXv033tPE3Hi/HRaNvW4faTb3YsZeDsO/6DP4WXHLZh+zavG9LD7uxpSGL1rfbnPjTE03eENfja8b53ErlBY9tyL/uc1RbQfMbY7l8VvXjEv3JXxoApHlP9Jtj7P2qoD0VabQB2O5/40QW27G4sgZhKzjZlJw9ZqQDWv9vTCwDS+vwBFCPyRhOuFtZWBPENfD3iH8ecqtjetq3IYcSMY9Hb9uea3YeBSzJUPHIZel91d4QpwL5Gj0t5cvIZF5WtVQgiWGFIZHzIZbfI5Uy4GAbyaD8L1EgEaBLl4b1yaRw5ybjMDWpnnowyCk/QbU1XWjZdfMyRKPdrP+X4/DfsmUpEepyhpFuhTuX3K+olec/OpZuHm1ZpkVgsmeY0nL3fKcmRpcCAzRVFmG4sdorwfOW58WotYIqzmb6GVMITLI/w1EK6K6L7WSLl1coOeeDiHqVTnyKN7UtEd6BQHV+xGd5+cNL+NeR4M8GazvZOBiIOuZ4YzayDaMgiLuqFy2NXeb6XAerEBil0oqTEStQuhmFOiLqk6CT/GATKQgqnDXTFWOGm2osT83ohUClUnNkxydeqG+uhe6sJTFumfXmJ/v/E8kMH4SumriUj8BLvkX3/QZxog5pGBs/MHTpLVP2MfmqiYMJm9me X-Forefront-PRVS: 0182DBBB05 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6069001)(6009001)(7916002)(39450400003)(189002)(199003)(76176999)(42186005)(5003940100001)(6666003)(92566002)(101416001)(50986999)(33646002)(189998001)(2201001)(2950100002)(76506005)(48376002)(66066001)(3846002)(6486002)(6116002)(47776003)(6496003)(36756003)(305945005)(2906002)(68736007)(7736002)(25786008)(4326007)(6306002)(54906002)(105586002)(106356001)(5001770100001)(81166006)(38730400001)(8676002)(97736004)(81156014)(7416002)(50466002)(50226002)(5660300001)(39060400001)(2004002)(2101003); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR07MB2247; 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; CY1PR07MB2247; 23:v2O964aDMB5E7CBRYRoHDISyaeG6brsHWGJrP+aTh?= =?us-ascii?Q?TJ5RHJP+XNd/xubiBE1PbdPretIqC3bkK/oJXRaZQyjSZ6IMbmqEU+AoKHD4?= =?us-ascii?Q?WAEhDeW44RPkPyTIwYGcavICfT2C0G+fnmS9P/95jcI5TQ16YN1F7hmuPwOh?= =?us-ascii?Q?19aXBb31lvPWi3UtIjD133SW7mB/R8YNF239tG+dezKqYc31WWZWVQJyTcy+?= =?us-ascii?Q?qfWbzWR7iaC817xYHDxt4fyFY+IYXaer9XCsQzNTnPM33GTK4ma/KbiiA5Lb?= =?us-ascii?Q?IbGHQpnDmVyyzbAr5BYzJ0OHieRWM8vxSL7NpTuVP0eTliP2YgYEvWRes7Xx?= =?us-ascii?Q?elIea3+bVgZAkPEQwb+mMJifAYsHtAFiJKeTn0FakynCNzKQkYOIgCwBfqsy?= =?us-ascii?Q?nJyjJTOZOLN4N3Gnhd+DLvR8sm5iiNFCsuOiNySZVUfe8CIoAVMRH+x1k2nI?= =?us-ascii?Q?Nc2ChxOX8Rn745Uz5wX0+z6J4RQDWcNd6yM/qkDoImrDTLRKrGTRnkDw1X3V?= =?us-ascii?Q?8yNDfYMwiFAfzgNZLignQl1uE/j8dOzYX2epz3YzZECmieQPoJ1+p26mW8/Y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F24r24zICZcVv4+m8Y/BqqYwSsLrfsDHstAQCFA/BBtiBGGp6e32r84BxCEhV0BG9vujW0jNkeBcoBJdti3dEeYSCbp+GCVGNIEfmqsUzYWgmej+e/rGXxEJVUsh2Nf3T9gt74cs22SsYQu9zXdW+za63KWhzYWhqwoSSbJv/pFHCZ7XMVN6K+dfuJ+THOjs0=; 5:I7Rud2L93V8AywPa98Y8V0HT8otQDDAmeeLxv7PD9EIleclUZ202wOuGQoZ+ThScUujCGQbF8yqtPLskuHCJxdY8ARNBntM/LhKPTVRaig8qaXx1l5g680oSk9F73fxCyzCpx3t1IFkDJVouqaKYkQ==; 24:s8DEnKhxQvqT3/K6DWxKINn9sJeJQt4U/AEz6TE/6SFYHDXFbi/f9BRG+MsDf1K892UqvCbSP4rAH3OUEDcsqYdr1CZVnriiYBqS0fj35pw= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2247; 7:p98TutD92GlNtyqWT3uNXk8FiW+r9cvP5Il198o/EhYhGIERS4s9Q3A7jajROjrRHiHNe3tQMdEkkT4pckmk23dSoGINw1IHGgbCqGOMkpIIN3q66EnrKfHN8bJt+tBXqZS0OGIqHfj6Doa2m5jQKt3S/uLSgDrKJg0hpoqIdQlH+9tWP1QTu/cJ6v5id82RbeUGQ9IDvBGb30zqNSS4Rr6Lcm83SooDI71xi7n8x8dCndxnOwz7abopeQKY2u9OwyoeHyBRnbwIPgz8fJPLxaUVeD7w5UDU4DXM8ROA8sNzD3P4iTeuYS//S9DpSWf0bg4cqVbfMlbUCtQytBF7g1BBq8qUORSWWFcCFYy0pw+UZJ4TM0X+g/2vQ6CKr9Mj2fwmcPZHY4I8C5/7WYdC8xfe8EGnQ4/4N2JgoeTbjlA8QGQh5tBuowed2PPySJAng5oPopdMDpbkyxOrEA+d2Q== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jan 2017 11:33:29.3379 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR07MB2247 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170109_033352_400710_BC26BC1D X-CRM114-Status: GOOD ( 12.10 ) 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 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 f661888..9123bb8 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 f332d5d..4bede03 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 0000000..f4a5e4d --- /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)