Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2262582imu; Fri, 14 Dec 2018 08:15:48 -0800 (PST) X-Google-Smtp-Source: AFSGD/WNkT12/jCsuQUOMJlUAAp6yGXbO4/5ot2j+G0KeiZbvG+4mAD+PRr70XqyUX3QM5X1MjP1 X-Received: by 2002:a62:3ac1:: with SMTP id v62mr3279443pfj.87.1544804148887; Fri, 14 Dec 2018 08:15:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544804148; cv=none; d=google.com; s=arc-20160816; b=E8scqFRf/6QDdPVUrV5istL8smP0tW+h3JhTFtcWr1Ihmbjfa3Dg421cOpy9vYc372 F7sOvWqSYwtHqhvjPLHGRaeifh51UjRUkvTvFYTVyMz+Y2bTAiGtF3U/TH95hE6tlFLy JTjoWfSjjQH7Maux497dDEEBSScrxS98gSrtQvjNxUYUHhkMj0GRscYAxwRNPwC15Aer xqv75RnwaMDJw0XCzKY/lcNBvSYW6PfqvTZSr7zD9au9u/A0KjGmR/r64UgP+/KVXf3o sty484Pr52sVVwgBZOsoNNXYWAPkgjdHKa+8tc83tFkp2mFmkRtbq2QHdFz/qmUscxMq vm1g== 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=U+ea3u7IfpLNmhKjbtETr6LkfD80El1F0lTqdsk5KqM=; b=R490EyRW6oMHG7LKv1HpC7VR6EJ2Z7iCq6+uIpYxY8igDURDu023cydeU77c5aHM2D KoX0XLDCoK8PkfP/ffxZqz4ckfPTqj27HUs6CUY+NjUXWvq7otJmtvydiP4LcfV5Gndx wmm+rh5e+YPSGJCIOHbiYBVDcbrkdJTsVnGyqB1I1mBtSFRCdQodcAEcMRL+YThJGJ0G i16nN4dseEIsdUg+B5eW8YKHgIuRjVC+Vh5scw8S+44AU+WQPWzAnJiPtTCLb1j5ziDY 4ck+8PSttvY37vz1ZFBPkvmcz2ewImYImLSYKUrmxhvwY0KpZwLtlHMX+k/gHYkxHbsx yeig== 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 i1si4352516pgi.480.2018.12.14.08.15.25; Fri, 14 Dec 2018 08:15:48 -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 S1729623AbeLNQNd (ORCPT + 99 others); Fri, 14 Dec 2018 11:13:33 -0500 Received: from 216-12-86-13.cv.mvl.ntelos.net ([216.12.86.13]:58994 "EHLO brightrain.aerifal.cx" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726520AbeLNQNd (ORCPT ); Fri, 14 Dec 2018 11:13:33 -0500 Received: from dalias by brightrain.aerifal.cx with local (Exim 3.15 #2) id 1gXq5X-0004dk-00; Fri, 14 Dec 2018 16:13:19 +0000 Date: Fri, 14 Dec 2018 11:13:19 -0500 From: Rich Felker To: Florian Weimer Cc: Catalin Marinas , Andy Lutomirski , tg@mirbsd.de, Linus Torvalds , X86 ML , LKML , Linux API , "H. Peter Anvin" , Peter Zijlstra , Borislav Petkov , Mike Frysinger , "H. J. Lu" , x32@buildd.debian.org, Arnd Bergmann , Will Deacon Subject: Re: Can we drop upstream Linux x32 support? Message-ID: <20181214161319.GX23599@brightrain.aerifal.cx> References: <20181212165237.GT23599@brightrain.aerifal.cx> <20181213124025.bczxzj6ez34joo6v@localhost> <20181213155744.GU23599@brightrain.aerifal.cx> <87o99pl8es.fsf@oldenburg2.str.redhat.com> <20181213162828.GW23599@brightrain.aerifal.cx> <875zvwibbp.fsf@oldenburg2.str.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <875zvwibbp.fsf@oldenburg2.str.redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Dec 14, 2018 at 12:42:34PM +0100, Florian Weimer wrote: > * Rich Felker: > > > On Thu, Dec 13, 2018 at 05:04:59PM +0100, Florian Weimer wrote: > >> * Rich Felker: > >> > >> >> If the compiler can handle the zeroing, that would be great, though not > >> >> sure how (some __attribute__((zero)) which generates a type constructor > >> >> for such structure; it kind of departs from what the C language offers). > >> > > >> > The compiler fundamentally can't. At the very least it would require > >> > effective type tracking, which requires shadow memory and is even more > >> > controversial than -fstrict-aliasing (because in a sense it's a > >> > stronger version thereof). > >> > >> It's possible to do it with the right types. See _Bool on 32-bit Darwin > >> PowerPC for an example, which is four bytes instead of the usual one. > >> > >> Similarly, we could have integer types with trap representations. > >> Whether it is a good idea is a different matter, but the amount of > >> compiler magic required is actually limited. > > > > If you do this you just have LP64 with value range restricted to > > 32-bit. > > You have to a type different from long int for the relevant struct > fields. This type would have zero padding. Just upthread (Message-ID: <20181212165237.GT23599@brightrain.aerifal.cx>) I explained why this does not work: >>> If on the other hand you tried to make just some pointers "wide >>> pointers", you'd also be completely breaking the specified API >>> contracts of standard interfaces. For example in struct iovec's >>> iov_base, &foo->iov_base is no longer a valid pointer to an object of >>> type void* that you can pass to interfaces expecting void**. Sloppy >>> misunderstandings like what you're making now are exactly why x32 is >>> already broken and buggy (&foo->tv_nsec already has wrong type for >>> struct timespec foo). Rich