Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1718296imm; Sat, 13 Oct 2018 02:20:54 -0700 (PDT) X-Google-Smtp-Source: ACcGV638vP3OccS84NqdVREFhxDLOzOboyM+DAtQyRWqYH8e0ZYk9xeyjXqFWOJdn01un26sMd+U X-Received: by 2002:a65:53c9:: with SMTP id z9-v6mr8726695pgr.203.1539422454619; Sat, 13 Oct 2018 02:20:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539422454; cv=none; d=google.com; s=arc-20160816; b=fTYISncVhSSGTRvAhBPYkg+QRPYwHlcs/N1LrZJ78LZ3K0zfYqI0ScF1wYfaBM/VWz wm92SYtVtlAl4Kc2msNDJRsXFJz6wpvfDU+bU3FuM1VCN/o3iiY5W3q9aW/vEV6qrD44 unU6qdJ7W2uGbOvlp6Q9rLjrHuI+fGYZx0J4hifYmBDBiv0z6HAlkLbtz8VzoToNwvh8 C5GqWY7NEt+2Ty7L5XY3Zb/nPW85ICnma+SQRELDsUlqTR3iveLpZCIvcfZck4G0fLoT i+CKvsphykaVfgnvPIU6NoqSHSnqzGQ08Y6hZI+BwUQBqnF6D1PaIb7uDYoGdJJY3hPv 2RJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=2HC857Hh2aAm+b98BU3Fd95Dz3PmNj9+bmmJp7MWz3E=; b=TBhp2oR6zPV/TCZWgCNzINGjltPZ+Xe0And4HbSzmYi9WoQyj6MKpv/xN8rNiagrNB EQzmDGmA+NhRS7j2LJdo4UTTc+QSWauxUi2NGex/7oQTlg3DDCxSmX3D6y+fRVVNv7ZL dsqp9cJYA68FJzStlJRrYZcg2mCKdxB4D64mxgbQcrgusv4ORxS4kqZ8LsbBcqtfPvm4 04LqXa2oX5JwILAm8UE8MThHzjQV96ikMBJFpymxuLo5Cu2Kqb/tIzF3//Nzox0xmr7S YuYxV4dDzPs3TfhunxhgrN2VvZk2hD+N7aBGPHyj8DqFErSYECqEvnubjaLPyaxazOXT BDOQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h2-v6si4536345plk.350.2018.10.13.02.20.39; Sat, 13 Oct 2018 02:20:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726771AbeJMQ4o (ORCPT + 99 others); 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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