From patchwork Tue Nov 7 10:55:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= X-Patchwork-Id: 13448498 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 354DEC4167B for ; Tue, 7 Nov 2023 10:56:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=lk/UY6WFvFwUnGu7twt/774xxUBIOMlKW049Ct01MlM=; b=nnaJQ+4hsZnN6G f5RpqYwwiQo4E6GTLBOhpp7zjl5f+HSSSsvicVwV1FZjhBRgQI1GymSkeGWa/XUmbmtFjmXGQ7uC1 qgvnmSmYILG0j3cSamR2gk1444Q+qKFPwmzqOzi54bHAGfD+mN7Ofd4lKLWbxMw8FIIdJ4sYjKGg2 CdDVFt7Yc0DplwDJje0MAsunk6Q2dCbULtfLZ+w36mB8KuZv8xvRN9ifr0pjbTtMOn69FKE9iSZwo p7gAv2atM/AoO8Fq6K7cAu/IluTUfWmrvjqwAFutwQZLADYamJb76zrOBWXW3xm5XYfAeFUR9uxX9 fFx5laEGgwhetbubPPWg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r0Jkg-00198p-0G; Tue, 07 Nov 2023 10:56:10 +0000 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r0Jkb-00196k-2Y for linux-riscv@lists.infradead.org; Tue, 07 Nov 2023 10:56:07 +0000 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-408434ce195so10593135e9.0 for ; Tue, 07 Nov 2023 02:56:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1699354563; x=1699959363; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=UA6TaO+YV3P6uG5ehiL6SbNfsZ4OUqVSTDbxUXfxm5E=; b=xsdIZj7OwJ4BAbv/sYCYAaq++DX5IZuktPJ+tpIT1GHbUIpMyQhApvKIpIrtMfFUqK E+HO8YZEszIjG3qGdB2AmFMW6xsRG1+O1OY9QSwoNHXLQ8bpXWPUv+rnktQ7YopclrH2 X67SVi7PZ/lUQVngwuo/5L+BrwRbNFa/m1nhywbFUMH8hoLYIiesCVhzOwYHD7CjbzVN 7cUWAoKJD/R8fWZKt+jHzWIenQG9kLK7ehfQh6nCzmKRafDi5bWXQb7lo42gZEVNAisf /2hFsDjhIbZu1wQu/lrPxTYqeNVqV1C1mXGDww2PyHC8S5Hwpa3uLAMs6KofHW41fUCX VUvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699354563; x=1699959363; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=UA6TaO+YV3P6uG5ehiL6SbNfsZ4OUqVSTDbxUXfxm5E=; b=c+k6mNGUUMz63TEXOyEG8ZFt/m77tBK7zAawPdi+A1jx4qNfGUgdOHILM2COt7n4Mz EsbiwvDuK7X1krhR4EiDNOARuB4tpsjG9gKJHIHaW562nJyPr9Jnon5CnQL7hTDTIrRQ qVe74LjYtw9lBDICQD4QjLLl/7FgCzAh7QDihW+mekdL9bNFfxiLmwk7RMFee9bcVSBW 4AuUifagDt3kYTTowa+rnNJFnK8r/T8JcQJuKBK7AfZ5mL7VCh7qdzACWHnWx1YG862M Y+p1H+6UND7U2GLHDkCPKD6nXLUuSl/TPwIDdwe4OJ76JYN61vbtqiv3oqRylZEx7xvo hwkA== X-Gm-Message-State: AOJu0YzjqTWFrC2iz3Co0soff4AljTtf5b2nCNt0K8EeipR4Kab5oSin GEZD8c/cM/Y49uxZ5uiQWgVI7gWLBFB5Oq3VVA0gPQ== X-Google-Smtp-Source: AGHT+IEDB5qlOk6FgrKsa3qj9SE6v/Kfu6peNUysoGxbasqez5sPqF/BIOxq9sfcbgB58kS3oj4koA== X-Received: by 2002:a05:600c:3b93:b0:405:3cc1:e115 with SMTP id n19-20020a05600c3b9300b004053cc1e115mr25948840wms.3.1699354562728; Tue, 07 Nov 2023 02:56:02 -0800 (PST) Received: from carbon-x1.. ([2a01:e0a:999:a3a0:7db3:bdd9:4cab:2ee3]) by smtp.gmail.com with ESMTPSA id n30-20020a05600c501e00b00405442edc69sm15396853wmr.14.2023.11.07.02.56.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Nov 2023 02:56:01 -0800 (PST) From: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= To: linux-riscv@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org Cc: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= , Palmer Dabbelt , Paul Walmsley , Rob Herring , Krzysztof Kozlowski , Albert Ou , Jonathan Corbet , Andrew Jones , Evan Green , Conor Dooley , Samuel Ortiz Subject: [PATCH v3 02/20] riscv: hwprobe: export missing Zbc ISA extension Date: Tue, 7 Nov 2023 11:55:38 +0100 Message-ID: <20231107105556.517187-3-cleger@rivosinc.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231107105556.517187-1-cleger@rivosinc.com> References: <20231107105556.517187-1-cleger@rivosinc.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231107_025605_830739_0744ABA7 X-CRM114-Status: GOOD ( 11.71 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org While ISA string parsing has been added, Zbc was not export through hwprobe interface. Export and document this extension. Signed-off-by: Clément Léger --- Documentation/arch/riscv/hwprobe.rst | 3 +++ arch/riscv/include/uapi/asm/hwprobe.h | 1 + arch/riscv/kernel/sys_riscv.c | 1 + 3 files changed, 5 insertions(+) diff --git a/Documentation/arch/riscv/hwprobe.rst b/Documentation/arch/riscv/hwprobe.rst index a52996b22f75..ecc0307c107e 100644 --- a/Documentation/arch/riscv/hwprobe.rst +++ b/Documentation/arch/riscv/hwprobe.rst @@ -77,6 +77,9 @@ The following keys are defined: * :c:macro:`RISCV_HWPROBE_EXT_ZBS`: The Zbs extension is supported, as defined in version 1.0 of the Bit-Manipulation ISA extensions. + * :c:macro:`RISCV_HWPROBE_EXT_ZBC` The Zbc extension is supported, as defined + in version 1.0 of the Bit-Manipulation ISA extensions. + * :c:macro:`RISCV_HWPROBE_KEY_CPUPERF_0`: A bitmask that contains performance information about the selected set of processors. diff --git a/arch/riscv/include/uapi/asm/hwprobe.h b/arch/riscv/include/uapi/asm/hwprobe.h index d43e306ce2f9..dcef5c33c009 100644 --- a/arch/riscv/include/uapi/asm/hwprobe.h +++ b/arch/riscv/include/uapi/asm/hwprobe.h @@ -29,6 +29,7 @@ struct riscv_hwprobe { #define RISCV_HWPROBE_EXT_ZBA (1 << 3) #define RISCV_HWPROBE_EXT_ZBB (1 << 4) #define RISCV_HWPROBE_EXT_ZBS (1 << 5) +#define RISCV_HWPROBE_EXT_ZBC (1 << 6) #define RISCV_HWPROBE_KEY_CPUPERF_0 5 #define RISCV_HWPROBE_MISALIGNED_UNKNOWN (0 << 0) #define RISCV_HWPROBE_MISALIGNED_EMULATED (1 << 0) diff --git a/arch/riscv/kernel/sys_riscv.c b/arch/riscv/kernel/sys_riscv.c index 49aa4e82797c..382cd71129c6 100644 --- a/arch/riscv/kernel/sys_riscv.c +++ b/arch/riscv/kernel/sys_riscv.c @@ -162,6 +162,7 @@ static void hwprobe_isa_ext0(struct riscv_hwprobe *pair, CHECK_ISA_EXT(ZBA); CHECK_ISA_EXT(ZBB); CHECK_ISA_EXT(ZBS); + CHECK_ISA_EXT(ZBC); #undef CHECK_ISA_EXT }