Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp255435imu; Mon, 10 Dec 2018 21:05:31 -0800 (PST) X-Google-Smtp-Source: AFSGD/WubVbqbKHuhgYz0nXfqhz9zWV4tHUpwu4nPjggKtX/DrYIVkkEUcP4MnfdyNKM8TIkKr8Z X-Received: by 2002:a17:902:42e4:: with SMTP id h91mr15015570pld.18.1544504731254; Mon, 10 Dec 2018 21:05:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544504731; cv=none; d=google.com; s=arc-20160816; b=ukaRIvwEtMhrJw2zi75P/rqpCW8pCfbBnrzc7nmvV8ZJvRfy2YeQCiF7PJIw4E6AaJ PiZjFU6eQW8GR58nJbEHyarGOoq1wMzCbG0UdnVJPCMxS4isVsPE1LtQRzt0DyEROewX 2nMJGKE6gzl9PxIDmyjMS9dHHGPCBQOkvVUepgd3oAm0zzysyMzZ+iyy+JfBWzyxv347 YSEr3hD6VZSVKI3ZsczFEpKz3TVXLc/zs3J4CzYPzMH9eW+i71Wgj2R4rSQgTzmmC649 Lr60NCmKSeyOnCl33LYFBrpeSc0GBrzyVbDBkrSmwYx/bZUCdfQS2YGuXKSZ0gjxF7ED +SZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:subject:message-id:date:from :mime-version:dkim-signature; bh=BKl7WI/NyQaJT2MdALwjMCIfknuzgxKHogazM45rLm0=; b=eAdVHw61EvQ0hQYvWX39wXGoLI5nvNwyvJXSdfVYlKtBRLTl53ZQEsKSe79Jjcik58 VMzC4cIiVCk+bbsP+5nX8kOkw8SmubU/kF+rW86a0owwy66fuDH4SHo/XiBAPy9Edqs9 SGS3lJvA4PzFisWpk9WV/McvziOIxGcKKGnB4rINALnQNnezljrRikzfvw7xwiCFQKhD 1Y/jwCp0FN8XaEvzXmNM0S18Fe0Ztz7z2LQFX4Vy/5hHjSoBHkdQF7bCbGdS7xwRCy95 N680Bwtj5k7rOSFNqi4DFDI4jBBZTlmiF6CxlvogtXUr6oMX7K4OgZZAp40SWNwSzIYU GbwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=NCa31ih7; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o32si10723485pld.407.2018.12.10.21.05.16; Mon, 10 Dec 2018 21:05:31 -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; dkim=pass header.i=@kernel.org header.s=default header.b=NCa31ih7; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728541AbeLKBXx (ORCPT + 99 others); Mon, 10 Dec 2018 20:23:53 -0500 Received: from mail.kernel.org ([198.145.29.99]:51676 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727276AbeLKBXx (ORCPT ); Mon, 10 Dec 2018 20:23:53 -0500 Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id DE0A32146D for ; Tue, 11 Dec 2018 01:23:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1544491432; bh=h+XzGKcY765gMTqyVPOnShXTl/WRhYXmIfcJYSI4BjU=; h=From:Date:Subject:To:From; b=NCa31ih7NNj13BLUs+ykXpoVLKUyxkOcLI3q/2DBznfKYRWVNFn71BFveT//6X+r7 VYp9x+uRt7iX+kJx4WQl6fsr56FihLU+/B9KdZef6EN/OlUktk/sqLnQ3Be1SeJXj6 gwLKL2RzgDPXzSJFFEEUwKpFFWW+bcBsJNjMaVuI= Received: by mail-wm1-f46.google.com with SMTP id q26so495228wmf.5 for ; Mon, 10 Dec 2018 17:23:51 -0800 (PST) X-Gm-Message-State: AA+aEWb7p69oWGGxRDMRonC528PQkbzRPs2DwRpF2pMS5xk9mWEg08qh m6muUxo0pqWcwfCMgdLT7BT8ciJiaPUvg5+eerL7Rw== X-Received: by 2002:a7b:ce17:: with SMTP id m23mr537345wmc.74.1544491430259; Mon, 10 Dec 2018 17:23:50 -0800 (PST) MIME-Version: 1.0 From: Andy Lutomirski Date: Mon, 10 Dec 2018 17:23:39 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Can we drop upstream Linux x32 support? To: X86 ML , LKML , Linux API , "H. Peter Anvin" , Peter Zijlstra , Borislav Petkov , Florian Weimer , Mike Frysinger , "H. J. Lu" , Rich Felker , x32@buildd.debian.org, Arnd Bergmann , Will Deacon , Catalin Marinas , Linus Torvalds Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi all- I'm seriously considering sending a patch to remove x32 support from upstream Linux. Here are some problems with it: 1. It's not entirely clear that it has users. As far as I know, it's supported on Gentoo and Debian, and the Debian popcon graph for x32 has been falling off dramatically. I don't think that any enterprise distro has ever supported x32. 2. The way that system calls work is very strange. Most syscalls on x32 enter through their *native* (i.e. not COMPAT_SYSCALL_DEFINE) entry point, and this is intentional. For example, adjtimex() uses the native entry, not the compat entry, because x32's struct timex matches the x86_64 layout. But a handful of syscalls have separate entry points -- these are the syscalls starting at 512. These enter through the COMPAT_SYSCALL_DEFINE entry points. The x32 syscalls that are *not* in the 512 range violate all semblance of kernel syscall convention. In the syscall handlers, in_compat_syscall() returns true, but the COMPAT_SYSCALL_DEFINE entry is not invoked. This is nutty and risks breaking things when people refactor their syscall implementations. And no one tests these things. Similarly, if someone calls any of the syscalls below 512 but sets bit 31 in RAX, then the native entry will be called with in_compat_set(). Conversely, if you call a syscall in the 512 range with bit 31 *clear*, then the compat entry is set with in_compat_syscall() *clear*. This is also nutty. Finally, the kernel has a weird distinction between CONFIG_X86_X32_ABI and and CONFIG_X86_X32, which I suspect results in incorrect builds if the host doesn't have an x32 toolchain installed. I propose that we make CONFIG_X86_X32 depend on BROKEN for a release or two and then remove all the code if no one complains. If anyone wants to re-add it, IMO they're welcome to do so, but they need to do it in a way that is maintainable. --Andy