Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S942685AbcJ0QFw (ORCPT ); Thu, 27 Oct 2016 12:05:52 -0400 Received: from mail-by2nam01on0052.outbound.protection.outlook.com ([104.47.34.52]:60423 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S934564AbcJ0QFr (ORCPT ); Thu, 27 Oct 2016 12:05:47 -0400 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Yuri.Norov@caviumnetworks.com; Date: Thu, 27 Oct 2016 12:29:19 +0300 From: Yury Norov To: Arnd Bergmann CC: Chris Metcalf , , , , , , , , , , , , , , , , , , , , , , , , , Subject: Re: [PATCH 01/18] 32-bit ABI: introduce ARCH_32BIT_OFF_T config option Message-ID: <20161027092919.GA3666@yury-N73SV> References: <1477081997-4770-1-git-send-email-ynorov@caviumnetworks.com> <1477081997-4770-2-git-send-email-ynorov@caviumnetworks.com> <7d5ef8e8-38f1-92fe-b584-242cc2924558@mellanox.com> <22426495.JIjM4XpfGo@wuerfel> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <22426495.JIjM4XpfGo@wuerfel> User-Agent: Mutt/1.5.24 (2015-08-30) X-Originating-IP: [176.59.35.249] X-ClientProxiedBy: AM5PR0101CA0014.eurprd01.prod.exchangelabs.com (10.169.240.24) To DM3PR07MB2252.namprd07.prod.outlook.com (10.164.33.150) X-MS-Office365-Filtering-Correlation-Id: a1bd624f-26d5-45bc-5ba5-08d3fe4bbfc5 X-Microsoft-Exchange-Diagnostics: 1;DM3PR07MB2252;2:iEeKUK+Wqv7BIYwgBlzKBVu8b7zgz09dVG0F3HnVPcSzS8cf3Ld/qajICVxNFRK8PrXLmr81MrzFzWQniD4OQZWnGRv/mnI6kVgvXSxJ1FgD6aigV3BTDrJo7FJKDeUhyH7yHMjquRnODQghKshyIQlw/OLD0unPGrL6pF1ZN1INcIXX/qGi0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jel6ztjfio50RkovYVWfu5svdlJ+o2brGz7PDI+tZiS5mspMXl6AliigoBPFucRvdr0HAelGfiVPcAz67jMnVZgdrkNaSfhorYsvQ30bvHSEXMw9lHP895FQBUhTPKQ6ukIqs8PbFl81Xk+pzD/q4QQcPXwEA/YUiz5+0id+lWM+4twtNMWjnuNij18nOfQUJd8rX4O01SEeruFryeusreOIWGvsOcmS/HETZ8Om4n/na6Rbb2e3IfRMXWGLmnF6mYIf0eU7a/BtwyQdGx+KW62SqPAuZdFLIVQfFWRTs413+h386vlw8i6va72uTIuOwhH39cKOCjQgJwAHKndjew5ezqgNsYXbgdIP8DAMCL9dI3CubUwJ3IrceYEXblBEtWH+FTw0gxX7NUjyTTKFF8/6mrmHARZoIqclPSgFBuOCu4Fz6ohjyk2Ec8AEtrg/2GHJnNZvsx5BnZ3Ut4ymcKwdC3b5nrtFPlw9lQijcd7jX8UnXDNqx1SlfHSLC6xFtzejrCw97yhmFaA/qo= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040176)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001);SRVR:DM3PR07MB2252;BCL:0;PCL:0;RULEID:;SRVR:DM3PR07MB2252; X-Microsoft-Exchange-Diagnostics: 1;DM3PR07MB2252;4:/nVOBEA0z1cF2uD4FbuA03jO3NtlM9LK3LgsEtBEqEJVDyjO3deiz9gsOClgok4tIvDTaFeSnYhZYn65AB68pUw9XrvaKlR/QOetV/5HkrdgC507ae9tngF5d+fY9uoAQaJDJsbuA17hVybstFh+QJVrLDFlZDvqBdXwPUfUGJ40NzBpTzjbb+gSN2wUCoaSCcubX0pa85W85uM2xWRDye+ejZbvrkvTRzb0eNhs0cvy3RScasHO6jtLXO+YdwuEs4ug+A7fUu7cG7Hn7EIA0xYeS12NqbPZ4TZAFDweuyhDn1qo+x/5V8oc1J8SYQkVVVDTelzDpMCUfO6yEztGM7n7poa4l4sltGeRVLElvwr2p5qjdtI2vfI5bf16SaZyuXun1DWh4yTKFfV0G//3Ug== X-Forefront-PRVS: 0108A997B2 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(6069001)(6009001)(7916002)(24454002)(189002)(199003)(377454003)(33656002)(83506001)(81156014)(4326007)(93886004)(77096005)(3846002)(106356001)(105586002)(42186005)(76506005)(97756001)(8676002)(68736007)(46406003)(110136003)(5660300001)(81166006)(7416002)(6666003)(9686002)(19580395003)(50466002)(1076002)(2950100002)(189998001)(50986999)(92566002)(101416001)(97736004)(7846002)(4001350100001)(6916009)(33716001)(76176999)(7736002)(6116002)(586003)(305945005)(15975445007)(54356999)(23726003)(2906002)(47776003)(66066001)(18370500001)(15760500001);DIR:OUT;SFP:1101;SCL:1;SRVR:DM3PR07MB2252;H:localhost;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;DM3PR07MB2252;23:wCE3y0sbk6YlIk8Z6ATBrK+Kx/SyCLdBkYLN8WJxW?= =?us-ascii?Q?BGyfuDz+sxEw1wIRh5XT9raPYfKx2mA6XScl1V4q47D7Qw/3elJLfZiutxOp?= =?us-ascii?Q?QiE1goj8QBu3j+eef9/6WIZlmtf+qlwfPh90xq6KMXDu2BFEf4sTuBOLkR3c?= =?us-ascii?Q?8792q632NTfLFFNWmphZiIhZxiNm+EXIfClp97zG2v/N3D5XPZjo13VTNKsX?= =?us-ascii?Q?B5wEMdiMv8Iadgi8GAFYUtU50O72NL+A3Ukj7CQcg8DLy3Jr5/oStwNGtKnt?= =?us-ascii?Q?y0w7wuRcifTCyvygHjLnpnpULP8KKVytrPNUyOI4UUx/ku7+tsjg8z4eG901?= =?us-ascii?Q?b9AOwbllkXe+tup/p3f+yjErxsUointRgbuWjDHiM+rVtQhwLNeytWAwkpZZ?= =?us-ascii?Q?8v2KLjeyp54ntyj/k9Ji+9ATsad7vnY41i97ZjQbE+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yG2h40usV5CRT7n9qcU= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Oct 2016 09:29:27.7712 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM3PR07MB2252 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4496 Lines: 88 On Tue, Oct 25, 2016 at 12:22:47AM +0200, Arnd Bergmann wrote: > On Monday, October 24, 2016 12:30:47 PM CEST Chris Metcalf wrote: > > On 10/21/2016 4:33 PM, Yury Norov wrote: > > > All new 32-bit architectures should have 64-bit off_t type, but existing > > > architectures has 32-bit ones. > > > > > > [...] > > > For syscalls sys_openat() and sys_open_by_handle_at() force_o_largefile() > > > is called, to set O_LARGEFILE flag, and this is the only difference > > > comparing to compat versions. All compat ABIs are already turned to use > > > 64-bit off_t, except tile. So, compat versions for this syscalls are not > > > needed anymore. Tile is handled explicitly. > > > > > > [...] > > > --- a/arch/tile/kernel/compat.c > > > +++ b/arch/tile/kernel/compat.c > > > @@ -103,6 +103,9 @@ COMPAT_SYSCALL_DEFINE5(llseek, unsigned int, fd, unsigned int, offset_high, > > > #define compat_sys_readahead sys32_readahead > > > #define sys_llseek compat_sys_llseek > > > > > > +#define sys_openat compat_sys_openat > > > +#define sys_open_by_handle_at compat_sys_open_by_handle_at > > > + > > > /* Call the assembly trampolines where necessary. */ > > > #define compat_sys_rt_sigreturn _compat_sys_rt_sigreturn > > > #define sys_clone _sys_clone > > > > This patch accomplishes two goals that could be completely separated. > > It's confusing to have them mixed in the same patch without any > > discussion of why they are in the same patch. > > > > First, you want to modify the default behavior for > > compat syscalls so that the default is sys_openat (etc) rather than > > the existing compat_sys_openat, and then use that new behavior for > > arm64 ILP32. This lets you force O_LARGEFILE for arm64 ILP32 to > > support having a 64-bit off_t at all times. To do that, you fix the > > asm-generic header, and then make tile have a special override. > > This seems reasonable enough. > > > > Second, you introduce ARCH_32BIT_OFF_T basically as a synonym for > > "BITS_PER_WORD == 32", so that new 32-bit architectures can choose not > > to enable it. This is fine in the abstract, but I'm a bit troubled by > > the fact that you are not actually introducing a new 32-bit > > architecture here (just a new 32-bit mode for the arm 64-bit kernel). > > Shouldn't this part of the change wait until someone actually has a > > new 32-bit kernel to drive this forward? > > I asked for this specifically because we identified the problem > during the review of the aarch64 ilp32 code, and it might not > be noticed in the next architecture submission. > > The most important aspect from my perspective is that the new > ilp32 ABI on aarch64 behaves the same way that any native 32-bit > architecture does, and when we change the default, it should > be done for both compat mode and native mode at the same time. > > > If you want to push forward the ARCH_32BIT_OFF_T change in the absence > > of an architecture that supports it, I would think it would be a lot > > less confusing to have these two in separate patches, and make it > > clear that the ARCH_32BIT_OFF_T change is just laying groundwork > > for some hypothetical future architecture. > > > > The existing commit language itself is also confusing. You write "All > > compat ABIs are already turned to use 64-bit off_t, except tile." > > First, I'm not sure what you mean by "turned" here. And, tile is just > > one of many compat ABIs that allow O_LARGEFILE not to be part of the > > open call: see arm64's AArch32 ABI, MIPS o32, s390 31-bit emulation, > > sparc64's 32-bit mode, and of course x86's 32-bit compat mode. > > Presumably your point here is that tile is the only pre-existing > > architecture that #includes to create its compat > > syscall table, and so I think "all except tile" here is particularly > > confusing, since there are no architectures except tile that use the > > __SYSCALL_COMPAT functionality in the current tree. > > Agreed, this could be made clearer, and splitting the patch up > in two also seems reasonable, though I didn't see it as important. > > Arnd In the past it was a separated series of 2 patches, and it was even acked by Arnd, but not submitted. http://lists-archives.com/linux-kernel/28471253-32-bit-abi-introduce-arch_32bit_off_t-config-option.html I can restore that small series in aarch64/ilp32 for next iteration, or resend it separately if you think to submit it before aarch64/ilp32 (which is better, for me). Yury