Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1032799AbbKENvT (ORCPT ); Thu, 5 Nov 2015 08:51:19 -0500 Received: from mout.kundenserver.de ([212.227.126.131]:58069 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030850AbbKENvR (ORCPT ); Thu, 5 Nov 2015 08:51:17 -0500 From: Arnd Bergmann To: Yury Norov Cc: catalin.marinas@arm.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, pinskia@gmail.com, ddaney.cavm@gmail.com, jan.dakinevich@gmail.com, Prasun.Kapoor@caviumnetworks.com, christoph.muellner@theobroma-systems.com, philipp.tomsich@theobroma-systems.com, broonie@kernel.org, andrey.konovalov@linaro.org, Nathan_Lynch@mentor.com, agraf@suse.de, bamvor.zhangjian@huawei.com, klimov.linux@gmail.com, Andrew Pinski , Andrew Pinski Subject: Re: [PATCH v6 13/17] arm64:ilp32: add sys_ilp32.c and a separate table (in entry.S) to use it Date: Thu, 05 Nov 2015 14:50:10 +0100 Message-ID: <48925827.N0Xfqtb3JD@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: <1446507046-24604-14-git-send-email-ynorov@caviumnetworks.com> References: <1446507046-24604-1-git-send-email-ynorov@caviumnetworks.com> <1446507046-24604-14-git-send-email-ynorov@caviumnetworks.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:AyiUphIL8kexLKMyW0EgLq7TNmUGdxsRcSnhqGuiwKJ8fNrhDIb iHSyPVeukMy9BG9D/FvSQAXHNgeKSBX9CaunR8U+xGIue3+T/gzGS/lJUbMbiKBtnn6tk1A bG8wWRDfLEHMoNPFFWckMwpwTU1og5U0+q8EI6nPPf2emsu9r3H3DYqKzfrPPHSSE9Pp8Sy /iKpZDb7dl08nOvkxkwwg== X-UI-Out-Filterresults: notjunk:1;V01:K0:IM2D138KsDM=:/JrW3yGHjmquIP5QxvSxN9 4KuOOjZKwTcaNN5Me3iC9uMf+VizDQCm8QZ9nt77VAZlVsNdchFvRmbNAB+D+KaFLjowFxm+r D1VkZwWLWxl0z1nKK1vltePwjmtnG7+0na1PWvfLe/jQB/AbVd37i/Z7zHgH2GMK4YwkTPZ0H bIzU/VrPIBEh0QNU0GrGf0/hepa3ypxJbSMRuZOblgxQsSycQ/MfucFSKmzuV7YlITO+RrjYr wb5P5b+dcUOx7mRBrnp2lREFA8SxuuTzlOa28SeTLoLWzfTA21IbNIk2k0K8QdhkqH1r+bPPw q3ovk58ripS8xtM8pl4OGxMhUvb0wU3M0Tj6/ulK1K+nAGhahWzxQ6NP4DZwj2N4WbsRzvdPb I6glm446BYX3Jbaeui6mv+cGQrr2krqqR6abR0Xd5GZLLjbHjhAsIFkzTRvfg6Vcc/4Yv7kUm lXG7WE567yvnrENeT4IudHAvyS6z0aiHldg/xe/L2Y7irhI0guFctnAugrDa32CqyQ2af2l/E G+/XKaIrwtOAxS/URWJqm8/PxErc05FdwvmRy0UptNHXoKGXooa79Sp/JNbrQ9aJMIg1vM0fZ vmOjbWnWAKr//rRySeLW+M1PdPrfsALFj+1n7hfXv7Y4HRNS4ElWilWgXAapSaTtco1khkZ49 20FSxQ4zQi9xUe1c03kkPeMS836rFGLq8LYgrrVZ+QOpvOSyK1Og2RHe8JB64XGqAHHL/Z8Ks vtmUn+fq8EeDXwAw Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1886 Lines: 49 On Tuesday 03 November 2015 02:30:42 Yury Norov wrote: > 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. The uapi/asm-generic/unistd.h already contains a list of compat syscalls that should work by default, I think it would be better to use that list and override only the ones that differ between normal compat mode and the new mode, e.g. when you require a wrapper or want to use the native syscall entry. > +/* We need to make sure the pointer gets copied correctly. */ > +asmlinkage long ilp32_sys_mq_notify(mqd_t mqdes, const struct sigevent __user *u_notification) > +{ > + struct sigevent __user *p = NULL; > + if (u_notification) { > + struct sigevent n; > + p = compat_alloc_user_space(sizeof(*p)); > + if (copy_from_user(&n, u_notification, sizeof(*p))) > + return -EFAULT; > + if (n.sigev_notify == SIGEV_THREAD) > + n.sigev_value.sival_ptr = compat_ptr((uintptr_t)n.sigev_value.sival_ptr); > + if (copy_to_user(p, &n, sizeof(*p))) > + return -EFAULT; > + } > + return sys_mq_notify(mqdes, p); > +} Could this be avoided by defining sigval_t in a way that is compatible? > +/* sigevent contains sigval_t which is now 64bit always > + but need special handling due to padding for SIGEV_THREAD. */ > +#define sys_mq_notify ilp32_sys_mq_notify > + > +/* sigaltstack needs some special handling as the > + padding for stack_t might not be non-zero. */ > +long ilp32_sys_sigaltstack(const stack_t __user *uss_ptr, > + stack_t __user *uoss_ptr) asmlinkage? Arnd -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/