Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp556701imu; Tue, 11 Dec 2018 03:55:25 -0800 (PST) X-Google-Smtp-Source: AFSGD/WcKtZ5nQYyiyug+By4FnxUwL6s7aegjWWKyNRF8iK/yiTxwIk2xrNZc8RTl84b6ZRJVLZi X-Received: by 2002:a17:902:74c1:: with SMTP id f1mr15465177plt.273.1544529325025; Tue, 11 Dec 2018 03:55:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544529324; cv=none; d=google.com; s=arc-20160816; b=vYANCTXzSaPAF8aNd+kQzFwhhAiEZ5R3E3xs08yXKDRbNjW8BErwQnSDlskvXO7ZVS YQ8ZQXW/JDnHuR2uK2ENoOpgOtFkmh1VwgPbx57x8Rw9vNg86otr9JTm2R9nkz7VKS9d Vq0wybuGFzSFz55aVWnyU1h9SRYDeYXXDa/8Z1t20Cdyv+Tdnfj0Bp0hU0lWpIMKoOMc YhXOrNgi1CqNOM/RbCDkrdW5saFTR5Z5WfyGRm6MOsa6pWe5ImgPxoia99vL7fUtrUso cG2TYrZjL3W3USl54Z01tkfNK/Nee4xriMP5OBVsuGBDceyQEVBrS+ilK2NQ76uub9dw FIig== 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=MuvIxKMTtLvC9iI3OhYc7XW1p0Udn4wplB+LK0mi3lE=; b=B24lopaDe4fbYXd3IsNUP65HWAx3mEu1ypzcFx3/qZhcZOUAcSOKPA3hT0AA0byK40 Wt47A3Y6COEfN6F4xMo66iRZcrqa1IOQFte2gqy0o48l/oKzGrRbrxy8Rd3X8HRbJlya 6sgSExVEMX2itMumLFRhOQJ6FAbFH+EXP0sGc7C3xWDSu7TNMOE0MrouXXOca7/ZV7Xz 0PA+KXsV+uVa6gBucX7SVh1TTBY9lzdKFFaiaMenLnNxIPHq+nhA4nvVSkojwhLMZCaC cmZSbxaRU0TXliaeokzvBHTYK5xMLSevupnlfmATag9B+csqwkPzI5rLtgDtoYm2hH0c QkLA== 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 q13si12158728pgj.86.2018.12.11.03.54.56; Tue, 11 Dec 2018 03:55:24 -0800 (PST) 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 S1726341AbeLKLxB (ORCPT + 99 others); Tue, 11 Dec 2018 06:53:01 -0500 Received: from foss.arm.com ([217.140.101.70]:45512 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726135AbeLKLxB (ORCPT ); Tue, 11 Dec 2018 06:53:01 -0500 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 51DEFEBD; Tue, 11 Dec 2018 03:53:00 -0800 (PST) Received: from arrakis.emea.arm.com (arrakis.cambridge.arm.com [10.1.196.113]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A50BC3F6A8; Tue, 11 Dec 2018 03:52:57 -0800 (PST) Date: Tue, 11 Dec 2018 11:52:55 +0000 From: Catalin Marinas To: Florian Weimer Cc: Arnd Bergmann , Andy Lutomirski , "H.J. Lu" , the arch/x86 maintainers , Linux Kernel Mailing List , Linux API , "H. Peter Anvin" , Peter Zijlstra , Borislav Petkov , vapier@gentoo.org, Rich Felker , x32@buildd.debian.org, Will Deacon , Linus Torvalds Subject: Re: Can we drop upstream Linux x32 support? Message-ID: <20181211115254.GC35824@arrakis.emea.arm.com> References: <20181211113230.GB35824@arrakis.emea.arm.com> <87efaoxpix.fsf@oldenburg2.str.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87efaoxpix.fsf@oldenburg2.str.redhat.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Dec 11, 2018 at 12:37:42PM +0100, Florian Weimer wrote: > * Catalin Marinas: > > On Tue, Dec 11, 2018 at 10:02:45AM +0100, Arnd Bergmann wrote: > >> On Tue, Dec 11, 2018 at 6:35 AM Andy Lutomirski wrote: > >> > I tried to understand what's going on. As far as I can tell, most of > >> > the magic is the fact that __kernel_long_t and __kernel_ulong_t are > >> > 64-bit as seen by x32 user code. This means that a decent number of > >> > uapi structures are the same on x32 and x86_64. Syscalls that only > >> > use structures like this should route to the x86_64 entry points. But > >> > the implementation is still highly dubious -- in_compat_syscall() will > >> > be *true* in such system calls, > >> > >> I think the fundamental issue was that the intention had always been > >> to use only the 64-bit entry points for system calls, but the most > >> complex one we have -- ioctl() -- has to use the compat entry point > >> because device drivers define their own data structures using 'long' > >> and pointer members and they need translation, as well as > >> matching in_compat_syscall() checks. This in turn breaks down > >> again whenever a driver defines an ioctl command that takes > >> a __kernel_long_t or a derived type like timespec as its argument. > > > > With arm64 ILP32 we tried to avoid the ioctl() problem by having > > __kernel_long_t 32-bit, IOW mimicking the arm32 ABI (compat). The > > biggest pain point is signals where the state is completely different > > from arm32 (more, wider registers) and can't be dealt with by the compat > > layer. > > I would expect to approach this from the opposite direction: use 64-bit > types in places where the 64-bit kernel interface uses 64-bit types. > After all, not everyone who is interested in ILP32 has a companion > 32-bit architecture which could serve as a model for the application > ABI. I fully agree with you that if someone wants ILP32 for a 64-bit only architecture, they should use the 64-bit kernel interface and ensure POSIX is adjusted. In the arm64 context, both options were discussed with the libc community complaining that a partial 64-bit syscall ABI breaks POSIX while the potential users were just asking for a 32-bit ABI to run their existing software stack on ARMv8 machines without native 32-bit support (until they complete the migration to 64-bit). > (If there are conflicts with POSIX, then POSIX needs to be fixed to > support this.) This would have been nice but no-one volunteered and, more importantly, there was no conclusive argument that ARM ILP32 is better than LP64 (well, apart from a minority of benchmarks) and something that people would want to migrate to. Given that the only credible case made was about legacy code, we decided to go ahead with a (mostly) compat 32-bit ABI. -- Catalin