Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1232400imu; Tue, 11 Dec 2018 15:24:03 -0800 (PST) X-Google-Smtp-Source: AFSGD/X7guboKfMw6pOiOASf3YYCB/sPa1IYa2e6TNZiA3ECEs/aP+lOkPVnLXgPf0aNUWpx+U0X X-Received: by 2002:a62:dbc2:: with SMTP id f185mr17980963pfg.235.1544570643912; Tue, 11 Dec 2018 15:24:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544570643; cv=none; d=google.com; s=arc-20160816; b=WaKrBh8NdkaPzA9PcNnQIJ+eGYyORBpaF6Wmun2KVOpweY14s+9WW7CfeDonvnd8Kf 29Tdepo+davkc6nsNYQDCW4ej8B+sSg9tmnccQmgvPPF7dKgVIzNIZB2BSzTqcl07R91 ED5/sTNDfNtGnD8YoJPp8bvbVUrJpHSeHg8eXSuEniM+dchw5dGTMFLsO0PsdZshVSNc 5D6u8dkFtK0c7bh36PNaQCud/ID/y9x00FNXTv2Bc7vTKx/0SVQzd9sAXGj/q3ZJ3YCs GY88vFGgi2RVfp4rdiYFN7CUpUsCX8euC7OWksZ2WO48+8rJ3rzeK54s40b2y+8VVhtM VTGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=BVHpeQ/yarhzgjKC3KSsY9Ws27cde7JDSM4paZ+FN50=; b=Ta8GsFi+GL6JpjGqOZoWLq3CeGgQoOYJTRUAUS8AYQoENtaFWYqYRkmMLrRte7frY4 0tPwrwAxRKVWf3ifjvrGTQu7FDRkPaahbx02aV6TBFT0CBUBt9vhqG06FVQoDchxtBKf mxnIf84alzkd57RIkZ+nFCo7e4Xpw7yq0KTML3fqdsDTVMHdXA8jqbM4UDs1ddKPzM5i jqe2nNXK1eshp6vWgXQutNig/GHIXTvmtzdHn8a3Ssm42N1zxFHToTIRIo/pQnrSNDGW itwBmeICKDljfJjLJ3G+xR8G2Fd1LcxFsbcmn1cHJSgQJss4F1PUqyHmvnGnTlBzoMit 84Mg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=SfbVneZd; 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 t186si14414106pfd.68.2018.12.11.15.23.47; Tue, 11 Dec 2018 15:24:03 -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=SfbVneZd; 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 S1726232AbeLKXW7 (ORCPT + 99 others); Tue, 11 Dec 2018 18:22:59 -0500 Received: from mail.kernel.org ([198.145.29.99]:57010 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726183AbeLKXW7 (ORCPT ); Tue, 11 Dec 2018 18:22:59 -0500 Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) (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 EAF0421473 for ; Tue, 11 Dec 2018 23:22:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1544570578; bh=eDAlSULV94RqEAFfgBQaVPmif4qoH/rkERvgXe2t4m8=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=SfbVneZd5Nun9ZpBsZuZsK3Gzjj5SMOJIhXDKSsFYkBqILA/XlmBOHokZuxov6/JG IYwqKXSZ7tVkwirR/fHw4Z91EgLfj4ov1FnH+8Ti6VCpYOLJSRTlxeUjl+Q1lIII/X icetzV4dxgcJLnYVQ5DuaxvaZM4IJzl5V828N2xA= Received: by mail-wm1-f50.google.com with SMTP id a18so4059770wmj.1 for ; Tue, 11 Dec 2018 15:22:57 -0800 (PST) X-Gm-Message-State: AA+aEWYhf0LiVgNsAN+VFXYyPtm9VPg3fr8u/G8nX7so/9LbNYGJ9Gq/ VwyXaqJrmd9BqbcmjJ1r+jeE94Pd0MuEkOJqPTiUXQ== X-Received: by 2002:a1c:864f:: with SMTP id i76mr4032598wmd.83.1544570576367; Tue, 11 Dec 2018 15:22:56 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Andy Lutomirski Date: Tue, 11 Dec 2018 15:22:43 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Can we drop upstream Linux x32 support? To: tg@mirbsd.de Cc: Linus Torvalds , Andrew Lutomirski , 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 2:14 PM Thorsten Glaser wrote: > > Note: please keep me in Cc because I am not subscribed. > > Linus Torvalds dixit: > > >I'm not opposed to trying to sunset the support, but let's see who compl= ains.. > > I will hereby complain. > > I=E2=80=99m using Debian/x32 on my main desktop at work, and do > occasionally help out with porting issues. It=E2=80=99s a good > way to make more out of 64-bit machines without going > all 64 bit; it=E2=80=99s also helped me find bugs in software. > It=E2=80=99s a nice architectural idea, and a way forward for > things that are constricted to 32 bits while opening > up stuff like 64-bit time_t without taking up half the > available CPU registers (while more than doubling the > number of the available CPU registers, too). Thanks for responding! I suppose the question is: are you enough of a user to justify the continued maintenance effort. > > I was also considering investing a nontrivial amount of > work into porting klibc to x32, since hpa does not wish > to do it himself. Thankfully I have only done a bit yet. > > Furthermore, x32 was the first of the many *64ilp32 > architectures; I know I=E2=80=99ve seen amd64ilp32 and at least > one other I don=E2=80=99t recall. It will have prototyped many > of the problems users of these will run in, and I=E2=80=99d prefer > to keep it (completely selfish because I don=E2=80=99t wish to > have to crossgrade a whole system yet again). it kind of seems like arm64's lesson is "don't do it like x32". There's some effort going on right now to make it possible to add syscalls without having to muck with every single architecture. I don't really want x32 to derail that effort. I suppose we could say that x32 stays but that it simply gets no new syscalls, but that seems a bit lame. Unfortunately, on x86, x32 really is a third ABI that is not compatible in a structure-memory-layout sense with the other two. What happens if someone adds a struct like: struct nasty_on_x32 { __kernel_long_t a; void * __user b; }; On x86_64, that's two 8-byte fields. On x86_32, it's two four-byte fields. On x32, it's an 8-byte field and a 4-byte field. Now what? I'm sure we could have some magic gcc plugin or other nifty tool that gives= us: copy_from_user(struct struct_name, kernel_ptr, user_ptr); where it automatically generates code for all possible ABIs to copy over the struct and dispatches dynamically based on the current syscall ABI, but I have trouble imagining anyone volunteering to actually do this work. Instead we get ad hoc fixes for each syscall, along the lines of preadv64v2(), which get done when somebody notices a problem. Linus, any advice here? --Andy