Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp35125855rwd; Mon, 10 Jul 2023 03:01:09 -0700 (PDT) X-Google-Smtp-Source: APBJJlFV/yBy0/Qduo8Cx0Dg+8pGvbkL4vBGUUix3oSoegQIhPK1tstge5EWOuOwTt6fBIYeiF4U X-Received: by 2002:a17:90b:120e:b0:263:f681:6a6d with SMTP id gl14-20020a17090b120e00b00263f6816a6dmr12636733pjb.19.1688983268830; Mon, 10 Jul 2023 03:01:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688983268; cv=none; d=google.com; s=arc-20160816; b=MbetH2WZbTu2q+OpP20ftKLXCTiL9VvMuDfP6bZTRYLwUP/W2QhIM0k90h8ht3Wapx gwXm/0mGVDDZOyNloZuhdsBKTj6Rp+X0sCAqKeDC0Dzkg0h2VghCaUUGIxtyaoyuzIQ9 ENIeC4nAf7S50cbvGky66n4i1DW5QhKxK7qqQCNoDhQGiu5Uoyljdm/IuZPGo25iHLf7 wr9x4CyiSyK+qS1jJQID9eAnuWebfWxWKfFNQTs6yV1yjFBc22UTh56i7FRQtrHVdhNl EvO9X/+L8+kvrORLK39dfDS++an1rmMGrZJSFvu516xIuM6V0EnISMONdwvLANbkkosZ FPHg== 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:date:subject:cc:to:from:dkim-signature; bh=M/osjD9TYsl78xw1yJjcYG47OydWNSvtM9gavbfj5Ks=; fh=+t+G/OXZaGbelVlx/PAQKy/ssq96RZ9Njlv0n65gx60=; b=Xdo4qk2A0tWk3mjB29e0B2Mi0oUwXaVgGYXOeutvlGOcA7XRAN6pABNzu6fYW9IYbe +svMEz7y2LfdrMRSvsDQDUWMOSIhfpWdpSdBnDzhn7F94Naml4TfI/nPrATNSc0dhswB IePIJG7TDstdBvelqBnkQUNzyymMfMv5VqWaguJcivEmbTUT1GEK11EzTPXJ4jinTFKB qrCB4/0lFsNv7LeFQyxzaWlzRAvsvZRxs03+0YzeNKz2KADCBsYjsP83M5vksl0ZqS9P wI+xCMh3rpLABprvKmUl57M9ti7ko0DmjF4u+vqX1XXQVZC5YwXvIDLlUVXr70aD/lfw wbzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=XkS0vtoR; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i194-20020a636dcb000000b0054febc069d3si8986388pgc.19.2023.07.10.03.00.56; Mon, 10 Jul 2023 03:01:08 -0700 (PDT) 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=@microchip.com header.s=mchp header.b=XkS0vtoR; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232750AbjGJJjc (ORCPT + 99 others); Mon, 10 Jul 2023 05:39:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54318 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232562AbjGJJjD (ORCPT ); Mon, 10 Jul 2023 05:39:03 -0400 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 37DC010D8; Mon, 10 Jul 2023 02:36:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1688981807; x=1720517807; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=9rB6ZsE5tPURsFe8y5ewohv7eTrARShb30ruo1UoOps=; b=XkS0vtoRno4p59RD/ecud2kUyt1riYYmLeXjd5e41x02HW4SY9y8dJq/ L6BrQpEKsULVOOcIwdxWmJpRoonRP1DEbPpv0zg6yzmtZzHy58/zHW1Io lP6TLC0IGesbAmtl7qAf67pmYZYwrFN9QKwQ6BzvkEUMBMWYVrRZxj0gK myMxtqu5lhwPEnnovlDZdBysYzfN7njp/mAZ22fh0rIBD9WYtH0KtANEm D4qMDoE/wT9HxssNcyVfy1jSIx0T4KzLzTMT5yw5XWX20lLgyV2DqbIcc jT6TdIsjbuZZnuhnxpSnu/NV1KBSVPO79sfp8jwF/5um7ej0ceqqjRVNJ w==; X-IronPort-AV: E=Sophos;i="6.01,194,1684825200"; d="scan'208";a="234573261" X-Amp-Result: SKIPPED(no attachment in message) Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa1.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 10 Jul 2023 02:36:28 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Mon, 10 Jul 2023 02:36:27 -0700 Received: from wendy.microchip.com (10.10.115.15) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.2507.21 via Frontend Transport; Mon, 10 Jul 2023 02:36:25 -0700 From: Conor Dooley To: CC: , , Rob Herring , Krzysztof Kozlowski , Paul Walmsley , Albert Ou , "Jonathan Corbet" , Andrew Jones , "Heiko Stuebner" , Evan Green , Sunil V L , , , , Subject: [PATCH v4 00/11] RISC-V: Probe DT extension support using riscv,isa-extensions & riscv,isa-base Date: Mon, 10 Jul 2023 10:35:35 +0100 Message-ID: <20230710-equipment-stained-dd042d66ba5d@wendy> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2986; i=conor.dooley@microchip.com; h=from:subject:message-id; bh=9rB6ZsE5tPURsFe8y5ewohv7eTrARShb30ruo1UoOps=; b=owGbwMvMwCFWscWwfUFT0iXG02pJDCmrL1zlWb+3V/50SaXq/huKDB8Usyvkp3i5qi+/ymG78oX6 +kznjlIWBjEOBlkxRZbE230tUuv/uOxw7nkLM4eVCWQIAxenAExksTrD/9g/CvNNd37zqYub35Tscv q/+UyjYycbXKeFe12v8tJRKmP4X7g5fOnFvbsNO3Sv6r3b9b3xymKnbpFIO4/QGevP5eRsYgEA X-Developer-Key: i=conor.dooley@microchip.com; a=openpgp; fpr=F9ECA03CF54F12CD01F1655722E2C55B37CF380C Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_NONE, 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 Hey, Based on my latest iteration of deprecating riscv,isa [1], here's an implementation of the new properties for Linux. The first few patches, up to "RISC-V: split riscv_fill_hwcap() in 3", are all prep work that further tames some of the extension related code, on top of my already applied series that cleans up the ISA string parser. Perhaps "RISC-V: shunt isa_ext_arr to cpufeature.c" is a bit gratuitous, but I figured a bit of coalescing of extension related data structures would be a good idea. Note that riscv,isa will still be used in the absence of the new properties. Palmer suggested adding a Kconfig option to turn off the fallback for DT, which I have gone and done. It's locked behind the NONPORTABLE option for good reason. In v2, I've also come up with a more reasonable name for the new function I added & fixed up various comments from Drew and Evan. In v3, there's the new commandline option that Drew suggested. I have Also picked up a patch from Palmer that adds more helpful prints where harts fail the checks in riscv_early_of_processor_id(), and I've sprinkled a few more of those prints in my new additions to the function. v4 just rebases on v6.5-rc1 and fixes the nommu build issue due to a missing __init. Cheers, Conor. [1] (it's in v6.5-rc1 now) CC: Rob Herring CC: Krzysztof Kozlowski CC: Paul Walmsley CC: Palmer Dabbelt CC: Albert Ou CC: Jonathan Corbet CC: Andrew Jones CC: Heiko Stuebner CC: Evan Green CC: Sunil V L CC: linux-doc@vger.kernel.org CC: linux-riscv@lists.infradead.org CC: devicetree@vger.kernel.org CC: linux-kernel@vger.kernel.org Conor Dooley (9): RISC-V: drop a needless check in print_isa_ext() RISC-V: shunt isa_ext_arr to cpufeature.c RISC-V: repurpose riscv_isa_ext array in riscv_fill_hwcap() RISC-V: add missing single letter extension definitions RISC-V: add single letter extensions to riscv_isa_ext RISC-V: split riscv_fill_hwcap() in 3 RISC-V: enable extension detection from new properties RISC-V: try new extension properties in of_early_processor_hartid() RISC-V: provide Kconfig & commandline options to control parsing "riscv,isa" Heiko Stuebner (1): RISC-V: don't parse dt/acpi isa string to get rv32/rv64 Palmer Dabbelt (1): RISC-V: Provide a more helpful error message on invalid ISA strings .../admin-guide/kernel-parameters.txt | 7 + arch/riscv/Kconfig | 18 + arch/riscv/include/asm/hwcap.h | 17 +- arch/riscv/kernel/cpu.c | 179 +++--- arch/riscv/kernel/cpufeature.c | 519 ++++++++++++------ 5 files changed, 437 insertions(+), 303 deletions(-) -- 2.40.1