Received: by 2002:a05:7412:2a91:b0:fc:a2b0:25d7 with SMTP id u17csp155027rdh; Tue, 13 Feb 2024 12:22:26 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUWESACBxGx+uVLbEmOa/j5/1EWwwTDnXPh7dlYXsVa1bR3rdTTfy+qi36EWCx0CLdd57R5aEWji6mBffww45GosqX6Ryjmg6OO94nVTw== X-Google-Smtp-Source: AGHT+IG1X5NSshcpCTiSavAYFqBBISzrnHTcALX+jfoBbEx4SlB+MfJTv4gxG9KEamApAjupjMuz X-Received: by 2002:ac8:5f91:0:b0:42d:a8a1:df93 with SMTP id j17-20020ac85f91000000b0042da8a1df93mr485807qta.4.1707855746304; Tue, 13 Feb 2024 12:22:26 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707855746; cv=pass; d=google.com; s=arc-20160816; b=aiBol8izJN7W+vEaB5GzratgU/B60pgBr82OEwyGiQLcKjsxVJS6cThW720aNLWmA5 d2AcFiIrtrKsXM+5ngOVDC39GYo5CrXjl0sHh9cOaaOOC/P4PwJLv3z7B59uh9V0iZLy CfbgRf96mE3PNZegT04ANI5kx3pksKUB/mZCCJpJVxspHX6Eb12jrc1Gfn89k1jqog4x NXdckjDeigH1eQ8asHbzAc8DdlfSf1TrykVOeTUiAx52KPJC2OBx70Ub67ULtCJNhWb2 duAvFS+xeBx9CClQIdyLH7DRFXGahtIdjtL0j3AtkWy/q3H/utKwHhJnwe4jksgUYVjd jeLg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=zbj1zy8QqmlzNiLojsCaYsf5zBj5uHHCMFq0jsBwuts=; fh=3qzCLMHiLvUX79QLZX5YxrD7x2Dcw7AgjNwAhzvTQzY=; b=Ql+PbF2YcjvT1AeIwEE0FoO03h5Gduskff2pDkQ+OlGzZJ3jYWF3JwjUseuhTlg5At bGeGTP2EYBrMj2pnUdDKuOE5K8vs4NdqI9wfOX2+zxLCG31G/ctjkHYn/tfrnXMQZ7bf t3MOi2IHkSLU6T4IZWHNncYBtMjn0M0yxtd4dF+S+oznQ9o2xV8biGnAoRvkUu45iqh7 Sst6uTBVb51nWih/lmdHbTGgwiPUJTnJtjAwPV5PyjWSA8DusGlycM6FnkvrIF2elkWe N6nG7LNhq/oFicOTwQpf6aouI21txe+9cty4iD6Eyx9eEMMVrrgPkK8UxD7YoeVjBc4L OwtQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=UuRfTfEF; arc=pass (i=1 spf=pass spfdomain=sifive.com dkim=pass dkdomain=sifive.com dmarc=pass fromdomain=sifive.com); spf=pass (google.com: domain of linux-kernel+bounces-64221-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-64221-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=sifive.com X-Forwarded-Encrypted: i=2; AJvYcCViygqOlfKF97DtBhV0j11pG6fH21RaxxlfeAb+c7xq3huySow+zdYxSt6bBN4P4ZNzZCcMvRequ2H70eNFtrvkHGaeacZOv9iR+x+RcA== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id g8-20020ac87f48000000b0042c6ce3b46esi3774542qtk.254.2024.02.13.12.22.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 12:22:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-64221-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=UuRfTfEF; arc=pass (i=1 spf=pass spfdomain=sifive.com dkim=pass dkdomain=sifive.com dmarc=pass fromdomain=sifive.com); spf=pass (google.com: domain of linux-kernel+bounces-64221-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-64221-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=sifive.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id E78A51C263E2 for ; Tue, 13 Feb 2024 20:22:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9137D60B9B; Tue, 13 Feb 2024 20:22:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sifive.com header.i=@sifive.com header.b="UuRfTfEF" Received: from mail-qk1-f169.google.com (mail-qk1-f169.google.com [209.85.222.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7B89C849C for ; Tue, 13 Feb 2024 20:22:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.169 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707855736; cv=none; b=rkjr29dvTgA7oVIFXKp+PeF6qcWYf0lB1REs9+LmBdC6afCrxYtkGsX9VwSY8Lv5xWqCNmZI/TmuS01KvfjNGTFI70JFJoRRT4yhEMY0hHN06cnBwzcw3aTcXEJMRri5+hx+XWHpTy2Yh6o07w8mfabqiTN1XndKM4GRW5+bjm8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707855736; c=relaxed/simple; bh=Aaj96pAHTIwRyQeDWfr/9ULSU1FokxTnYjG2gNM7nNU=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=noJyzoJsKUt/lv4tHKg8XjVKffm1nE7U3HXJlgPfQlQJJPwcRP9U6xi2ePLpQko3f8PI4YTVvv4JExw6cZhIq+w/z75O4tyx5jsshCIHZq6MHD+T8k/+Q5lY/ry3/UJ/TtHjQNPqtDmjfPEYZ7ybLcFMb7uUFOW8+eZz+crVJLU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=sifive.com; spf=pass smtp.mailfrom=sifive.com; dkim=pass (2048-bit key) header.d=sifive.com header.i=@sifive.com header.b=UuRfTfEF; arc=none smtp.client-ip=209.85.222.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=sifive.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sifive.com Received: by mail-qk1-f169.google.com with SMTP id af79cd13be357-787190ab6d8so108403285a.0 for ; Tue, 13 Feb 2024 12:22:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; t=1707855733; x=1708460533; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=zbj1zy8QqmlzNiLojsCaYsf5zBj5uHHCMFq0jsBwuts=; b=UuRfTfEFoNt086UM4Nhhp9LfBK9MkLfKcbmR21An4QCGCibzgWkY1gqblgC225DK/M EGWSgzYmzo9qBzbp1lSrXnoGflWxZvUJd6mOQS9XKaEdqdX8/ihvGNvKQxv0+7tW/FJD S06scbxcYcSs6mXywIDAkWIWWh6L72GdlPJSYA1Xt7kxJMqdjjCqRoYkOlxnlZ+k0kOK c9XShdbXCaNg4xs71baOGjMim0lUziDxw5v7G0N2v1Wpt4pWDsYcO2FdOESy/dEHHzzd BgXlgCuX6O5pTA1onUcBjeJk7fHZAOPrr3hdjQBlNzK28bB8JJ5aOzyT1JlUc/rEgftG TT5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707855733; x=1708460533; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=zbj1zy8QqmlzNiLojsCaYsf5zBj5uHHCMFq0jsBwuts=; b=QCX9Yk7ama/sGVteRXwces9x8OOc/PF5nzYBtWjOUoORw3UpNUuQ+iZ2QJnUqFAFh3 bg35HwcVymWZFktbNPFlYwfBgOnotyajY6fB4YUOfhsOa5+9UWioiysR2ZYMVkwtJSld 7xaxzpnSTqKArOlKb1t+NQDaKumnizomEoDqfe5gO4P/BQyXd2sk1MXAhL8uzSW/0Wfn LJJ6gd8gUigniJe6ykeD7NIqMw3vpfgJDmDdSx9oNIJxC8/giVBoKS5WV6fBsfSpICEb C5n/rh1X+XLci4NuZNBSouSjtC7w+FY4DmHAyWGFoRqtuckaCb81cPnXRQwOyPngWEL9 B1sg== X-Forwarded-Encrypted: i=1; AJvYcCXpF+2lNFWcbsWBHcG3ohBYrQYzovitDf4wN9T9P6pfQI2o6/smU57c+iHkgSDx/ZSuI/EA7im5bBRrqZmiwLec+pdMbL1D92Ipb/U1 X-Gm-Message-State: AOJu0YzGrLzt9scvrjBjrPG+u4n95jSIGdmjKutRa+gwGtjzGdsH5sv7 /e/74iC6i7vKA3n5/nidquT+FJCKBAK/DE1bNBh8SC3ZLEUUXPPNWPBAgvWPoHY= X-Received: by 2002:a37:c447:0:b0:783:d369:6e5a with SMTP id h7-20020a37c447000000b00783d3696e5amr661892qkm.76.1707855733283; Tue, 13 Feb 2024 12:22:13 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCUfw9ZDUUDmMtZwIJU0CB5m0P2ktFgNX3kF9qXP6+F+eQXPK52OGf0c5NqOYuaBUDYToyHEyd4IevdY+M+zji8JDxM8PCxxWKK6hQQdA63+GHUbdR2Vd/e4pJbOkYGgy29Yv7yf2J5vASv3rmJSAtsfUPi7vfm0GjPUjCd8kTeCHGK0DtDFr2YWtXHX826Hb8DI0bFYspkiKF43gdtd+s5Gfh0RHsBbziq/6EaL0eqM1Bwj0Q== Received: from [100.64.0.1] ([170.85.8.192]) by smtp.gmail.com with ESMTPSA id d9-20020a05620a166900b00783f1e600aasm3215244qko.38.2024.02.13.12.22.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 13 Feb 2024 12:22:12 -0800 (PST) Message-ID: Date: Tue, 13 Feb 2024 14:22:11 -0600 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH -fixes v2 3/4] riscv: Add ISA extension parsing for Sm and Ss Content-Language: en-US To: Conor Dooley Cc: Palmer Dabbelt , Andrew Jones , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Stefan O'Rear , stable@vger.kernel.org References: <20240213033744.4069020-1-samuel.holland@sifive.com> <20240213033744.4069020-4-samuel.holland@sifive.com> <20240213-dangle-taco-2742f6087a3e@spud> From: Samuel Holland In-Reply-To: <20240213-dangle-taco-2742f6087a3e@spud> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 2024-02-13 12:07 PM, Conor Dooley wrote: > On Mon, Feb 12, 2024 at 07:37:34PM -0800, Samuel Holland wrote: >> Previously, all extension version numbers were ignored. However, the >> version number is important for these two extensions. The simplest way >> to implement this is to use a separate bitmap bit for each supported >> version, with each successive version implying all of the previous ones. >> This allows alternatives and riscv_has_extension_[un]likely() to work >> naturally. >> >> To avoid duplicate extensions in /proc/cpuinfo, the new successor_id >> field allows hiding all but the newest implemented version of an >> extension. >> >> Cc: # v6.7+ >> Signed-off-by: Samuel Holland >> --- >> >> Changes in v2: >> - New patch for v2 >> >> arch/riscv/include/asm/cpufeature.h | 1 + >> arch/riscv/include/asm/hwcap.h | 8 ++++++ >> arch/riscv/kernel/cpu.c | 5 ++++ >> arch/riscv/kernel/cpufeature.c | 42 +++++++++++++++++++++++++---- >> 4 files changed, 51 insertions(+), 5 deletions(-) >> >> diff --git a/arch/riscv/include/asm/cpufeature.h b/arch/riscv/include/asm/cpufeature.h >> index 0bd11862b760..ac71384e7bc4 100644 >> --- a/arch/riscv/include/asm/cpufeature.h >> +++ b/arch/riscv/include/asm/cpufeature.h >> @@ -61,6 +61,7 @@ struct riscv_isa_ext_data { >> const char *property; >> const unsigned int *subset_ext_ids; >> const unsigned int subset_ext_size; >> + const unsigned int successor_id; >> }; >> >> extern const struct riscv_isa_ext_data riscv_isa_ext[]; >> diff --git a/arch/riscv/include/asm/hwcap.h b/arch/riscv/include/asm/hwcap.h >> index 5340f818746b..5b51aa1db15b 100644 >> --- a/arch/riscv/include/asm/hwcap.h >> +++ b/arch/riscv/include/asm/hwcap.h >> @@ -80,13 +80,21 @@ >> #define RISCV_ISA_EXT_ZFA 71 >> #define RISCV_ISA_EXT_ZTSO 72 >> #define RISCV_ISA_EXT_ZACAS 73 >> +#define RISCV_ISA_EXT_SM1p11 74 >> +#define RISCV_ISA_EXT_SM1p12 75 >> +#define RISCV_ISA_EXT_SS1p11 76 >> +#define RISCV_ISA_EXT_SS1p12 77 >> >> #define RISCV_ISA_EXT_MAX 128 >> #define RISCV_ISA_EXT_INVALID U32_MAX >> >> #ifdef CONFIG_RISCV_M_MODE >> +#define RISCV_ISA_EXT_Sx1p11 RISCV_ISA_EXT_SM1p11 >> +#define RISCV_ISA_EXT_Sx1p12 RISCV_ISA_EXT_SM1p12 >> #define RISCV_ISA_EXT_SxAIA RISCV_ISA_EXT_SMAIA >> #else >> +#define RISCV_ISA_EXT_Sx1p11 RISCV_ISA_EXT_SS1p11 >> +#define RISCV_ISA_EXT_Sx1p12 RISCV_ISA_EXT_SS1p12 >> #define RISCV_ISA_EXT_SxAIA RISCV_ISA_EXT_SSAIA >> #endif >> >> diff --git a/arch/riscv/kernel/cpu.c b/arch/riscv/kernel/cpu.c >> index d11d6320fb0d..2e6b90ed0d51 100644 >> --- a/arch/riscv/kernel/cpu.c >> +++ b/arch/riscv/kernel/cpu.c >> @@ -215,6 +215,11 @@ static void print_isa(struct seq_file *f, const unsigned long *isa_bitmap) >> if (!__riscv_isa_extension_available(isa_bitmap, riscv_isa_ext[i].id)) >> continue; >> >> + /* Only show the newest implemented version of an extension */ >> + if (riscv_isa_ext[i].successor_id != RISCV_ISA_EXT_INVALID && >> + __riscv_isa_extension_available(isa_bitmap, riscv_isa_ext[i].successor_id)) >> + continue; >> + >> /* Only multi-letter extensions are split by underscores */ >> if (strnlen(riscv_isa_ext[i].name, 2) != 1) >> seq_puts(f, "_"); >> diff --git a/arch/riscv/kernel/cpufeature.c b/arch/riscv/kernel/cpufeature.c >> index c5b13f7dd482..8e10b50120e9 100644 >> --- a/arch/riscv/kernel/cpufeature.c >> +++ b/arch/riscv/kernel/cpufeature.c >> @@ -113,23 +113,29 @@ static bool riscv_isa_extension_check(int id) >> return true; >> } >> >> -#define _RISCV_ISA_EXT_DATA(_name, _id, _subset_exts, _subset_exts_size) { \ >> +#define _RISCV_ISA_EXT_DATA(_name, _id, _subset_exts, _subset_exts_size, _successor) { \ >> .name = #_name, \ >> .property = #_name, \ >> .id = _id, \ >> .subset_ext_ids = _subset_exts, \ >> - .subset_ext_size = _subset_exts_size \ >> + .subset_ext_size = _subset_exts_size, \ >> + .successor_id = _successor, \ >> } >> >> -#define __RISCV_ISA_EXT_DATA(_name, _id) _RISCV_ISA_EXT_DATA(_name, _id, NULL, 0) >> +#define __RISCV_ISA_EXT_DATA(_name, _id) \ >> + _RISCV_ISA_EXT_DATA(_name, _id, NULL, 0, RISCV_ISA_EXT_INVALID) >> >> /* Used to declare pure "lasso" extension (Zk for instance) */ >> #define __RISCV_ISA_EXT_BUNDLE(_name, _bundled_exts) \ >> - _RISCV_ISA_EXT_DATA(_name, RISCV_ISA_EXT_INVALID, _bundled_exts, ARRAY_SIZE(_bundled_exts)) >> + _RISCV_ISA_EXT_DATA(_name, RISCV_ISA_EXT_INVALID, \ >> + _bundled_exts, ARRAY_SIZE(_bundled_exts), RISCV_ISA_EXT_INVALID) >> >> /* Used to declare extensions that are a superset of other extensions (Zvbb for instance) */ >> #define __RISCV_ISA_EXT_SUPERSET(_name, _id, _sub_exts) \ >> - _RISCV_ISA_EXT_DATA(_name, _id, _sub_exts, ARRAY_SIZE(_sub_exts)) >> + _RISCV_ISA_EXT_DATA(_name, _id, _sub_exts, ARRAY_SIZE(_sub_exts), RISCV_ISA_EXT_INVALID) >> + >> +#define __RISCV_ISA_EXT_VERSION(_name, _id, _preds, _preds_size, _successor) \ >> + _RISCV_ISA_EXT_DATA(_name, _id, _preds, _preds_size, _successor) >> >> static const unsigned int riscv_zk_bundled_exts[] = { >> RISCV_ISA_EXT_ZBKB, >> @@ -201,6 +207,16 @@ static const unsigned int riscv_zvbb_exts[] = { >> RISCV_ISA_EXT_ZVKB >> }; >> >> +static const unsigned int riscv_sm_ext_versions[] = { >> + RISCV_ISA_EXT_SM1p11, >> + RISCV_ISA_EXT_SM1p12, >> +}; >> + >> +static const unsigned int riscv_ss_ext_versions[] = { >> + RISCV_ISA_EXT_SS1p11, >> + RISCV_ISA_EXT_SS1p12, >> +}; >> + >> /* >> * The canonical order of ISA extension names in the ISA string is defined in >> * chapter 27 of the unprivileged specification. >> @@ -299,8 +315,16 @@ const struct riscv_isa_ext_data riscv_isa_ext[] = { >> __RISCV_ISA_EXT_DATA(zvksh, RISCV_ISA_EXT_ZVKSH), >> __RISCV_ISA_EXT_BUNDLE(zvksg, riscv_zvksg_bundled_exts), >> __RISCV_ISA_EXT_DATA(zvkt, RISCV_ISA_EXT_ZVKT), >> + __RISCV_ISA_EXT_VERSION(sm1p11, RISCV_ISA_EXT_SM1p11, riscv_sm_ext_versions, 0, >> + RISCV_ISA_EXT_SM1p12), >> + __RISCV_ISA_EXT_VERSION(sm1p12, RISCV_ISA_EXT_SM1p12, riscv_sm_ext_versions, 1, >> + RISCV_ISA_EXT_INVALID), >> __RISCV_ISA_EXT_DATA(smaia, RISCV_ISA_EXT_SMAIA), >> __RISCV_ISA_EXT_DATA(smstateen, RISCV_ISA_EXT_SMSTATEEN), >> + __RISCV_ISA_EXT_VERSION(ss1p11, RISCV_ISA_EXT_SS1p11, riscv_ss_ext_versions, 0, >> + RISCV_ISA_EXT_SS1p12), >> + __RISCV_ISA_EXT_VERSION(ss1p12, RISCV_ISA_EXT_SS1p12, riscv_ss_ext_versions, 1, >> + RISCV_ISA_EXT_INVALID), >> __RISCV_ISA_EXT_DATA(ssaia, RISCV_ISA_EXT_SSAIA), >> __RISCV_ISA_EXT_DATA(sscofpmf, RISCV_ISA_EXT_SSCOFPMF), >> __RISCV_ISA_EXT_DATA(sstc, RISCV_ISA_EXT_SSTC), >> @@ -414,6 +438,14 @@ static void __init riscv_parse_isa_string(unsigned long *this_hwcap, struct risc >> ; >> >> ++ext_end; >> + >> + /* >> + * As a special case for the Sm and Ss extensions, where the version >> + * number is important, include it in the extension name. >> + */ >> + if (ext_end - ext == 2 && tolower(ext[0]) == 's' && >> + (tolower(ext[1]) == 'm' || tolower(ext[1]) == 's')) >> + ext_end = isa; >> break; >> default: >> /* > > > Hmm, looking at all of this (especially this hack to the "old" parser), > I feel more like these should be promoted to a property of their own. > The "old" parser was designed to handle numbers, and here when you're > interested in the values behind the numbers (which is a first iirc), you > don't make any use of that. I don't really want to see a world where I had a version of this code that parsed the numbers and stored them as integers in `struct riscv_isainfo`. It didn't work with of_property_match_string() as used for riscv,isa-extensions, since that function expects the extension name to be the full string. Either we would need to change the code to parse a version number out of each string in the riscv,isa-extensions list (and make the binding a bunch of regexes), or we need a separate "extension" entry (and DT binding entry) for each supported version. I chose the second option, and as a consequence I didn't actually need to parse the integer value in the ISA string code path either. > we have every single iteration of smNpM under the sun in the property, > because there's a fair bit of churn in the isa. Granted, this applies to > all the various, the difference for me is the level of churn. Indeed. In fact, one thought I had while looking at this code is that we should be ignoring any extension in the ISA string with a version < 1.0 or >= 2.0, since those won't be compatible with what we expect. > Or maybe we can still with the properties you have, but instead of > treating them like any other extension, handle these separately, > focusing on the numbering, so that only having the exact version > supported by a cpu is possible. Maybe I'm misunderstanding what you're saying here, but it is already the case that the DT for a CPU would only contain the exact version of the privileged ISA supported by that CPU. With this implementation, the fact that the integer version gets expanded to a series of flags is supposed to be invisible in the DT and to userspace. I realize I don't quite succeed there: putting "ss1p13" in the ISA string should work, but does not. > I'm still pretty undecided, I'd like to think about this a little bit, > but I think we can do better here. Sure, no problem. I'm happy to implement whatever we agree on. Though one consideration I had is that this is all in support of fixing a bug in v6.7, so I wanted the changes to be backportable. I suppose the easy way out for backporting is to check for RISCV_ISA_EXT_ZICBOZ for now, and then solve the larger problem once there is some other user of the envcfg CSR (or another Ss1p12 feature). Regards, Samuel