From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932240AbcEKTbI (ORCPT ); Wed, 11 May 2016 15:31:08 -0400 Received: from mout.kundenserver.de ([212.227.17.10]:63045 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932065AbcEKTbF (ORCPT ); Wed, 11 May 2016 15:31:05 -0400 From: Arnd Bergmann To: Catalin Marinas Cc: Yury Norov , linux-doc@vger.kernel.org, Andrew Pinski , heiko.carstens@de.ibm.com, Hanjun Guo , joseph@codesourcery.com, linux-arch@vger.kernel.org, linux-s390@vger.kernel.org, "jijun (D)" , Prasun.Kapoor@caviumnetworks.com, schwab@suse.de, agraf@suse.de, pinskia@gmail.com, klimov.linux@gmail.com, broonie@kernel.org, "Zhangjian (Bamvor)" , linux-arm-kernel@lists.infradead.org, Nathan_Lynch@mentor.com, linux-kernel@vger.kernel.org, Andrew Pinski , schwidefsky@de.ibm.com, christoph.muellner@theobroma-systems.com Subject: Re: [PATCH 20/25] arm64:ilp32: add sys_ilp32.c and a separate table (in entry.S) to use it Date: Wed, 11 May 2016 21:30:07 +0200 Message-ID: <4989778.Fs81NJurjH@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: <20160511165900.GM3051@e104818-lin.cambridge.arm.com> References: <1459894127-17698-1-git-send-email-ynorov@caviumnetworks.com> <5842999.Zgpfq4gkVz@wuerfel> <20160511165900.GM3051@e104818-lin.cambridge.arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:Hk6+/dVrPniNYsTe0BnGmpiO7viM6TD3JAqwK/CPj7tx96zixe/ foOa9u8j2SaQHb7GFayAthVooWvxkIL7Nf06bKNfK+b6mzxZ5n01c0E4CIUif8J0XBog9SD YhyDjHTs5fFOKZhMbKhTPiDkj1KWDHToRNgFDOXDw5Bu99X3DsG6/L6WeIr9MR+cisw/c7t scZKIzhidNJyXIAJanSNA== X-UI-Out-Filterresults: notjunk:1;V01:K0:eI8YP9twDCI=:jMt0YGn6bQSVpx8Am/3fO8 4qgo6SeJ1UVFC+P3nEHX+Uaed9PkQSiUynR+yV5eqDzSWx4SoBLW3K+mNvj7fbwDgDPsDR2MQ i8m+GcAcU/k/9oyvwFd7vsn/W96X1iNSYVSNHtVDC2yk/vjXEW3nBXwBLOlnH7RBFEqTH5+XZ PlsnBhw71n1FRZ4NzEJHNfsRpLRJemnh14wiQXPQanUhhfNtaFIW4iTTzlit8z2EtUNnXmJEX R/pIP/ggI7eUrZvUK9cu2sQ0znignZN4tnCuMmJp3fs/wbNvVq4kSPkYKwcagE05wC31U/87N jOiLMQr5B+oE3UGYE04CiW5bRxW4HB9DJxxyHNJty5fMWGxdqrOR7W2rgt78xVNkxnmVjjcAY QPsjRYC64wXLu91+FYxodK/BZebLD9Su/EKjRpqgy/dOOKXctb4skGdANrO3UBbYUfnKqWf35 mKAlAfVZLBIPAf77C6DOBhM9hRZyebIJYKjoWeBeYoiYmkOoaPKYohN1pROmgpswE4bGzzZ/B oLAtQrCaYg7WMfmUEvEeH+QFMW9Dpuh9aKC5euTnDPTff9xNIX6Tb0RMfdi0uBz/I/k9gOV2f 3M4/Pdios597tV33PVbk1QEZMhCaUN0VpgPskvs2E4MO+6wY8InczMZVuvBxzHsAS6AVtlITg 8f5PKVRr/s8/zGIAWO5oZerj9LmTzWXKQEi/0JsdYmB1QZJaPFYiAatdBS0VjelP2yVzReuu+ z1m61eY3Zv2I3DGl Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wednesday 11 May 2016 17:59:01 Catalin Marinas wrote: > On Wed, May 11, 2016 at 12:55:01PM +0200, Arnd Bergmann wrote: > > On Wednesday 11 May 2016 11:04:38 Yury Norov wrote: > > > On Wed, May 11, 2016 at 10:04:16AM +0800, Zhangjian (Bamvor) wrote: > > > [...] > > > > > > > >>Ok, I will test the ltp syscall test. > > > > >>With this changes, the issue I mentioned should be fixed. But we still > > > > >>use mmap2 syscall for ILP32 application when we pass the offset instead > > > > >>of page offset. Is it correct? > > > > > > > > > >I don't remember. It's probably not important whether we have the shift > > > > >in there, as long as it's independent of the actual kernel page size and > > > > >user space and kernel agree on the calling conventions. > > > > Well. I am ok with where to shift the pages size because we get the same > > > > result. I was just thinking if we should get rid of the name of mmap2 in our > > > > ILP32 porting. Actually, it is mmap but we name it as mmap2. User may confused > > > > if they do not know the implementations. > > > > > > > > > > This is what generic unistd.h does. If you want to change it, you'd > > > change each arch that uses generic unistd.h. > > > > Generic unistd.h has this: > > > > #ifdef __SYSCALL_COMPAT > > #define __SC_COMP_3264(_nr, _32, _64, _comp) __SYSCALL(_nr, _comp) > > #else > > #define __SC_COMP_3264(_nr, _32, _64, _comp) __SC_3264(_nr, _32, _64) > > #endif > > > > #define __NR3264_mmap 222 > > __SC_3264(__NR3264_mmap, sys_mmap2, sys_mmap) > > > > > > #if __BITS_PER_LONG == 64 && !defined(__SYSCALL_COMPAT) > > #define __NR_mmap __NR3264_mmap > > #else > > #define __NR_mmap2 __NR3264_mmap > > #endif > > > > So by default we get __NR_mmap2 and sys_mmap2 on 32-bit ABIs, but > > __NR_mmap and sys_mmap on 64-bit ABIs, as it should be. > > > > The problem is that arch/arm64/kernel/sys_ilp32.c now overrides > > this to use __NR_mmap2 with sys_mmap, so we have a mismatch. I think > > we should either override both the implementation and the number, > > or neither of them. > > I would vote for "neither of them" (so we use __NR_mmap2 and sys_mmap2) > to keep it close to new 32-bit architectures, even though we would have > some shifts by 12 in both glibc and kernel. I don't think the shifts are a problem, the main downside would be the limit to 44 bits of file offsets (16TB files), but it's also unclear if that is a practical problem at all. If it is, we run into the same problem on all other 32-bit architectures too. Arnd