Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp1473682pxp; Thu, 10 Mar 2022 06:12:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJxztA741ivi+dlmkjnyDLKpT0ZU0yiWMLqOAAgbohzMv+wIVH8KKpIFg7XyqMuML8L/xT+/ X-Received: by 2002:a05:6402:cb:b0:410:8094:872b with SMTP id i11-20020a05640200cb00b004108094872bmr4646500edu.378.1646921574419; Thu, 10 Mar 2022 06:12:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646921574; cv=none; d=google.com; s=arc-20160816; b=uZH8SCNShB4BP6jVD+WzI0LkyGzrQXlVdP46xgox8lpqxpKZmNuo/hY2fmaNMAke1V GsCFsn18lAMMvB906wVJYwGpZlySd0ji6RQZWm+2iMzM0hvpdS1qpZAtjUk1m5C8EWsa 6H9qvxnv9tISOT1MnDopX7y8th+mWp0R2CPf1wVR06jLOWrQaxQWT+qqp48KWiPtcWiq a51XjoGXfBKB93eoKF2BYYAxyoM5MfzNvHnI/DO7QpGHyYpUQltdTy0Iccd64+kGSU6a boavlORs3Y45JDiv2Qhg2aiLQVY0LsSNt7+P3AMx52T3TMFBHdNMhu2LPA9ywsxwldGK 8nAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:to:from:cc:in-reply-to:subject:date:dkim-signature; bh=pB6gK1JUXPe0uL+qrSzcwuxnE8NCS9QIX0sZYbeurTo=; b=aFwnKV7O8Fw5Co3r4kKcITXxw6njIjZgZ/IsYRNEbfaDCu9p7pbqeWzdG2JLMhyuXd H6YYRFzJjCyvyNM5jRF9320KHPNvs9yu8kjerR8MXKLWxLI+Lwd2CaMmvoEvlNmtPqiI 6oj6wx+CDdpfx0GfUynaH5xQa7ABZnoAzYetCYc2nDU8ONTEzPDo1ER55RShsXNmsfkd GpkIVtxtrfGA8CXIqXrs1KXictCKqq+MkdESSTPsfsn9FNWs2DqWFrWF3zqrAPtFzXtD ytl0l+aiIWUxSsK3TiUuiPS79MEcV2xibJ9YfjDJlU+uawUhK44j2tSFIFJ6+MA6UD+Q qhEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@dabbelt-com.20210112.gappssmtp.com header.s=20210112 header.b=lAb20Kih; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r29-20020a50c01d000000b00412d49c74e2si3100663edb.396.2022.03.10.06.12.30; Thu, 10 Mar 2022 06:12:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@dabbelt-com.20210112.gappssmtp.com header.s=20210112 header.b=lAb20Kih; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231806AbiCJHfb (ORCPT + 99 others); Thu, 10 Mar 2022 02:35:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56150 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240101AbiCJHf2 (ORCPT ); Thu, 10 Mar 2022 02:35:28 -0500 Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [IPv6:2607:f8b0:4864:20::102d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 529247892C for ; Wed, 9 Mar 2022 23:34:28 -0800 (PST) Received: by mail-pj1-x102d.google.com with SMTP id v4so4499226pjh.2 for ; Wed, 09 Mar 2022 23:34:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dabbelt-com.20210112.gappssmtp.com; s=20210112; h=date:subject:in-reply-to:cc:from:to:message-id:mime-version :content-transfer-encoding; bh=pB6gK1JUXPe0uL+qrSzcwuxnE8NCS9QIX0sZYbeurTo=; b=lAb20Kihrehyn5GddRYNlLZde6SVbtLD6FzerIMv7eZvtL3sbdj+73S+tLhpNmw5UJ tshNHs/Mi7cANEP1Zj80aQ/N5B0sz2O5kjImG8/+T3cwq+8FG2XPkFmaHqa6/9chZ7g8 /nOihdYxiR7PaKacSgWlLKnP207Jz1eV2gEFGOiGLn/I6vzc+PrfyUx+6/GNK9XFM73f r97IA57ckoafcvjVae9/dGfBjF2FeWg5v/Io4Cgwhgsompar72JizyqqaqRszXs+wYz/ Hp9Cb3jtY2nMfID2JLvQRcs/WJdmvo2czFLzJQXcB1SgseLV+79NKd+T/7EjuUJzpXRp fgZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:subject:in-reply-to:cc:from:to:message-id :mime-version:content-transfer-encoding; bh=pB6gK1JUXPe0uL+qrSzcwuxnE8NCS9QIX0sZYbeurTo=; b=aTkp9Vn0n6kROyZbRCya/pKPRS/6oUFZd1Y3ttXA4EcQ+XGtuBGUtwWf2W3PU6ik6P b+VKhz9YyyYQNDRBNayxPaFw8cR143v9tMD3BY9SabsZPt2lMDCDb5aIqx1EnMXsdoBj /atIZIgpxV3QKeAria8SSgp7lCScb9kjfOjNCry2z2HUuA476RXMNfPrPPZfd86JgCLI e+UAnpHAwSYyQcK3iy6fxqOgUXTVcHF2Wa6bZxdayJTVBp7nHJSdM273b7S3Buj98x7Y qdHd5Ncqp2DmuxnfRTWeOBCToQXmutszm4YEN+Ge0CfTc7VnbvH+QH2rJaWftpGt8E8e ctcQ== X-Gm-Message-State: AOAM530YLG7qrJQAYjGLevZCQuVMnDULeD9w844MSGTWUcyU0VuDSvIL +K/rPoyynsRFBChid5+kPpCnoA== X-Received: by 2002:a17:902:cf08:b0:151:9d28:f46f with SMTP id i8-20020a170902cf0800b001519d28f46fmr3544457plg.53.1646897667710; Wed, 09 Mar 2022 23:34:27 -0800 (PST) Received: from localhost (76-210-143-223.lightspeed.sntcca.sbcglobal.net. [76.210.143.223]) by smtp.gmail.com with ESMTPSA id e4-20020a17090ab38400b001bf9519fe8bsm7946653pjr.38.2022.03.09.23.34.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Mar 2022 23:34:27 -0800 (PST) Date: Wed, 09 Mar 2022 23:34:27 -0800 (PST) X-Google-Original-Date: Wed, 09 Mar 2022 23:33:55 PST (-0800) Subject: Re: [PATCH] riscv: Work to remove kernel dependence on the M-extension In-Reply-To: CC: michael@michaelkloos.com, Paul Walmsley , aou@eecs.berkeley.edu, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org From: Palmer Dabbelt To: Arnd Bergmann Message-ID: Mime-Version: 1.0 (MHng) Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 09 Mar 2022 02:02:27 PST (-0800), Arnd Bergmann wrote: > On Wed, Mar 9, 2022 at 6:28 AM Michael T. Kloos > wrote: >> >> Added a new config symbol RISCV_ISA_M to enable the usage of the >> multiplication, division, and remainder (modulus) instructions >> from the M-extension. This configures the march build flag to >> either include or omit it. >> >> I didn't find any assembly using any of the instructions from >> the M-extension. However, the BPF JIT is a complicating factor. >> Currently, it emits M-extension instructions to implement various >> BPF operations. For now, I have made HAVE_EBPF_JIT depend on >> CONFIG_RISCV_ISA_M. >> >> I have added the supplementary integer arithmetic functions in >> the file "arch/riscv/lib/ext_m_supplement.c". All the code >> contained in this file is wrapped in an ifndef contingent on the >> presence of CONFIG_RISCV_ISA_M. >> >> Signed-off-by: Michael T. Kloos > > The patch looks fine to me, but I increasingly get the feeling that the > entire platform feature selection in Kconfig should be guarded with > a global flag that switches between "fully generic" and "fully custom" > builds, where the generic kernel assumes that all the standard > features (64-bit, C, M, FPU, MMU, UEFI, ...) are present, the > incompatible options (XIP, PHYS_RAM_BASE_FIXED, > CMDLINE_FORCE, BUILTIN_DTB, ...) are force-disabled, > and all optional features (V/B/P/H extensions, custom instructions, > platform specific device drivers, ...) are runtime detected. That'd be wonderful, but unfortunately we're trending the other way -- we're at the point where "words in the specification have meaning" is controversial, so trying to talk about which flavors of the specification are standard is just meaningless. I obviously hope that gets sorted out, as we've clearly been pointed straight off a cliff for a while now, but LMKL isn't the place to have that discussion. We've all seen this before, nobody needs to be convinced this leads to a mess. Until we get to the point where "I wrote 'RISC-V' on that potato I found in my couch" can be conclusively determined not compliant with the spec, it's just silly to try and talk about what is. > At the moment, those three types are listed at the same level, > which gives the impression that they can be freely mixed. > > Arnd