From patchwork Fri Jun 17 23:54:23 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yury Norov X-Patchwork-Id: 9185231 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 50916601C0 for ; Sat, 18 Jun 2016 00:00:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3BD4F27EE2 for ; Sat, 18 Jun 2016 00:00:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 304822833B; Sat, 18 Jun 2016 00:00:39 +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 AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7BE8F27EE2 for ; Sat, 18 Jun 2016 00:00:38 +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 1bE3f3-0005ou-Qb; Fri, 17 Jun 2016 23:58:53 +0000 Received: from mail-bl2on0089.outbound.protection.outlook.com ([65.55.169.89] helo=na01-bl2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1bE3cI-0001mU-B4 for linux-arm-kernel@lists.infradead.org; Fri, 17 Jun 2016 23:56:07 +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=/R4h9LNs2MHndJaoxFeRpEXuCzk1fbTQkOGpdc0EmIU=; b=APi7+5Wlh7R4nyKeEj6Miy0ucI/bHxFluyuaUieOsi6cuO/S0pRGFlBzuGEAyJst3cCpq+awVhCUlbSJiraDq5FO3yL/rh5/B0IqLDLG42Tf0CLL3b6OQ9IGPJ6/GYYcGF3bzmUn3bvw4HgzlOTsf0AMIcdPFlV42+35PEFZHTo= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Yuri.Norov@caviumnetworks.com; Received: from localhost (50.233.148.158) by BN4PR07MB2241.namprd07.prod.outlook.com (10.164.63.147) with Microsoft SMTP Server (TLS) id 15.1.523.12; Fri, 17 Jun 2016 23:55:39 +0000 From: Yury Norov To: , , , , , , Subject: [PATCH 14/19] arm64: ilp32: add sys_ilp32.c and a separate table (in entry.S) to use it Date: Sat, 18 Jun 2016 02:54:23 +0300 Message-ID: <1466207668-10549-15-git-send-email-ynorov@caviumnetworks.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1466207668-10549-1-git-send-email-ynorov@caviumnetworks.com> References: <1466207668-10549-1-git-send-email-ynorov@caviumnetworks.com> MIME-Version: 1.0 X-Originating-IP: [50.233.148.158] X-ClientProxiedBy: CY1PR04CA0041.namprd04.prod.outlook.com (10.166.187.51) To BN4PR07MB2241.namprd07.prod.outlook.com (10.164.63.147) X-MS-Office365-Filtering-Correlation-Id: ff133458-ef06-4bb6-d852-08d3970ae2da X-Microsoft-Exchange-Diagnostics: 1; BN4PR07MB2241; 2:bmlVP3dFqKe4px/qEdMkVDu2GsG2bIHWHQt8hzqRwNvklEsxTVSeodhFmfMM5M/KHW6/ckM62btpzPyDgW8nVdy+w1RYCEIB05XggZ/PMM84wbHajobVAv98sf4c5buOLBx0MHs5x6fH25pFGEtdEL9gCtlp05vJlcu3ecB/5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MCeDal3lH2D9/5Rxg0T0ys7DAcFq4DkKso0t9aPEfb07R2Qg4oGjgRVVHKbB9DJS+U2GTJ6a4Ptxb74mSs6/7eQTq0XNhUINCzehBnDgzlMiM4JF9z3tkynsV8vOnYC5p8+0gp6s61d931KN0v18bFsUTGfHPoUDYW7ZljTNJ1QDWYq4S0fZTCDzpy459ykdFseNWCa9Xc9HzJTM9oL+CPS8ilijtTqafo= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(250305191791016)(22074186197030); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001); SRVR:BN4PR07MB2241; BCL:0; PCL:0; RULEID:; SRVR:BN4PR07MB2241; X-Microsoft-Exchange-Diagnostics: 1; BN4PR07MB2241; 4:+r/b9saP4BSrHiEw4aFLqAMzw8Rf4jl+dXjpbi4agZPETlefwBl6plOQkQ/+NrDkMKCX89H9lQCQl2WYPlCKdksKxMMn3c+m5O0ftSGmmr+RjXWnFe3YTGPqvVIPk2j153aPn3tzORIEEAAb7DL/B8lcna1+yVrJalMzmlV94GKaRV+CqXvVZwtDbwHESRN7IDlzFPP2uXTR7FbNtp91M1yV2TOMogY9y6mhUxSaEZk5f9bIK7JD4qfKfPuZ1aAm9QKTFyLVZPlKcXNXnpCqbHu1/6ntT+LishSFRssPgvNDWQONGSzPzW5fwvGiz3G+wss4BkhSWsjevnJqCWHzxM4MyDkVIBp4bTZha+88G6D+bfQPm11bxqkw5pdfeVXv2M54hXO2JOWxCCeNFUp4TkOKFGMy42EiZleJS/8RChkZ9VHX66JexVYMa3bzk5lq X-Forefront-PRVS: 09760A0505 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6069001)(6009001)(7916002)(189002)(199003)(77096005)(105586002)(50226002)(42186005)(106356001)(76506005)(68736007)(36756003)(5003940100001)(47776003)(4326007)(50466002)(19580395003)(19580405001)(229853001)(66066001)(2950100001)(586003)(7846002)(15975445007)(6116002)(3846002)(76176999)(50986999)(97736004)(189998001)(33646002)(5004730100002)(92566002)(48376002)(2201001)(2906002)(5001770100001)(8676002)(101416001)(107886002)(4001430100002)(81156014)(81166006)(2004002)(2101003); DIR:OUT; SFP:1101; SCL:1; SRVR:BN4PR07MB2241; 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; BN4PR07MB2241; 23:PAvfzvu9E+JI6BnuevaHLg2mqBxs//UCMpvUiLv3M?= =?us-ascii?Q?Pq9P6R+AhD4BXsoVIZTcWAM2r0bK2qYUFlYYrA4eVy2Gf0CsR/Gn47EQRlal?= =?us-ascii?Q?m+TGfCSwpcYHmEmduglcVrTQo2fVJXPpPkXrUwX6CtvHRL41SJb6SNpj3IM2?= =?us-ascii?Q?NwSkJWBT6ju8K1dkKmnnMRqh6RdvZDJpClXp4qbXMWCfL1vWHEJtKW8gaZV9?= =?us-ascii?Q?zSm97N9hBAkhn5vWolIpLjqPVr4ukvRMUHKIBtpDGjOHSdlUUlWk1AqnCM29?= =?us-ascii?Q?mWCY9092YpjCXs+pvgc/Z1pyjvggRzb7D1sdVEU2TczdpeRI7YWIe6B83/oT?= =?us-ascii?Q?jAPW8OWj9R3yhcRNE7dj/KiEvxQeudtSO6TG8GKynyEcFkzI1OoTJyGeW+1+?= =?us-ascii?Q?6keRIU+LwOvtxRisd6Y1UXbN7Cocsbo0xzH0mGqEZVcFeN9rOtstA1gyrIbk?= =?us-ascii?Q?CfuqEmxukjx1RW+elm84CX6H1x+BcHTK234SEXYMppG4eiNn8/j23mL7rcmf?= =?us-ascii?Q?ibPpfTbsZzlDEnklJjlpuD3KXUrbcLwz61nxnYYbbmQcSK9W52xwkK9FuYKO?= =?us-ascii?Q?h/0g1JwiPuWGMV91UxVSfjFDoSKSxii4+p0DmZg0M9O0n07lPW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jlNfixEXV8IOVfV/vhQEWXPdJ95BegPCATCIKJNXHCZtrX8pRtxpvjXNqRzI5g/mmpbJGBtNYDIX16Oc/UmgUc7Wdnmcajb8/0vbym/OEOsLfQks/tEY0pved4w7/uQkVN4fOuNcFUEzfv2LgzSw==; 24:WfanCqvKcL96GorK5FATGLqQzGX1AXtA4RS+1U0mCsD4ULDOoz7WPAf8f7fgf4nLmm3isGw03yn02yqvGC8p3RZt2BRWLonCibW7rcmJv6k=; 7:kf7lReRh+/nwoz2dunPi3LEnxX4HzW+wTfiQpYGzoIuVqenaId16fh9t+3AInCQMQhFyy9fIH2WJ5rEInEPlRPJPOWljqflba0Q+nNhvXQmMz/TSBAxki2i0PelLo1lQlHLUXU3yUoL1C/397aKwaPLkqo87fmykXft3zyewk2dfVwr2A0CByLd3wucJ8KeOZRSt6Qv6s/Qhb317wXd6QyfT4sDvMDzPSMkk14NYhbhc2d2uDUXvcJ+uAO2vNJfc SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jun 2016 23:55:39.8780 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN4PR07MB2241 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160617_165603_133945_6B291201 X-CRM114-Status: GOOD ( 14.26 ) 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: szabolcs.nagy@arm.com, heiko.carstens@de.ibm.com, ynorov@caviumnetworks.com, philipp.tomsich@theobroma-systems.com, joseph@codesourcery.com, Prasun.Kapoor@caviumnetworks.com, agraf@suse.de, Andrew Pinski , geert@linux-m68k.org, kilobyte@angband.pl, manuel.montezelo@gmail.com, pinskia@gmail.com, linyongting@huawei.com, klimov.linux@gmail.com, broonie@kernel.org, bamvor.zhangjian@huawei.com, maxim.kuvyrkov@linaro.org, Nathan_Lynch@mentor.com, Andrew Pinski , 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 From: Andrew Pinski Add a separate syscall-table for ILP32, which dispatches either to native LP64 system call implementation or to compat-syscalls, as appropriate. Signed-off-by: Andrew Pinski Signed-off-by: Yury Norov --- arch/arm64/include/asm/unistd.h | 6 ++- arch/arm64/kernel/Makefile | 2 +- arch/arm64/kernel/entry.S | 29 +++++++++++++- arch/arm64/kernel/sys_ilp32.c | 84 +++++++++++++++++++++++++++++++++++++++++ 4 files changed, 117 insertions(+), 4 deletions(-) create mode 100644 arch/arm64/kernel/sys_ilp32.c diff --git a/arch/arm64/include/asm/unistd.h b/arch/arm64/include/asm/unistd.h index fe9d6c1..250654c 100644 --- a/arch/arm64/include/asm/unistd.h +++ b/arch/arm64/include/asm/unistd.h @@ -13,13 +13,17 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ + +#ifdef CONFIG_COMPAT +#define __ARCH_WANT_SYS_LLSEEK +#endif + #ifdef CONFIG_AARCH32_EL0 #define __ARCH_WANT_COMPAT_SYS_GETDENTS64 #define __ARCH_WANT_COMPAT_STAT64 #define __ARCH_WANT_SYS_GETHOSTNAME #define __ARCH_WANT_SYS_PAUSE #define __ARCH_WANT_SYS_GETPGRP -#define __ARCH_WANT_SYS_LLSEEK #define __ARCH_WANT_SYS_NICE #define __ARCH_WANT_SYS_SIGPENDING #define __ARCH_WANT_SYS_SIGPROCMASK diff --git a/arch/arm64/kernel/Makefile b/arch/arm64/kernel/Makefile index d11572d..205bc03 100644 --- a/arch/arm64/kernel/Makefile +++ b/arch/arm64/kernel/Makefile @@ -28,7 +28,7 @@ $(obj)/%.stub.o: $(obj)/%.o FORCE arm64-obj-$(CONFIG_AARCH32_EL0) += sys32.o kuser32.o signal32.o \ sys_compat.o entry32.o \ ../../arm/kernel/opcodes.o binfmt_elf32.o -arm64-obj-$(CONFIG_ARM64_ILP32) += binfmt_ilp32.o +arm64-obj-$(CONFIG_ARM64_ILP32) += binfmt_ilp32.o sys_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 diff --git a/arch/arm64/kernel/entry.S b/arch/arm64/kernel/entry.S index 21a0624..b2b9725 100644 --- a/arch/arm64/kernel/entry.S +++ b/arch/arm64/kernel/entry.S @@ -239,6 +239,23 @@ tsk .req x28 // current thread_info .text +#ifdef CONFIG_ARM64_ILP32 +/* + * AARCH64/ILP32. Zero top halves of x0-x7 + * registers as userspace may put garbage there. + */ + .macro delouse_input_regs + mov w0, w0 + mov w1, w1 + mov w2, w2 + mov w3, w3 + mov w4, w4 + mov w5, w5 + mov w6, w6 + mov w7, w7 + .endm +#endif + /* * Exception vectors. */ @@ -501,6 +518,7 @@ el0_svc_compat: * AArch32 syscall handling */ adrp stbl, compat_sys_call_table // load compat syscall table pointer + ldr x16, [tsk, #TI_FLAGS] uxtw scno, w7 // syscall number in w7 (r7) mov sc_nr, #__NR_compat_syscalls b el0_svc_naked @@ -717,15 +735,22 @@ ENDPROC(ret_from_fork) .align 6 el0_svc: adrp stbl, sys_call_table // load syscall table pointer + ldr x16, [tsk, #TI_FLAGS] uxtw scno, w8 // syscall number in w8 mov sc_nr, #__NR_syscalls +#ifdef CONFIG_ARM64_ILP32 + adrp x17, sys_call_ilp32_table // load ilp32 syscall table pointer + tst x16, #_TIF_32BIT_AARCH64 + b.eq el0_svc_naked // We are using LP64 syscall table + mov stbl, x17 // We are using ILP32 syscall table + delouse_input_regs +#endif el0_svc_naked: // compat entry point stp x0, scno, [sp, #S_ORIG_X0] // save the original x0 and syscall number enable_dbg_and_irq ct_user_exit 1 - ldr x16, [tsk, #TI_FLAGS] // check for syscall hooks - tst x16, #_TIF_SYSCALL_WORK + tst x16, #_TIF_SYSCALL_WORK // check for syscall hooks b.ne __sys_trace cmp scno, sc_nr // check upper syscall limit b.hs ni_sys diff --git a/arch/arm64/kernel/sys_ilp32.c b/arch/arm64/kernel/sys_ilp32.c new file mode 100644 index 0000000..00c4d4b --- /dev/null +++ b/arch/arm64/kernel/sys_ilp32.c @@ -0,0 +1,84 @@ +/* + * AArch64- ILP32 specific system calls implementation + * + * Copyright (C) 2016 Cavium Inc. + * Author: Andrew Pinski + * + * 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 . + */ + +#define __SYSCALL_COMPAT + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* + * Using aarch32 syscall handlerss where off_t is passed. + */ +#define compat_sys_fadvise64_64 compat_sys_fadvise64_64_wrapper +#define compat_sys_fallocate compat_sys_fallocate_wrapper +#define compat_sys_fcntl64 sys_fcntl +#define compat_sys_ftruncate64 compat_sys_ftruncate64_wrapper +#define compat_sys_pread64 compat_sys_pread64_wrapper +#define compat_sys_pwrite64 compat_sys_pwrite64_wrapper +#define compat_sys_readahead compat_sys_readahead_wrapper +#define compat_sys_shmat sys_shmat +#define compat_sys_sync_file_range compat_sys_sync_file_range2_wrapper +#define compat_sys_truncate64 compat_sys_truncate64_wrapper +#define sys_mmap2 compat_sys_mmap2_wrapper +#define sys_ptrace compat_sys_ptrace + +/* + * Use non-compat syscall handlerss where stat and statfs structure + * pointers are passed, as their layout is identical to LP64. + */ +#define compat_sys_fstatfs64 sys_fstatfs +#define compat_sys_statfs64 sys_statfs +#define sys_fstat64 sys_newfstat +#define sys_fstatat64 sys_newfstatat + +asmlinkage long compat_sys_fadvise64_64_wrapper(void); +asmlinkage long compat_sys_fallocate_wrapper(void); +asmlinkage long compat_sys_ftruncate64_wrapper(void); +asmlinkage long compat_sys_mmap2_wrapper(void); +asmlinkage long compat_sys_pread64_wrapper(void); +asmlinkage long compat_sys_pwrite64_wrapper(void); +asmlinkage long compat_sys_readahead_wrapper(void); +asmlinkage long compat_sys_sync_file_range2_wrapper(void); +asmlinkage long compat_sys_truncate64_wrapper(void); + +asmlinkage long ilp32_sys_rt_sigreturn_wrapper(void); +#define compat_sys_rt_sigreturn ilp32_sys_rt_sigreturn_wrapper + +#include + +#undef __SYSCALL +#define __SYSCALL(nr, sym) [nr] = sym, + +/* + * The sys_call_ilp32_table array must be 4K aligned to be accessible from + * kernel/entry.S. + */ +void *sys_call_ilp32_table[__NR_syscalls] __aligned(4096) = { + [0 ... __NR_syscalls - 1] = sys_ni_syscall, +#include +};