Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932233AbbLBIiI (ORCPT ); Wed, 2 Dec 2015 03:38:08 -0500 Received: from mout.kundenserver.de ([212.227.126.133]:53559 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753949AbbLBIiF (ORCPT ); Wed, 2 Dec 2015 03:38:05 -0500 From: Arnd Bergmann To: linux-arm-kernel@lists.infradead.org Cc: Yury Norov , pinskia@gmail.com, Prasun.Kapoor@caviumnetworks.com, catalin.marinas@arm.com, Nathan_Lynch@mentor.com, linux-kernel@vger.kernel.org, agraf@suse.de, klimov.linux@gmail.com, broonie@kernel.org, jan.dakinevich@gmail.com, joseph@codesourcery.com, ddaney.cavm@gmail.com, schwab@suse.de, bamvor.zhangjian@huawei.com, philipp.tomsich@theobroma-systems.com, andrey.konovalov@linaro.org, christoph.muellner@theobroma-systems.com Subject: Re: [PATCH v6 14/19] arm64:ilp32: add sys_ilp32.c and a separate table (in entry.S) to use it Date: Wed, 02 Dec 2015 09:37:05 +0100 Message-ID: <1712431.VUth4NvudT@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: <20151201233503.GA23156@yury-N73SV> References: <1447795019-30176-1-git-send-email-ynorov@caviumnetworks.com> <12844690.Yr8y3jA010@wuerfel> <20151201233503.GA23156@yury-N73SV> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:qx6e7GcUNpFiUF9V7GdJl3c8gJARkcSr8hTKCb3PruQX9LemY9O K/RO04PKoA6wQ1Is4opQcP6QwsLzdMBRY78SvrFAdH5v7X6DwRxQAwC6xuGevS14cXSbvEw kClWv97SEtCrcWU9PjMS67wtL2nlfJPDViBsEAhVxeO8j4qPAiuGFFhnbpqpcbjfdQmyCDA ybpKyVCBKMW2tbDbsW3lw== X-UI-Out-Filterresults: notjunk:1;V01:K0:Xu71ZTXX1X8=:1aqHc2JMJcXi1T0333OThO IPspTQJjsR/yX9M9pqfqOr32/8oDMuGF7/87s8zMzKvRlzbyIYyAx558oZio2DGD8WLlRcQ5l lzLwBaZuIEaUD6JPRafexEvZIm1fPyYbRA0ICcs1er0rcIytyI8yhR/EZmP6rizJaSUi+QBF5 X8O2d9CwgUZSaskWfZBPpjs3mM6pwL19xHPwT2h35PNisH0EbjqEjAr8BHrZILbxzeqSSUPlK W3QEf0BHJdNUTWDqlApxGQ0+88k3G2JMn7flHs+ty00P0FEBaPjCy9Gp17BFHq9FmW6awcc2n TLkiLOJZlhpbOM5q2MvCubolrZNVmVbhNEw3aPN138q4BnIKBVHgVyTJBxU3PoM5dUBGkZJDq x7Kf/iNgX6go660bF5vsyZjxOdOGzHMbmZjrGTPljia9ZrJO9CpG0iXNhO44Sc877uQ6wWlXX Thbgwxf7bYfeEouO99PomFDpZr/3mZCZpkvk2t25XV+sp34+LSSIdBDtil06M4XD+SCuUJ/+7 lfmPXtZDuiYQ1QbYCopbCQ96E6/6NjZx1uuyr0q50Upcr/0kitVY38qld1bkMo+nny5nmPZL7 RoI9+rs9VKpItwh7xOYNu74+0Jilx4U/X9NKdgZBk/cDWs7FjF0UlcB1qCGzhCMOhyzuoSw5N BAu2GDLfdDHF3RlT41nq9QgSvBZzsd2mDr1FdPi51W3UJLOFZymC09PLr0HHmfLjX7Osw5inY TywPfAOehroQm0MH Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3166 Lines: 71 On Wednesday 02 December 2015 02:35:03 Yury Norov wrote: > On Tue, Dec 01, 2015 at 11:39:42PM +0100, Arnd Bergmann wrote: > > On Wednesday 02 December 2015 00:29:04 Yury Norov wrote: > > I'm not sure I understand this part. What changes specifically do we need? > > > > For kernel: > > diff --git a/arch/arm64/include/asm/shmparam.h b/arch/arm64/include/asm/shmparam.h > index 4df608a..e368a55 100644 > --- a/arch/arm64/include/asm/shmparam.h > +++ b/arch/arm64/include/asm/shmparam.h > @@ -21,7 +21,7 @@ > * alignment value. Since we don't have aliasing D-caches, the rest of > * the time we can safely use PAGE_SIZE. > */ > -#define COMPAT_SHMLBA 0x4000 > +#define COMPAT_SHMLBA (4 * PAGE_SIZE) > > #include > > diff --git a/arch/arm64/kernel/sys_ilp32.c b/arch/arm64/kernel/sys_ilp32.c > index c5bc712..877bedf 100644 > --- a/arch/arm64/kernel/sys_ilp32.c > +++ b/arch/arm64/kernel/sys_ilp32.c > @@ -42,15 +42,12 @@ asmlinkage long sys_rt_sigreturn_wrapper(void); > #define compat_sys_pwrite64 sys_pwrite64 > #define compat_sys_readahead sys_readahead > #define compat_sys_rt_sigaction sys_rt_sigaction > -#define compat_sys_shmat sys_shmat > #define compat_sys_sync_file_range sys_sync_file_range > #define compat_sys_truncate64 sys_truncate > #define compat_sys_sigaltstack sys_sigaltstack > > For library - just create a header in ilp32 directory that defines > SHMLBA exactly as arm: __getpagesize () << 2 I think we both reversed our positions here ;-) The 4*PAGE_SIZE on ARM is an architecture specific oddity, I believe to work around aliasing caches on ARMv6. As no other architecture does this, we're probably better off not duplicating it for aarch64-ilp32 and just use sys_shmat as your v6 patch does. > > It sounds like shmat is one of the cases we an override makes sense > > and we should use sys_shmat with PAGE_SIZE for aarch64 ilp32 mode. > > > > [...] > > > We normally assume that the page size on ARM is fixed to 4K, so > > there might be user space that just hardcodes 16K SHMLBA > > It means that we should use compat_sys_shmat because hardcoded > userspace may have a chance to work for 4K pages. If we'll use > sys_shmat (and so 4K SHMLBA), we'll definitely make hardcoded > userspace broken. Non-hardcoded userspace will work anyway. > > We can describe in documentation that 4k pages are prefferable. The hardcoded user space would only apply to old source code that specifically tries to adapt to what ARM does, but gets it wrong, If we have source code that is converted from x86 or mips and hardcodes anything, it's more likely to be the normal __getpagesize(). 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/