From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.9 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9E7AFC43387 for ; Fri, 14 Dec 2018 14:15:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5AF72206C0 for ; Fri, 14 Dec 2018 14:15:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730130AbeLNOPH (ORCPT ); Fri, 14 Dec 2018 09:15:07 -0500 Received: from esgaroth.petrovitsch.at ([78.47.184.11]:2732 "EHLO esgaroth.tuxoid.at" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726554AbeLNOPH (ORCPT ); Fri, 14 Dec 2018 09:15:07 -0500 Received: from [10.68.100.236] (h10-gesig.woeg.acw.at [217.116.178.11] (may be forged)) (authenticated bits=0) by esgaroth.tuxoid.at (8.15.2/8.15.2) with ESMTPSA id wBEEDHuR001286 (version=TLSv1 cipher=AES128-SHA bits=128 verify=NO); Fri, 14 Dec 2018 15:13:18 +0100 Subject: Re: Can we drop upstream Linux x32 support? To: Rich Felker , John Paul Adrian Glaubitz Cc: Andy Lutomirski , X86 ML , LKML , Linux API , "H. Peter Anvin" , Peter Zijlstra , Borislav Petkov , Florian Weimer , Mike Frysinger , "H. J. Lu" , x32@buildd.debian.org, Arnd Bergmann , Will Deacon , Catalin Marinas , Linus Torvalds References: <70bb54b2-8ed3-b5ee-c02d-6ef66c4f27eb@physik.fu-berlin.de> <20181213160242.GV23599@brightrain.aerifal.cx> From: Bernd Petrovitsch Message-ID: Date: Fri, 14 Dec 2018 15:13:10 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <20181213160242.GV23599@brightrain.aerifal.cx> Content-Type: multipart/mixed; boundary="------------544822C287D28255C7136853" Content-Language: en-US X-DCC-URT-Metrics: esgaroth.tuxoid.at 1060; Body=17 Fuz1=17 Fuz2=17 X-Virus-Scanned: clamav-milter 0.97 at esgaroth.tuxoid.at X-Virus-Status: Clean Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is a multi-part message in MIME format. --------------544822C287D28255C7136853 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 13/12/2018 17:02, Rich Felker wrote: > On Tue, Dec 11, 2018 at 11:29:14AM +0100, John Paul Adrian Glaubitz wro= te: >> I can't say anything about the syscall interface. However, what I do k= now >> is that the weird combination of a 32-bit userland with a 64-bit kerne= l >> interface is sometimes causing issues. For example, application code u= sually >> expects things like time_t to be 32-bit on a 32-bit system. However, t= his IMHO this just historically grown (as in "it has been forever that way" - it sounds way better in Viennese dialect though;-). >> isn't the case for x32 which is why code fails to build. >=20 > I don't see any basis for this claim about expecting time_t to be > 32-bit. I've encountered some programs that "implicitly assume" this > by virtue of assuming they can cast time_t to long to print it, or > similar. IIRC this was an issue in busybox at one point; I'm not sure > if it's been fixed. But any software that runs on non-Linux unices has > long been corrected. If not, 2038 is sufficiently close that catching > and correcting any such remaining bugs is more useful than covering > them up and making the broken code work as expected. Yup, unconditionally providing 64bit time_t/timespec/timeval/...-equivalents with libc and syscall support also for 32bit architectures (and deprecating all 32bit versions) should be the way to go. FWIW I have ---- snip ---- #if defined __x86_64__ # if defined __ILP32__ // x32 # define PRI_time_t "lld" // for time_t # define PRI_nsec_t "lld" // for tv_nsec in struct timespec # else // x86_64 # define PRI_time_t "ld" // for time_t # define PRI_nsec_t "ld" // for tv_nsec in struct timespec # endif #else // i[3-6]68 # define PRI_time_t "ld" // for time_t # define PRI_nsec_t "ld" // for tv_nsec in struct timespec #endif ---- snip ---- in my userspace code for printf() and friends - I don't know how libc's react to such a patch (and I don't care for the name of the macros as long it's obviously clear for which type they are). I assume/fear we won't get additional modifiers into the relevant standards for libc types (as they are far more like pid_t, uid_t etc.). And casting to u/intmaxptr_t to get a defined printf()-modifier doesn't look appealing to me to "solve" such issues. MfG, Bernd --=20 "I dislike type abstraction if it has no real reason. And saving on typing is not a good reason - if your typing speed is the main issue when you're coding, you're doing something seriously wrong." - Linus Torvalds --------------544822C287D28255C7136853 Content-Type: application/pgp-keys; name="pEpkey.asc" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="pEpkey.asc" -----BEGIN PGP PUBLIC KEY BLOCK----- mQGNBFss+8cBDACpXlq0ZC9Qp8R+iFPx5vDPu12FpnmbbV8CwexVDchdizF2qz+A PFh12RrkE6yudI0r7peAIRePiSVYqv8XT82TpJM+tbTYk/MSQaPhcmz8jl1HaKv0 q8g5nKtr42qRsswU7Q2Sa6mWXaIdOisPYZ9eLZC9BDBhI/YrgdAwszyYJ1HUwNkp Dw5i4wW/SsIKrotCboYzbBjZfHbmDJr4dFYSoMg5jQVHD2Yz8fqNSoRyd7i/oicn 1bH/DjEkrmIu9YuptuHYmblpCRo5dLww7kgszNw12j8Iljp64uJ/uz5+asBUmRZM mGey82BB1DnIvy1v+GnbGWFIYy79/HeqdN+KbOgO/sXoqYKS5KJ6aSqWOLTQk6sv AnDN2PNF5jOB9ROCNwoQSH/YNEfMd/mQ5pGB0UJ4ykD0UnjW7DdXbVOwvwWzfHF7 HaZXB1NMpBzHxold3W19DThd4HECvXYZ6Au6p0WE8IfABS11CzbX7KJuD5Ua+xKG 3W05fMg5i0td2aMAEQEAAbQtQmVybmQgUGV0cm92aXRzY2ggPGJlcm5kQHBldHJv dml0c2NoLnByaXYuYXQ+iQHUBBMBCgA+FiEEgDWyyHEwksebo557hUq7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D57fEtl UWLXihAFcEiSx0i2AUAXYOcAEQEAAYkBvAQYAQoAJhYhBIA1sshxMJLHm6Oee4VK uwIQRyhmBQJbLPvJAhsMBQkB4TOAAAoJEIVKuwIQRyhmrGIL/3rsdQqaO3umXj9X Ts4nAme/2DVsEyGUFzeDllbzOKH7PsjJhbEsQRRE+kDk0tp2xbpVzNZ73wFhXFL+ zqa8tdMhYEjLUZ4ry/bg83yZH2bNj/jTii32AkvmL2zcYf0/knuAAAypdfTM4K6S PVlwOo09Drkiz/SDXyvpSG9GdCZLVR/HbQpsob0JddcouWwliATRrnUETb/MN6MO WI4687r1wi4Kn28CHydWA5YONvFyb7BJZRHiLQnJwlh7dgBtOSCeZClrKfhIBFB2 YgfBcgmHnpYkzyBGdUTnrrlmiMeuxZqG2SzwswRMACYqUFoe+3E7RZQX5ym17oUP Kat5L8uZbd2+TlbICXnxwTadBKDvk8qxjLSwzthoHlmM6zeFekQdq67aiBWfa9oV 6tljJtvE9QREo+hDjQaiVmzHqeB8pMGVHWzAGJzvxFuXMaKzUI8vWDH5jaht0Sqn xHyhVz8+rEsLoB67PBuY3GLecTeQ3rr52BVMzfNRPdSyVHESzw=3D=3D =3Dv2Yn -----END PGP PUBLIC KEY BLOCK----- --------------544822C287D28255C7136853--