From patchwork Tue Nov 17 21:16:53 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yury Norov X-Patchwork-Id: 7642421 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 23A6CBF90C for ; Tue, 17 Nov 2015 21:28:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3B46820429 for ; Tue, 17 Nov 2015 21:28:24 +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 53E5C20416 for ; Tue, 17 Nov 2015 21:28:23 +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 1Zynll-00071L-MW; Tue, 17 Nov 2015 21:26:29 +0000 Received: from mail-bl2on0062.outbound.protection.outlook.com ([65.55.169.62] helo=na01-bl2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Zyngc-0000NK-52 for linux-arm-kernel@lists.infradead.org; Tue, 17 Nov 2015 21:21:30 +0000 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Yuri.Norov@caviumnetworks.com; Received: from localhost (95.143.213.120) by BLUPR07MB611.namprd07.prod.outlook.com (10.141.207.16) with Microsoft SMTP Server (TLS) id 15.1.325.17; Tue, 17 Nov 2015 21:20:47 +0000 From: Yury Norov To: , , , Subject: [PATCH v6 13/19] arm64: ilp32: common 32-bit wrappers Date: Wed, 18 Nov 2015 00:16:53 +0300 Message-ID: <1447795019-30176-14-git-send-email-ynorov@caviumnetworks.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1447795019-30176-1-git-send-email-ynorov@caviumnetworks.com> References: <1447795019-30176-1-git-send-email-ynorov@caviumnetworks.com> MIME-Version: 1.0 X-Originating-IP: [95.143.213.120] X-ClientProxiedBy: AM3PR01CA037.eurprd01.prod.exchangelabs.com (10.141.191.27) To BLUPR07MB611.namprd07.prod.outlook.com (10.141.207.16) X-Microsoft-Exchange-Diagnostics: 1; BLUPR07MB611; 2:ATMotpiJUav14VgUqWWMjyP74wbvB0380a3se/ycvx+H1k3W2p+H2qTG9HZFaIra0ECJK/fKdOEacgB+W6iKfgohMdOUlmOEvi1dmLMkj/s75TRjQZ40PUisiuwp6PSNey8uttWR2wwyObenQyXeXg1l0WnfOoZ0wNWvyqBSMyA=; 3:Oer0eEcfJ1UtSvW6IcHGTkxhy+m0U0W/bkkvlua9s3NXMt5vAHB4bUTichKLK0z2uHU1T3yWOLT2AwJFChVdCIdwl61Gen5h7q4awkV/HB1x5UbeEXaab2yX28iUgbFeO9B72JrOX1xs+IDpiF2Xzg==; 25:ldgiymkvdxCaNolfdxb/nibN/wJoWCDcSKP6lNAuSv2Df1drd/GrwOtlJg98jlykkBCyBesrKpesUjElBEq3vPYVavfZNlzaN97jFyBvxeeidEPqAzkV+R0kqmEzFDTxYPUdT7PvxRcebrPMv96K0yc8scGYAQm8Gx6fM/9jVj9iSbCV4EAXDJDeKkKaGgMkJfNKAymlreW5WFPr2zW65lckgWKYIYgM8iLZp0pYbZrteO4LeUKx1LBQ78NOI4Y7JfCYyOV8jhFpNPE++FY3WQ== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR07MB611; X-Microsoft-Exchange-Diagnostics: 1; BLUPR07MB611; 20:GYNsC5t0PjvYUhH0Cb4t3sXN0y3Kj+l7IUZJ1AkbAyVuou6bC2+hu7n6KLShiH8QrsH/0n4nYXerWbR6QDwl7NmseEJm6sn99EIpyCicEhjnOx2m6zUUeNNE1r1PA6hUukExvQ0dnNoArBbpygPuYOgPOtmoY6Tt3PLLRzg0KzA86kHJriDsz0PFmSezjvGX2HR0ek1pzbE56nBmOovQK0BI7DUcqz0J+TkidW/bbBMcUHmNLTn94f1GmJYqJzAk4oUR/soK06GFXP/VXpq3QNfNuByWPEcjZQi6JHnHwD0jUeDvoabldZ6iu6/BpC4XWGOk+6Tkdz0OvHKHk2mQNtG7LBLKK976GPLOJ88Rt7V3DtIy3p3RojD9ZNM8E3XwDElUgKzKAFj6SbfCIJPy69UGi8AGX1Qc8NWycOuToYc8hCfq/a2k5t92QEzuLBFhjdnasT+r/wX0h9PqDKc9ABfP7TEcX+n3pDmjmkD3536yP1WYx7RJbtWf/xNieHAjniHpK7Bb8h0xW6M6MkYis5pp/PRXCVb9co0f43R++5SLYe/h3mtpyCanf/dwOysoWB7TsHIYasjR+c7IVi3TFWvuTQFFArzm8FuYnJsVdgw= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(236414709691187); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(8121501046)(520078)(5005006)(3002001)(10201501046); SRVR:BLUPR07MB611; BCL:0; PCL:0; RULEID:; SRVR:BLUPR07MB611; X-Microsoft-Exchange-Diagnostics: 1; BLUPR07MB611; 4:8AkvaDsP2lGYTHyrzURb6ctgTE3WSJpUEdK+a+HdtQ6CX2SHuAZPwrvVqPKNsKRJ4Zqfv/ygqMOChXy53eHwKmvqkQ6cxfFsxwlmwuH/BjUNC4SfL52k0WJUuliRrp1sODdsG11UJm50E8EieU/aEczDSV68EC+CHF6vGqsfpoTFf5/XE3n/pUfLk9OnoN1InO0BJ4NXOmsaAMi+mDn6tSUKn32fGhI4cRS1ZSbO15JAb/XBoDF5DrfpQy+VcpSMzlttxUbM4aI035c/mfYXfI6Zr9dNgZRrxEFOIV1vhYVfma7yNYUw/fS/CLtwP3UEZPIryYSjCgbjwVl5NXcP5zM7346nzKcWy1Q3amAiUk2QFsPdkSepzsew8G0xifcP X-Forefront-PRVS: 07630F72AD X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(6069001)(199003)(189002)(33646002)(42186005)(5008740100001)(40100003)(50986999)(5007970100001)(586003)(66066001)(76176999)(122386002)(189998001)(47776003)(36756003)(2950100001)(50466002)(5003940100001)(4001430100002)(5004730100002)(105586002)(106356001)(229853001)(48376002)(97736004)(19580405001)(87976001)(50226001)(19580395003)(5001770100001)(2201001)(92566002)(101416001)(107886002)(5001920100001)(81156007)(5001960100002)(77096005)(76506005)(2101003); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR07MB611; H:localhost; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX: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; BLUPR07MB611; 23:aotUl965aqnTszoLFU1pkcwY+eYeW2c12AjrfL6Plw?= =?us-ascii?Q?ChZ5JORAi+P9NUvebr1zXr/AcICyVZbq7Ivf/mF6R6d/GbfutW6DzXS0tFn/?= =?us-ascii?Q?RVd9QbE9QiqJZW+lRz6RTFl+Y7HerdKZnrQIuuLI2XDbQGHHEvib4ME0eRBm?= =?us-ascii?Q?AeGsOkH8E8wQKFZzLjCkd1yn1I5cCk1370433AfC4cGKHgUv3qsXLnpXMNlB?= =?us-ascii?Q?aqDaPw/cbjqls2mkjpIV+LRYhWvBzn3EtoNoAsbMyusYUxjmXTTrgJ7dRhf2?= =?us-ascii?Q?mVp5ADf9bUxEOTxbhskdyTtI/4swrJWur3A1uJonVFc5hBxd7YtpIGfhdmcO?= =?us-ascii?Q?ofGGU15vfuwGO3/M9cYCsQU0TXwzmo3d65M2Zd4XuYPpc7PdUlC3C+YED7PZ?= =?us-ascii?Q?B9XsMuHGYl+Ybb3vQrHuf4tN3mJSSPL2R7m035vmWTXP1s9nDZK4rtFnjkdg?= =?us-ascii?Q?kSGwGaXyJX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3CJ0sxudwIxr+6cjBBsbn3gXGjwRlZTeR2tbpfgmqpR6eWHoLnAoetGOyR1IFnCeVg=; 20:ScLJnK1lWlC96LxSaVUsoVBwAgfXW0VLP/+pVSvMnboUJwNCzqCkYTJRmu5mWmvGrWBAfaSfVEH7A9zABqubwA== SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Nov 2015 21:20:47.4908 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR07MB611 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151117_132110_904922_147B60C1 X-CRM114-Status: GOOD ( 10.91 ) 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, schwab@suse.de, 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, joseph@codesourcery.com, 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.8 required=5.0 tests=BAD_ENC_HEADER,BAYES_00, RCVD_IN_DNSWL_MED, 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 Reviewed-by: David Daney Signed-off-by: Yury Norov Signed-off-by: Jan Dakinevich --- 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