Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp320000imu; Mon, 10 Dec 2018 22:48:15 -0800 (PST) X-Google-Smtp-Source: AFSGD/X3qG6JD1S4grf+6b+uzp4qYRABXrcXyqIeLGB5Dr5mrxu4stBLbD/rYDvzvrDuB7LDefIr X-Received: by 2002:a62:6e07:: with SMTP id j7mr15638212pfc.135.1544510895574; Mon, 10 Dec 2018 22:48:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544510895; cv=none; d=google.com; s=arc-20160816; b=chHYDY/uOuvmauer75OzIb4SxyBPTJ52fmgvuzngCM1uWDrZVyeXNmMrdc0NAnsLYd hJliUhtLExwxkNGTDyii+Jx8LoI/mxd2Cv026MHB5q1GHZBuIM4o4srelK2+chjUtcdY 68qYE/XbJXjLMBi+TeVjIeHEP+Hawi/5T93dbp6bSKsauuarj1rAtdVR8LLbZRVy+KxB dVAzgdaWMTf4ODMFI13MFsUAnWdH6HUXh83BeIv9wUWweUkdHKm4AV13VWQdam16m9dp 7JFKB5p3flUZ8dpD09Nc51SyICaLm+FaIpn/4vM08IKmnmQYatcX/wbpe8jUgiWaHTV1 6Q5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=icCcTnABKx19XzkVCBxNCuN9FZSKKDlNBlB7inNpAWE=; b=RxWaHjFm5TBDD91YgCKOmoBAyI7w1NpPgYns53CnA7JgqWSz/Alo60OstNF1uW6XRb HjpgkwRk8EH+Aa4QMo9sxckiHfRKkhKHZ0im4BLZY3rdcvM/Iz8lM9wFECmxbWXydI2L tpqj0uuHOc+gK1lRDO1Ea5IhoyIOZ07jSvTE2jfE7vr2KAdAdr4mqxhB+zvFlhGvK216 OwlO3ducnGYjAzJhhV1Ne9AH/Ht9pXoWOiJKZvLDfJXvPx7ZzPRHHytK76VdG/hTdGHz szI+9I9B8aUjZH3gcNge9tgmN7YGl+4MbKtyft+kscd+NPqOZHOjj7E49EATxliWscia iE/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=WnI6vM4E; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id cc16si12818504plb.377.2018.12.10.22.48.00; Mon, 10 Dec 2018 22:48:15 -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=@gmail.com header.s=20161025 header.b=WnI6vM4E; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729851AbeLKDPU (ORCPT + 99 others); Mon, 10 Dec 2018 22:15:20 -0500 Received: from mail-oi1-f196.google.com ([209.85.167.196]:46721 "EHLO mail-oi1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728756AbeLKDPT (ORCPT ); Mon, 10 Dec 2018 22:15:19 -0500 Received: by mail-oi1-f196.google.com with SMTP id x202so10839913oif.13; Mon, 10 Dec 2018 19:15:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=icCcTnABKx19XzkVCBxNCuN9FZSKKDlNBlB7inNpAWE=; b=WnI6vM4EtFLsmvlpkrFiL57h0teb3ykEO8BRVA8MUBYBgjeI4OXG02VuGsMmiu80HS KkeALMKZ4dvxYGPPgzJd4CE/6o0Ny9HLlktdIo/CkIewR1JmKFqLeUDedL915jGjN3t4 xLwc646lR6sLzPwRkNc7lIY6MBwItD/www3O6rsoGec3P0VO8bsIlP2KnpGyepGLSN3Q DzRNEF1qcR8COQaCQyGgciuGSRewJmt2cI1sVwedLolqEoE1l9hUJz4nm4rTVk7/uojr zkJIKd4JhgK0Svmub/2sHwWoOaK175pztDhlgg8NYm4LlmrG3Ut/aWDmeYBRIYzk2Zco HB/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=icCcTnABKx19XzkVCBxNCuN9FZSKKDlNBlB7inNpAWE=; b=Fx89sC6ymoztSdh84FqKIlzMDJE1+Bln9vccjbtrrUFvhF2PtdAvlTC+lCtOvm4gSh jiPPbVcQmtUUkeyFzSnhbW0Wx/HZGZ0V/K5yWxswoTeGG4YJI8+heT0onE9W7KI2GptR 0I1/yjFTvrxkM7Ju9+V15iSMMT7cIIkyXQ2STQAvgeLcGuwYm0ADfx+mhGDXundSJuUy FB+0075LkP5lcHboUp3dv98Z1qfVug4y7XVxOUVkSav71MsRIFpss+VQ+RlQrehR80q2 0dpzqzPYE9Gliq1TnE+sZI74uIU/iU55rh1tTRDXXRDPfveo+SKav3rHL9cVbLok+xQq gRMw== X-Gm-Message-State: AA+aEWafprG/7+GsyqZzdyMjTWb525QWuDJSIGzhUfJAQABecZ+zLcX9 al4huJiCn5cgEjPlIucC3n9GAdRzevvue3Dgipy0UtA9 X-Received: by 2002:aca:dc46:: with SMTP id t67mr313491oig.279.1544498118769; Mon, 10 Dec 2018 19:15:18 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: "H.J. Lu" Date: Mon, 10 Dec 2018 19:14:41 -0800 Message-ID: Subject: Re: Can we drop upstream Linux x32 support? To: Andy Lutomirski Cc: "the arch/x86 maintainers" , LKML , Linux API , "H. Peter Anvin" , Peter Zijlstra , Borislav Petkov , Florian Weimer , Mike Frysinger , 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 On Mon, Dec 10, 2018 at 5:23 PM Andy Lutomirski wrote: > > 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. I have been posting x32 GCC results for years: https://gcc.gnu.org/ml/gcc-testresults/2018-12/msg01358.html > 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 This becomes less an issue with 64-bit time_t. > entry points -- these are the syscalls starting at 512. These enter > throuh 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. This is to share syscalls between LP64 and ILP32 (x32) in x86-64 kernel. > 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. X86-64 binutils and GCC can be used to build x86-64 kernel with x32 support. > 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. -- H.J.