From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on archive.lwn.net X-Spam-Level: X-Spam-Status: No, score=-5.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=unavailable autolearn_force=no version=3.4.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by archive.lwn.net (Postfix) with ESMTP id 2189F7D087 for ; Sat, 13 Oct 2018 09:20:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726512AbeJMQ4o (ORCPT ); Sat, 13 Oct 2018 12:56:44 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:32778 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726380AbeJMQ4n (ORCPT ); Sat, 13 Oct 2018 12:56:43 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D38B0F; Sat, 13 Oct 2018 02:20:18 -0700 (PDT) Received: from mbp (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id BFCCD3F5D3; Sat, 13 Oct 2018 02:20:12 -0700 (PDT) Date: Sat, 13 Oct 2018 10:20:09 +0100 From: Catalin Marinas To: Eugene Syromiatnikov Cc: Szabolcs Nagy , linux-doc@vger.kernel.org, Palmer Dabbelt , Heiko Carstens , Yury Norov , Pavel Machek , Philipp Tomsich , Joseph Myers , linux-arch@vger.kernel.org, Steve Ellcey , Prasun Kapoor , Andreas Schwab , Alexander Graf , Geert Uytterhoeven , Bamvor Zhangjian , Dave Martin , Adam Borowski , Manuel Montezelo , James Hogan , Chris Metcalf , Arnd Bergmann , Andrew Pinski , Lin Yongting , Alexey Klimov , Wookey , Mark Brown , nd@arm.com, linux-arm-kernel@lists.infradead.org, Maxim Kuvyrkov , Florian Weimer , linux-api@vger.kernel.org, Nathan_Lynch , linux-kernel@vger.kernel.org, James Morse , Ramana Radhakrishnan , Martin Schwidefsky , "David S . Miller" , Christoph Muellner Subject: Re: [PATCH v9 00/24] ILP32 for ARM64 Message-ID: <20181013092009.gzxorufk4tqrzked@mbp> References: <20180516081910.10067-1-ynorov@caviumnetworks.com> <20180724173957.GA22106@yury-thinkpad> <20181010141017.GA2881@asgard.redhat.com> <7aac1a08-8948-1a04-cbd3-fbc6a53f9ff0@arm.com> <20181013020731.GD21972@asgard.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181013020731.GD21972@asgard.redhat.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-doc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-doc@vger.kernel.org On Sat, Oct 13, 2018 at 04:07:31AM +0200, Eugene Syromiatnikov wrote: > On Wed, Oct 10, 2018 at 03:39:07PM +0100, Szabolcs Nagy wrote: > > On 10/10/18 15:10, Eugene Syromiatnikov wrote: > > > * What's the reasoning behind capping syscall arguments to 32 bit? x32 > > > and MIPS N32 do not have such a restriction (and do not need special > > > wrappers for syscalls that pass 64-bit values as a result, except > > > when they do, as it is the case for preadv2 on x32); moreover, that > > > would lead to insurmountable difficulties for AArch64 ILP32 tracers > > > that try to trace LP64 tracees, as it would be impossible to pass > > > 64-bit addresses to process_vm_{read,write} or ptrace PEEK/POKE. > > > > but that's necessarily the case for all ilp32 abis: > > the userspace syscall function receives 32bit > > arguments so even if the kernel abi takes 64bit > > args you cannot use that from c code. (the libc > > does not even know which args should be sign or > > zero extended.) > > glibc's syscall() prototype has kernel_ulong_t as its arguments (more > specifically, to __syscall_ulong_t, which is 64-bit wide on x32; it > should also have kernel_long_t as its return type instead of long, > but that's another story), so it works perfectly fine in case of x32. This would have been my preferred approach but the libc community were not entirely happy with it as it breaks POSIX compatibility: https://sourceware.org/bugzilla/show_bug.cgi?id=16437 http://lists.infradead.org/pipermail/linux-arm-kernel/2015-February/323348.html (there are other threads around x32 and people arguing whether POSIX is wrong) Some sometime around version 4 or 5 of this series, we made the move (back) to compat-like ABI. -- Catalin