Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp543926imu; Tue, 11 Dec 2018 03:39:43 -0800 (PST) X-Google-Smtp-Source: AFSGD/X8rw/mDqFkibz0ziS58qfaApt5lAWlYpyr+uTLgpac71rm5GK4cmMG10KyaiAW07zhzVLV X-Received: by 2002:a63:5320:: with SMTP id h32mr14319762pgb.414.1544528383004; Tue, 11 Dec 2018 03:39:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544528382; cv=none; d=google.com; s=arc-20160816; b=WEgjOVc0E5uFnLc6otuRiol7BBSgkD+ERa8+OemrJ4ge73AOBz7u2huV3r/1gv9G28 Mpd3xYyKlZpbXwYtiUZ+z12vwPZJdeOEqlV+UIXn08NY57Kqk62IHbLwHQwYevh3mKYi Bysc0usavto6NHmiUJilTXdxXQUyVQxQkS9EojBKCDWYcT+bpl4/TPiu7g05cGHG1iw8 lBOy4dGUjrhpfYivh7fq9pQCEgMSKinxDLu3xGpYg00Z6WqSm7SC+9sB2JCfxTRDZIZj x8H/t1Z2f2DDk9YCHnEJecv2ygIcNmDJcVVk/eXOSxpMM98QH/fKiZJFch1YvV+56ZAj ohPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from; bh=BWrx89eQFsrb3BvqiQIBK0zduAj4ju9Qy45EgZAh7zE=; b=ae9lIT2LqHNgZwlCP4JU9Cjg8i5iOrn7kXM9KJz/Og50Cuy2mYCPqNxVBatDMeXeA+ INCsIkD4pZfKZeP9MMbCy/X0r7497HsjVJ8V5VFXKVXSMVUjtVbAa0MKZ8SbGOF5X5pv xjNXZmoZr9i/+43u8v3R2kzsxPigv0przEfIhj7bZPsogHbUbAUAdI1b13BIPduUJJhR js2kEnnU8H5MeiPVAHVzROG96I51UhngrpL4gmqX0ZlhPNrZfjRatlbKLX5liIhsCVtE JqrvJ0s23DnUoC4oKdNA1UiJomkXFH5fAWjaxcv9L2pKr94z8B/AzjDaTFHx6DcSInZu 7PvA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f10si11109602pgo.356.2018.12.11.03.39.27; Tue, 11 Dec 2018 03:39:42 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726357AbeLKLhs (ORCPT + 99 others); Tue, 11 Dec 2018 06:37:48 -0500 Received: from mx1.redhat.com ([209.132.183.28]:39646 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726130AbeLKLhs (ORCPT ); Tue, 11 Dec 2018 06:37:48 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 989C5308212D; Tue, 11 Dec 2018 11:37:47 +0000 (UTC) Received: from oldenburg2.str.redhat.com (ovpn-116-82.ams2.redhat.com [10.36.116.82]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 01F445D9CC; Tue, 11 Dec 2018 11:37:43 +0000 (UTC) From: Florian Weimer To: Catalin Marinas 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? References: <20181211113230.GB35824@arrakis.emea.arm.com> Date: Tue, 11 Dec 2018 12:37:42 +0100 In-Reply-To: <20181211113230.GB35824@arrakis.emea.arm.com> (Catalin Marinas's message of "Tue, 11 Dec 2018 11:32:31 +0000") Message-ID: <87efaoxpix.fsf@oldenburg2.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Tue, 11 Dec 2018 11:37:47 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * 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. (If there are conflicts with POSIX, then POSIX needs to be fixed to support this.) Thanks, Florian