Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752376AbcLFHsd (ORCPT ); Tue, 6 Dec 2016 02:48:33 -0500 Received: from mail-bl2nam02on0047.outbound.protection.outlook.com ([104.47.38.47]:32448 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752233AbcLFHsa (ORCPT ); Tue, 6 Dec 2016 02:48:30 -0500 X-Greylist: delayed 3742 seconds by postgrey-1.27 at vger.kernel.org; Tue, 06 Dec 2016 02:48:30 EST Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Yuri.Norov@caviumnetworks.com; Date: Tue, 6 Dec 2016 13:02:57 +0530 From: Yury Norov To: Catalin Marinas CC: , , , , , , , , , , , , , , , , , , , , , , , , , Subject: Re: [PATCH 11/18] arm64: ilp32: share aarch32 syscall handlers Message-ID: <20161206073257.GB18470@yury-N73SV> References: <1477081997-4770-1-git-send-email-ynorov@caviumnetworks.com> <1477081997-4770-12-git-send-email-ynorov@caviumnetworks.com> <20161205171242.GH14429@e104818-lin.cambridge.arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20161205171242.GH14429@e104818-lin.cambridge.arm.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Originating-IP: [223.196.191.148] X-ClientProxiedBy: VI1PR0901CA0064.eurprd09.prod.outlook.com (10.167.203.160) To BN4PR07MB2244.namprd07.prod.outlook.com (10.164.63.150) X-MS-Office365-Filtering-Correlation-Id: 7f00a77e-3c0a-459a-1583-08d41daa24da X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:BN4PR07MB2244; X-Microsoft-Exchange-Diagnostics: 1;BN4PR07MB2244;3:P3REnRjyJESqBCsYFAnIq+ZLBnjwIOO+JuriOgEvS4sRUyNBV1gZMa+h0dLAx81ATP8Lv1LJ3G4ClwEGbSQmaQOrXBcEIS4LCExrRuVrjV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UEmx8783QizhACn7L+60IgBBFRQyAaMnYvRJGzrZF55erWIHoLoc5S1BJVhEw0Wh8I5CN/BlzJoHXILSOACeEIUAG4a8GCD8Fkwhn7qHu+ddpjZgw74Fuv9FdWugnvd17VWttclJSjNzRn4dWs9dQPzfHObZv/3MNHIDzlUzYF+UOv/KEidDfenIoe8LwNwcKkCI0m3OOnqU2gsoC+IGgC6h1vXt7tvsl8xppC;20:aKwCMThxfX/3blWuSLzbC8n1I/Gt0ywNm0o+N44djkWkm+5b3ufCRsY/HzQwor2jFRYnh/sEl1dbq/igTvmsKYUJN8iP4XqiYgzaEMipY61I+oDH1u2mwwaPle+ZhGpI+26Rao777svR6KTNaQs9V5b0cflhnxZcdYDQbFtV68ZBGrxwSkcujFl4fSr6XktnnNyINvQ3nxqk9GgwLW8ZGZYRmy8uyJfbzAJi4dnMDi3CT1U+R2qEZ0q0AoEsbAOmRxFbTheLAGteliGcaH7GeDT8qfLNi4/tV/tNRVTXGzTFGCHpTr22GfK3xMS9gp6hIoPcg4hm45BVR5HTbZ9xUyCg6r6N83zl+V745NcsRt2aFkWt+JirXjYBQAZb5AyihYobd0q0KOEFRF7jYItQqjOWPjtEHDMYOX2eW/bjxXCL4BemYMsuwLCBsPgQyb3ffVwgbbAXDpew0Pfw5JILBwz4beD/iUS/k5K9LAlCqKXCA9PwgxV20ZtKnhMBbDuoKh6liOEX1O+/+O9ZKz/SOT5BbM7tXDWPOIITejonPSMItRbhuOxWZJ4JmwaKklSEszpCLuw2sbcc4irvehl3PpDLAk+ctg2acmBbQPCMoZ4= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6041248)(20161123560025)(20161123562025)(20161123564025)(20161123555025)(6072148);SRVR:BN4PR07MB2244;BCL:0;PCL:0;RULEID:;SRVR:BN4PR07MB2244; X-Microsoft-Exchange-Diagnostics: 1;BN4PR07MB2244;4:WJs51b5h8fGjDZoW5xduhlT/coqsj15dPx+ecLm9N/3HONi61x3LGynVySGyEeQgpIAectQmyu/0QMdrK6RWhd0aE9T/Ko6bpCPHKYRbZNnB3DPsBJ4E6e/iCATGXA9hGiDpVvIIFsagJ91txUjnIQq5kJ3UEBId1FUiTWk1MeTAn/HyqWp7Ur2dNjddjZzK+zbQjn4HHw2QFTsOc16k214gDrCx6idOokZ8XaqDkaYr4RbtVWmP85qFeEYFqUpaDS2tP6lQxUziuP1gm6XNLU7+D4PFEc4zFkA1LoV/HwwrHisEWrSACEonDBsuBAaadUci5bwqJRG9WlDp/tm97QnPDgfmkX9VxSw7jiyJEqn3cnWWFXmLttuvaWlWxlY5KsOzp8w/hIQ6aYTsaEtiTV8HSKbnXng0zc1hqhltq/qbS3vnZK477gxN70hJLiK4lruBRIUHx52QMgFh2B1749jZTAuoXxCervYQayq8FC2XTZgtZFiPb5vMcD7NeOWO8Fv8gAkEmiKJ/DTdblDaNYiMt25b7UVSknvILntFNf7aLNRDMNcorRS6CkU6M323 X-Forefront-PRVS: 01480965DA X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(6069001)(6009001)(7916002)(189002)(199003)(24454002)(97756001)(50986999)(54356999)(46406003)(83506001)(81166006)(81156014)(305945005)(7846002)(8676002)(7736002)(101416001)(5660300001)(39060400001)(92566002)(733004)(6486002)(97736004)(4001350100001)(38730400001)(189998001)(39840400001)(6496003)(76176999)(39450400002)(106356001)(110136003)(39410400001)(229853002)(47776003)(50466002)(1076002)(6666003)(2906002)(33656002)(6916009)(2950100002)(66066001)(105586002)(7416002)(23726003)(4326007)(39850400001)(76506005)(33716001)(68736007)(6116002)(9686002)(3846002)(42186005)(18370500001);DIR:OUT;SFP:1101;SCL:1;SRVR:BN4PR07MB2244;H:localhost;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;B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7xYTnat3HvPWpz5eMlU47xKWYsjfI6zh1NQJYeMfML+/uW9Hncfecnoh/NLtjNFnq/iuWx+c2lYw==;5:fEeEW3ustoIpeYdSgJUzwvMjBilOfhiguttdI+r4HYab5AxLSb5TUljBN52qWatMlDHR0yMoErNAUQIqnnlTtloJPUu/QPaW/JRM3vofuE2U9DgcrouEZzu5Mv0GhcOnpUSd9ZQ+V2TYY+ktbpJvDg==;24:QcXjisDxyazxwMcl1hgnMDvEYZynM3psP9VJd46RYXtiQvPXn9f3teHSezMAn2fxDZbGldicEibPKw9BV00t5MZKL2I2/qWxYcPF8qD0Cpo= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;BN4PR07MB2244;7:HuO74SJ+fS0Mcj5mdzqOVRTYP7A7jJviy0NTWhBTQsXMyhLMyLdkO8v2TCchmem67kqRSF21BFFfs4tsU0OSdt9+9ijBlEFSrHMh+6OXgPghEq/ye8dDfNsmOyLt0oqNB+GUyn60NlcawYvgu3M4sZq0vclksR+t6zv/K3NnwGLM0Tx/Vdnrw15O9w/FVSEJzxMT3udGTyXg5hEkM6GsACOMOOlJOsgnGkK+KvT7PVf5XAsOU0OJctwhxG6QZX97bByhqIKgJYJF+ljha40RX92V4a8Z2gdYyOEJHSqqQpydjH61Hu4Ocjnt+LGj3biInJaXBETDmHQwBjLfsMAwrPDeiKFs3TTD+6t1N7l1GAtehCKlqeE1qsSqmDT1xrwJu/sRUSC4UZZfXo0KSayAuiTnGtJkzbgFcI+d4Baflvg8Gwv17vGWzDm4KcZXNALf1HAxTD0JNm4NpQF2BnNJqg== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Dec 2016 07:33:15.7603 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN4PR07MB2244 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1690 Lines: 50 On Mon, Dec 05, 2016 at 05:12:43PM +0000, Catalin Marinas wrote: > On Fri, Oct 21, 2016 at 11:33:10PM +0300, Yury Norov wrote: > > off_t is passed in register pair just like in aarch32. > > In this patch corresponding aarch32 handlers are shared to > > ilp32 code. > [...] > > +/* > > + * Note: off_4k (w5) is always in units of 4K. If we can't do the > > + * requested offset because it is not page-aligned, we return -EINVAL. > > + */ > > +ENTRY(compat_sys_mmap2_wrapper) > > +#if PAGE_SHIFT > 12 > > + tst w5, #~PAGE_MASK >> 12 > > + b.ne 1f > > + lsr w5, w5, #PAGE_SHIFT - 12 > > +#endif > > + b sys_mmap_pgoff > > +1: mov x0, #-EINVAL > > + ret > > +ENDPROC(compat_sys_mmap2_wrapper) > > For compat sys_mmap2, the pgoff argument is in multiples of 4K. This was > traditionally used for architectures where off_t is 32-bit to allow > mapping files to 2^44. > > Since off_t is 64-bit with AArch64/ILP32, should we just pass the off_t > as a 64-bit value in two different registers (w5 and w6)? Current glibc implementation becomes broken for 64-bit off_t if if I'll do what you want. sysdeps/unix/sysv/linux/generic/wordsize-32/mmap.c 28 __ptr_t 29 __mmap (__ptr_t addr, size_t len, int prot, int flags, int fd, off_t offset) 30 { 31 if (offset & (MMAP_PAGE_UNIT - 1)) 32 { 33 __set_errno (EINVAL); 34 return MAP_FAILED; 35 } 36 return (__ptr_t) INLINE_SYSCALL (mmap2, 6, addr, len, prot, flags, fd, 37 offset / MMAP_PAGE_UNIT); 38 } 39 40 weak_alias (__mmap, mmap) So it requires changes both in glibc and in kernel. I can do it. But I'd like to collect opinions of kernel and glibc developers before starting it. Yury