Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2389407imm; Sat, 9 Jun 2018 14:16:01 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLTGDJSm8LEKNnROHpe6O+mvSGII/+OodhESlME2FGIZ9/+bc3OK+IewJOlC6yuPzVtHIVS X-Received: by 2002:a17:902:1ea:: with SMTP id b97-v6mr12309031plb.58.1528578961324; Sat, 09 Jun 2018 14:16:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528578961; cv=none; d=google.com; s=arc-20160816; b=JaH3vtAm/iqy/BRAydAJMWO/icklK8LcsftRXmpzXv4EmEKqN3HJTkMcPkWpjWQR4C LE8ASutrSGKtTN9rymvRK9rQIhLhxCAOvvNXlw32bwJja+sdEL+K/SIzfQdpo9VKQbFz 0zshIc2zgRoCo/DpDFxD13eoSUq+LWpVU1J3U5DuOfuLgkREZ5Yn3iVxW41LIJAMxRL1 Owokeotph+Agil2C2lXnzQR5UyLE3yEybP66EL+xyquXy/JxRgwBwrPedoFdr7XBxHlG 3/EboLWwH+gE0EATHiMi6T0dTH/HvSdzod4c9qJDoIXuaq5nHNLHK3LsZDQbNbNfrThw FKFA== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date :arc-authentication-results; bh=nQZwdGRxKxQiNBDEo5zYbt406cZ/iBhqP7ml7P/tTmQ=; b=0v9ectnoFpfL9d/A7nWhv0idKrLdozec5y1mDTv9+68rsV3VX1ez9PFQhMK+pyu1/0 wJmNeAJSU5n/wX/64xh+tT8tmMwTy2xGUgFo0/tySWQ44H0j2/xsKbRVFbz5uQ68qg+7 8jdD4wwVhBwIsR2w+Bjl3/ADtUGXZfhFfRlH2OnepM/oDiHOFLCpmesC04WOZ/V4/OG5 frlIASXLWH168VGL0uALI5SNopQcWGj4WtOeY5Ges/S1ih6ZWHzvQpHJzzrMPz/64GEc aLyCvFaWZVKe3aXCa7uhB5NzbpfNTynL1B0Xs22HtH93mS5102BEVvDnf7pfaJsiEB2s xoWg== 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 z14-v6si11884055pgc.313.2018.06.09.14.15.10; Sat, 09 Jun 2018 14:16:01 -0700 (PDT) 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 S1753433AbeFIVOQ (ORCPT + 99 others); Sat, 9 Jun 2018 17:14:16 -0400 Received: from tartarus.angband.pl ([89.206.35.136]:55826 "EHLO tartarus.angband.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753381AbeFIVOO (ORCPT ); Sat, 9 Jun 2018 17:14:14 -0400 Received: from kilobyte by tartarus.angband.pl with local (Exim 4.89) (envelope-from ) id 1fRlBH-0002Sy-26; Sat, 09 Jun 2018 23:13:51 +0200 Date: Sat, 9 Jun 2018 23:13:50 +0200 From: Adam Borowski To: Palmer Dabbelt Cc: catalin.marinas@arm.com, ynorov@caviumnetworks.com, Arnd Bergmann , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-arch@vger.kernel.org, linux-api@vger.kernel.org, szabolcs.nagy@arm.com, heiko.carstens@de.ibm.com, philipp.tomsich@theobroma-systems.com, joseph@codesourcery.com, sellcey@caviumnetworks.com, Prasun.Kapoor@caviumnetworks.com, schwab@suse.de, agraf@suse.de, bamv2005@gmail.com, geert@linux-m68k.org, Dave.Martin@arm.com, manuel.montezelo@gmail.com, james.hogan@imgtec.com, cmetcalf@mellanox.com, pinskia@gmail.com, linyongting@huawei.com, klimov.linux@gmail.com, broonie@kernel.org, maxim.kuvyrkov@linaro.org, fweimer@redhat.com, Nathan_Lynch@mentor.com, james.morse@arm.com, ramana.gcc@googlemail.com, schwidefsky@de.ibm.com, davem@davemloft.net, christoph.muellner@theobroma-systems.com Subject: Re: [PATCH 04/24] 32-bit userspace ABI: introduce ARCH_32BIT_OFF_T config option Message-ID: <20180609211350.ilv43jl4k3byxscs@angband.pl> References: <20180608173207.nwoi25jee52gpdwy@armageddon.cambridge.arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Junkbait: aaron@angband.pl, zzyx@angband.pl User-Agent: NeoMutt/20170113 (1.7.2) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: kilobyte@angband.pl X-SA-Exim-Scanned: No (on tartarus.angband.pl); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 08, 2018 at 03:33:51PM -0700, Palmer Dabbelt wrote: > On Fri, 08 Jun 2018 10:32:07 PDT (-0700), catalin.marinas@arm.com wrote: > > On Wed, May 16, 2018 at 11:18:49AM +0300, Yury Norov wrote: > > > +config ARCH_32BIT_OFF_T > > > + bool > > > + depends on !64BIT > > > + help > > > + All new 32-bit architectures should have 64-bit off_t type on > > > + userspace side which corresponds to the loff_t kernel type. This > > > + is the requirement for modern ABIs. Some existing architectures > > > + already have 32-bit off_t. This option is enabled for all such > > > + architectures explicitly. Namely: arc, arm, blackfin, cris, frv, > > > + h8300, hexagon, m32r, m68k, metag, microblaze, mips32, mn10300, > > > + nios2, openrisc, parisc32, powerpc32, score, sh, sparc, tile32, > > > + unicore32, x86_32 and xtensa. This is the complete list. Any > > > + new 32-bit architecture should declare 64-bit off_t type on user > > > + side and so should not enable this option. > > > > Do you know if this is the case for riscv and nds32, merged in the > > meantime? If not, I suggest you drop this patch altogether and just > > define force_o_largefile() for arm64/ilp32 as we don't seem to stick to > > "all new 32-bit architectures should have 64-bit off_t". nds32 was obsolete even at the time of merging (it's just that Andes have a novel idea of actually supporting their old product lines!), thus it'll be a short lived port. It doesn't matter much if it carries legacy baggage -- especially that it has existing out-of-mainline users. Not so much for riscv32, which is designed and planned to be very long lived. And has no existing _Linux_ users. > We (RISC-V) don't have support for rv32i in glibc yet, so there really isn't > a fixed ABI there yet. From my understanding the rv32i port as it currently > stands has a 32-bit off_t (via __kernel_off_t being defined as long), so > this change would technically be a kernel ABI break. > > Since we don't have rv32i glibc yet I'm not fundamentally opposed to an ABI > break. Is there a concrete advantage to this? While modern userland tends to implement LFS support, it's still opt in for individual binaries at compile time. With my (userland) porter hat on, I can tell you that no matter how you preach about using sane build systems, a terrifying portion of packages manage to fail to pass such flags. Especially for lesser-known or new architectures -- you need to specifically add the flag for every new arch for every such piece of software. Its lack is also not so easy to spot in an automated way; an experimental and hacky attempt to detect them (IIRC by checking whether the program in question imports an open/lseek/etc symbol instead of open64) is here: https://lintian.debian.org/tags/binary-file-built-without-LFS-support.html 20511 ELFs in 5953 packages! If there's no 32-bit open() (ie, it's an alias to open64()), all these bugs are immediately fixed. Well, a program can still store file size in an int, but at least there's no interface problem. On the kernel side, you avoid the need to carry syscalls and structs for 32-bit variants. This gets you less complexity and a smaller kernel. Meow! -- ⢀⣴⠾⠻⢶⣦⠀ I've read an article about how lively happy music boosts ⣾⠁⢰⠒⠀⣿⡁ productivity. You can read it, too, you just need the ⢿⡄⠘⠷⠚⠋⠀ right music while doing so. I recommend Skepticism ⠈⠳⣄⠀⠀⠀⠀ (funeral doom metal).