Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp551240imu; Tue, 11 Dec 2018 03:48:27 -0800 (PST) X-Google-Smtp-Source: AFSGD/XjWlpgQ7087o2CL4ivdPhlv9ms3yspQgi7dwAAASFjyDb4m/75nWvkb5XZyhGakqWkF8kC X-Received: by 2002:a17:902:9a8b:: with SMTP id w11mr15328488plp.121.1544528907388; Tue, 11 Dec 2018 03:48:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544528907; cv=none; d=google.com; s=arc-20160816; b=THTO8yVigHQo5gDdYbONtJuFth3C8/la4DnHSz7/oxzn9MnoUjhWiQbwb63W+1gzTO +oziOoyaWC+GodPKH1mzz0xkuDuxZIQQ/n938NRR89HfFS17sCaNn934uDycRT7i3+Kt dYSMwPyfdXvaqaOH8zyT01ZvfVn9eSU2hawT/9hMxxQbIKv5fYpuRqCiEZREjYVg48L4 qs6iRWPF598xLLBR+vSNpHS7/2pUZzCqJMUd512E0e437dA0g68rI6c73hjoA7I6OhDe wFwLk254sjLo+3y7gveVOr+l9+ujQRhITrN+6XgQYCLSj0pzm3sP15sovXTVVIQBg6iu RutQ== 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=4ZKR0Qc+XUG46BhH2JuSK0C0oNc5P0lmElOy0P1L83o=; b=fDOCxoBxlnyqIR6zbMgPuPTGhh7MF0fW+nGqHxiNZWTcNZyh7/A/yBYwNXJBBI4sIA E8sjFjH4Qlbg0szU/7EvyVitfBBgPw5hlNzRTeIwGpgtHcb6CglFYDzDWBp2aDRqIVsx eySVOs1c6oET2Ol8UbABk2I2Ekvrqhyv9SpiZoebvyZEu0KydvjqE5PWkkGgsaK/0cyQ qmR/CFepSrKOVONJ40I5zxDNTyv0XMNnkW3xhpcBBYKxx5KPwHbzdJtxPf9tg/5JJItB DFondNegupNF7KiqTBKWA+zQG3xrhZa4mMGrvMEC4FxiyGSkz5Z7rb4SqtQ/EbVzczrA oEHA== 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 j187si13106062pfg.160.2018.12.11.03.48.12; Tue, 11 Dec 2018 03:48:27 -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 S1726350AbeLKLch (ORCPT + 99 others); Tue, 11 Dec 2018 06:32:37 -0500 Received: from foss.arm.com ([217.140.101.70]:44936 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726154AbeLKLcg (ORCPT ); Tue, 11 Dec 2018 06:32:36 -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 3D90CEBD; Tue, 11 Dec 2018 03:32:36 -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 8F4753F6A8; Tue, 11 Dec 2018 03:32:33 -0800 (PST) Date: Tue, 11 Dec 2018 11:32:31 +0000 From: Catalin Marinas To: Arnd Bergmann Cc: Andy Lutomirski , "H.J. Lu" , the arch/x86 maintainers , Linux Kernel Mailing List , Linux API , "H. Peter Anvin" , Peter Zijlstra , Borislav Petkov , Florian Weimer , vapier@gentoo.org, Rich Felker , x32@buildd.debian.org, Will Deacon , Linus Torvalds Subject: Re: Can we drop upstream Linux x32 support? Message-ID: <20181211113230.GB35824@arrakis.emea.arm.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 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. Fortunately, we haven't merge it yet as we have the same dilemma about real users and who's going to regularly test the ABI in the long run. In the meantime, watching this thread with interest ;). -- Catalin