Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161595AbbKEOev (ORCPT ); Thu, 5 Nov 2015 09:34:51 -0500 Received: from mout.kundenserver.de ([212.227.17.10]:62387 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1161237AbbKEOet (ORCPT ); Thu, 5 Nov 2015 09:34:49 -0500 From: Arnd Bergmann To: linux-arm-kernel@lists.infradead.org Cc: Yury Norov , catalin.marinas@arm.com, linux-kernel@vger.kernel.org, pinskia@gmail.com, Prasun.Kapoor@caviumnetworks.com, Nathan_Lynch@mentor.com, agraf@suse.de, klimov.linux@gmail.com, Andrew Pinski , broonie@kernel.org, jan.dakinevich@gmail.com, ddaney.cavm@gmail.com, bamvor.zhangjian@huawei.com, philipp.tomsich@theobroma-systems.com, andrey.konovalov@linaro.org, christoph.muellner@theobroma-systems.com Subject: Re: [PATCH v6 01/17] arm64:ilp32: add documentation on the ILP32 ABI for ARM64 Date: Thu, 05 Nov 2015 15:33:24 +0100 Message-ID: <6849878.g4juXb5ikg@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: <1446507046-24604-2-git-send-email-ynorov@caviumnetworks.com> References: <1446507046-24604-1-git-send-email-ynorov@caviumnetworks.com> <1446507046-24604-2-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:x+pViPtLV/ipQNCh6WF1L5xHOpecItDl7JfBVIFb3TwYzOekefx c7PMghtAgyi3KlzuZB3TFy9lFc3Ifihs2jFeKRLpb4UVwYYHa57/uvry09lJFNGle45yNQG HtCSFwUVFuV8O1IAV8KDsOTMHAvw2RzBjtxTXaG0i8u2V1Nkb6r8FQtMvLB/N2+eIm0u0Ds nkoeKcFuPiga3r+bUO7Lg== X-UI-Out-Filterresults: notjunk:1;V01:K0:NY34kwb3jcI=:ShqWY3tW3ZPNs1YCOQTPmU hHxuZaEblpL4+kUIfhO5cS3N2yvqNvc6en2XLPec8UihYxo6K2fuSZIDLiKULGb7Ku6aDq4BE u4/hOl8a78789Tp+/5HzA8XVehw++WWG9bchz4BXkuZzLe/KMWJkl0G3FBI+cPvyWMwmVFPDe Q9zcBKVaMml1p4wNXdCg0dRIOhlMzdf0igBeYtvo34LVUG/1cUzX5m9P0lsukB2Jhe5yOnz1z AIqUtgPqo2wGuiXChjNlFUggETWpFkwg9sAPmi3gzHjrBaHCJqlUKwQSn9KOQPNwyJrUMgjpA YL2NoG9sh1KwhGT+/sconCrTub0tV+s5onaNwhF2aj4veaow0eqKSIb9l5Lvepjef5Zwh4r9O zdxWTmKGHOglHzu1YYDInTpYh5I9h5pLo5StT3qddu0HPsDY8fs8PWcvOQIbZ2L/yM4mqMm0m F3maPDH0pTYkylKdbuwxQimKS86wNU6gwHoaxG/QNp1+ZV4z9DSeHCAX5W/v3ntXIZX2XtOrV NFEHOGs0Ji7rqyntCVOKkKgPl+RpqM+IZsTqDoFI3rg+zutMG1yjaiMMG9RJAsH/suj8N4zhi /wbVFqakCzXkhYpTiwdFCDav1BViw9wdCuKkZtKa0sE0bRKutIIOuoMx84v7QV5xfQQHuMMwE L3J0i1C1BOb5Bjg7RPCjuezxxh8bdhRBpv+bueHTs50frGmKzviizGpJuOuDw+MnRPiBTOv4r EHb+FssSPguTxB7r Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3979 Lines: 99 On Tuesday 03 November 2015 02:30:30 Yury Norov wrote: > From: Philipp Tomsich > > Based on Andrew Pinski's original patch-series and adapted with changes > to reduce the duplication of code-paths and resolve issue found during > LTP testing. > > Signed-off-by: Philipp Tomsich > Signed-off-by: Christoph Muellner > Signed-off-by: Yury Norov > Signed-off-by: Andrew Pinski > Reviewed-by: David Daney Thanks for the updated version, I'm much happier with this, and only have some comments on a few details to the later patches. > +This document describes the ILP32 syscall ABI and where it differs > +from the generic linux syscall interface. > + > +Some structures are changed to reduce the difference in the code path > +for both ILP32 and LP64 ABIs for signal handling. > + > +The following structures have been changed so the layout of the > +structures are the same between ILP32 and LP64 ABIs, including: > + * sigval_t contains pointers > + * sigevent Uses sigval_t which causes it to be the same. Special > + handing is needed for reading; in the mq_notify syscall > + * sigaction Conversion is handled in the userland (glibc), as the > + userland data structures are defined in glibc anyway. Right, makes sense. > +A number of structures differ between ILP32 and LP64, including: > + * timespec uses time_t and suseconds_t > + * timeval uses time_t and suseconds_t > + * stat uses timespec/time_t As I commented, we might want to change this for 'stat', which doesn't really time_t anyway. > + * semid64_ds uses time_t. > + * msqid64_ds uses time_t. > + * shmid64_ds uses time_t. These use the arm32 layout, right? That's good for consistency. Fixing these for y2038 will be a bit ugly, but that code can be shared across all architectures. > + * rt_sigframe uses siginfo and ucontext. > + * siginfo_t uses clock_t and sigval_t > + * ucontext uses stack_t and sigset_t > + * fd_set This is done to avoid endian issues between ILP32 and > + LP64. Syscalls consuming fd_set use timespec. > + * struct msgbuf The specification of 'struct msgbuf' defines the 'mtype' > + field as a 'long' (i.e. 32bit for ILP32, but 64bit for > + LP64). Functions that operate on 'struct msgbuf' need > + to be passed through the compat-syscalls to resolve > + this. > + * stack_t contains pointers (handled in the compatibility layer) > + > +Also the syscalls which normally would pass 64bit values as two arguments; > +now pass the 64bit value as one argument. Also they have been renamed > +(removing the 64 from the name) to avoid confusion. > +The list of these LP64 syscalls reused by ILP32 clients is: > + * fcntl > + * statfs > + * fstatfs Did you forget to edit this list? I see fcntl and {f,}statfs use the compat implementation, not the native one in your patches. > + * truncate > + * ftruncate > + * lseek > + * sendfile > + * fadvise64 Makes sense. I think using the normal compat syscalls would have been just as good here, to save a few lines in the syscall table, but I agree that the calling conventions are rather silly when you pass a 64-bit number in two registers. > + * newfstatat > + * fstat This contradicts what you write above regarding separate 'struct stat'. > + * mmap Not direct reuse because of the wrapper to check the page size I guess. Aside from the wrapper, the 32-bit and 64-bit system calls are basically identical. 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/