Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp2213241ybk; Mon, 11 May 2020 15:06:47 -0700 (PDT) X-Google-Smtp-Source: APiQypLQUIv1RHUS2k1EHu7JmRuVM/gg1luT8W2YNQSNrJ0DgP4tHgZN/qMbjPespiS9XpqXbEAr X-Received: by 2002:a17:906:a856:: with SMTP id dx22mr12721906ejb.255.1589234807827; Mon, 11 May 2020 15:06:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589234807; cv=none; d=google.com; s=arc-20160816; b=wzmQA1EP7x8Ip38zL/3dHW7vACjIk/G6HRePUQ4SpZe5A2Oc1M1G/WQ6pZdIZ02ZYd A27qsRXzDuLFqVJn8Eodg61e66rvAiyJisZSa3NX/ohk47Jq1SPALTWKez62nKBWxyo/ meSnJ6fGTrEH9HlVFE45m/SW0+TFeNbd1cSNHRVNn7OPwnZMCXbnbWiTpX6ZpdnrS+ol N+/sTQFSbJuAgYITFK8vUPuu8W+k2yJdb7WH5XFBgFVgF/EoZDEOxEjKYir6U7AVb4tT 2Pgk5A/gdAZOlnmcc7XCWSLy0sXOkHZAlHvJFYm+9mYcLBGvLwniyJzQd9ACpDRKQ8qI gl2w== 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:mime-version :message-id:to:from:cc:in-reply-to:subject:date:dkim-signature; bh=QcqAv7P8UvANEMfeZSVs1Z4C8izH07RPJiqXxjw9hi4=; b=F0iUBr9yEkSLIpQHWfw2lLHETwW0yvpZEz6+VU++bD23jr53y74YFT/BP/xoqWlXp1 Z6ZtrylMs9iAqQ3rI4Oir5nxLKS200yIz3LhCKAcV40N+VDPFyulGCN6AWCHwb8aI+9H ESxC9X/IFtJYqCcLP/6BOWvX0ivfZ8qGtQOHurLXDSLTw07tg0FcrVIyr2r1Z+D3MR7v yifWN4zDB5n/XeooMdHPU5g5rkct3tBAoX7NLr/0m+LtljkJHHAMbRJ+CG40REi+DjE/ DFxdPDF9gYTs2zyHXsvas9cgjAhhwiREPBaGlhkw967OiLS0cZVTNjXmdt7WpEibCnI3 zuDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@dabbelt-com.20150623.gappssmtp.com header.s=20150623 header.b=zGg51pqr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z10si6547151ede.211.2020.05.11.15.06.24; Mon, 11 May 2020 15:06:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@dabbelt-com.20150623.gappssmtp.com header.s=20150623 header.b=zGg51pqr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727942AbgEKWCp (ORCPT + 99 others); Mon, 11 May 2020 18:02:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53944 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725860AbgEKWCp (ORCPT ); Mon, 11 May 2020 18:02:45 -0400 Received: from mail-pl1-x642.google.com (mail-pl1-x642.google.com [IPv6:2607:f8b0:4864:20::642]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D80EBC061A0C for ; Mon, 11 May 2020 15:02:43 -0700 (PDT) Received: by mail-pl1-x642.google.com with SMTP id u10so4493491pls.8 for ; Mon, 11 May 2020 15:02:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dabbelt-com.20150623.gappssmtp.com; s=20150623; h=date:subject:in-reply-to:cc:from:to:message-id:mime-version :content-transfer-encoding; bh=QcqAv7P8UvANEMfeZSVs1Z4C8izH07RPJiqXxjw9hi4=; b=zGg51pqrgFWI4OxU/iBR6WpE4sKCxEHd98DVJAj06WnuF8itLlYSDkEXZHNlI1oJwo 0F3EmlaYIOvLA9q4llDdhbRV5qpvz9ykQM9YaWkc3Bem2PK+yFOC0jYYaw07WD6z1KbQ N4EMyQ0PnZiTLMG1GrhpN54g+PjvA2JT05NfXNEYMZ7CiI6VFr7vJhkcUfJRagIlnnzt kjUIggrjl+kqrhLgJp/VSrWr7UXg/dCDTf+Cvnk557yZTibYwa1j4i6Iold0jx+iN3P5 zUsqPy8qEFSXISNg/to6m62QxJJT61C2/1vRcfufsllpzjwb9Zu3gF8gtqTIkR4+OqVH vLyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:subject:in-reply-to:cc:from:to:message-id :mime-version:content-transfer-encoding; bh=QcqAv7P8UvANEMfeZSVs1Z4C8izH07RPJiqXxjw9hi4=; b=jYe61jJvihZtzOm9pfAks5xCzM+5GSK6pIQIdZ9aRkxjHbc6V1bestoAxO8WUrcvFN QpiZBiRxMcS7S/hRuWru2t2cUXDDA33fkZhXB1ZXKyddAeh5bAa8x8mhSOjP7DI7dVlb iaCP47OdNlMGLBaTIw/PQQKmQOeUa08nrOwLsZjiQLfZpm1oIMA5FFtgPd2sUSDyQ1Vg j2btL9tZipphP4BO4tVEyboYRmI6mF6jE2uN7Bh9LA6b1VkoIFqfuu2/fLK7N7Nju+TJ HoSz9dI0k7lhhxL4c92sRUGrwqpozSuufhoqaCtCIHAYqAX3vf5DBTKtYSHKVqqtkVBQ CNEQ== X-Gm-Message-State: AGi0PuZppNCugDdbMcx9YA3Vm7/bLegrOZo992pqNOhzJLkvvJxXzNoq fr13fCCsHmj6fBK0ghipp+IUrA== X-Received: by 2002:a17:902:8697:: with SMTP id g23mr16808107plo.306.1589234563112; Mon, 11 May 2020 15:02:43 -0700 (PDT) Received: from localhost (76-210-143-223.lightspeed.sntcca.sbcglobal.net. [76.210.143.223]) by smtp.gmail.com with ESMTPSA id a13sm50193pjm.38.2020.05.11.15.02.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 May 2020 15:02:42 -0700 (PDT) Date: Mon, 11 May 2020 15:02:42 -0700 (PDT) X-Google-Original-Date: Mon, 11 May 2020 15:01:02 PDT (-0700) Subject: Re: [GIT PULL] RISC-V Fixes for 5.7-rc5 In-Reply-To: CC: schwab@suse.de, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org From: Palmer Dabbelt To: Linus Torvalds Message-ID: Mime-Version: 1.0 (MHng) Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 11 May 2020 12:04:09 PDT (-0700), Linus Torvalds wrote: > On Mon, May 11, 2020 at 1:13 AM Andreas Schwab wrote: >> >> On Mai 09 2020, Linus Torvalds wrote: >> >> > glibc depending on kernel version is WRONG. It's bogus. You can't do >> > feature detection based on kernel version, it's fundamentally broken. >> > >> > So I really would prefer to see glibc fixed not to do that stupid >> > thing, instead of adding pointless vdso notes to the kernel. >> >> I'm not aware of any discussion or bug report on this issue. Any >> pointer? > > We've discussed it informally several times, but that really is just > "I remember mentioning this before" than anything else. > > Basically, testing kernel versions is pretty much always a bug. You > _will_ get it wrong, sometimes spectacularly (we've had programs > literally break when the major number changed, because they only > checked the minor number). > > Other times you'll get it wrong in subtler ways - testing for features > by version number is wrong, if that feature is then disabled by a > config option (a lot of new kernel features work that way). > > Or, the already mentioned "distros often port back features to their > older kernels". The latest example of that is Wireguard being ported > back to Ubuntu 20.04 - using kernel version 5.4, even though WG was > actually upstreamed in 5.6. > > So the whole "look at kernel version to determine if it does X" is > simply fundamentally wrong. > > Why is glibc doing it in the first place? Is it some historical thing > that is simply irrelevant on RISC-V simply because RISC-V doesn't have > that kind of history, perhaps? I don't know if Andreas had something else in mind, but there's actually a RISC-V specific reason we _do_ need this: the 64-bit time_t conversion. Essentially what happened is that I screwed up by merging the rv32 Linux port before the rv32 glibc port. As part of the rv32 upstreaming process we realized that it would be better in the long term to just drop the 32-bit time_t support from the kernel, but at that point we already had the Linux UABI defined. We ended up changing the user ABI on 32-bit systems as of d4c08b9776b3 ("riscv: Use latest system call ABI"). We didn't have any rv32 userspace at that time (and we still don't have glibc or any Linux capable hardware), so we figured it would be OK to break the rules and change the ABI. The obvious result is that 32-bit userspace won't work with old kernels, so I'd assumed this was being used to quickly sanity check the kernel. Andreas would know better than I do, though, as I don't really do much glibc stuff any more. > > Linus