From patchwork Wed Dec 13 11:33:05 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: 177923 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:3b04:b0:fb:cd0c:d3e with SMTP id c4csp7707051dys; Wed, 13 Dec 2023 03:34:23 -0800 (PST) X-Google-Smtp-Source: AGHT+IEhCIMVT9RJhawmKa2CtS826m6xGqkVR2Mfge5tOz6DD+FYU7CyXOtdcKXxYkL7c2Xr9Vpa X-Received: by 2002:a17:902:d4cb:b0:1cf:c329:6204 with SMTP id o11-20020a170902d4cb00b001cfc3296204mr4115571plg.14.1702467263029; Wed, 13 Dec 2023 03:34:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702467263; cv=none; d=google.com; s=arc-20160816; b=D727kfbsHOuToDAzFa2bIx6KSG3+ZbX8ndhCAzu0Xzdw4BOe5HffXDklMGkUNs48Jb gop8tTxSJDXflkGG03uD6dOYGwiPOnssU9LzDAX9GwBmL6zBKHSUcMlrfMRKmQrjXyth KN3EmiukXshjhA+nhyOiOPV5NAKxnryCmXyXjaPanYAR/25vOMqMXaIt7eUbTIOIXyrB oThONMXOJ1VP5NAR2cekdjW0JdL2Y0sZEvOCW0iiMlnZmm3+VoGRpDpGvcWAW3/fg2qT gp3Kqk2eLFRsRA1LU2yymHLXO+gVX4Hbrq2yxHBqDdTVp9qV8VcVhLV29GZJZ5fAN8bI JPLQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=KKPObWVuIFXSRwOfIm7U25jwf++f1sQGlTYA9JTEt2I=; fh=xetE2tvUj4KVv4Y1ULtLdPNUjx3CE50rVjiyrCzTN7A=; b=OSYKo5aLrxeoQ9Lia3fJw7Su69sd4wmZAvvVXOImBY7Tp32GYpfoZxf5QLX0osl2LB zDO/1mWunkxz+JC9CcEeeSPjfvKY0wp8yCm0PKTeqdImh+CmiWddoBb/PHukScqMvNH1 IGI1vUaerwfGKuVX/ZdqZLQ3+bmiSIfcstdTPw+nhFdUf+x8qeU4BKlUXw7bEpnfANxm ecn3IR24qONsCcHITBxm28X6yePiLLJLIr0b1vGXny7xkls7/CczFgO54tRiy06r3273 DLmrYdWnCg6F6DTlZvnL4GHWhPUBjh1HVMpFJhZ79mb9SDTR/c6eHF93SRySUVhh2oe3 iecw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=RfzSBK9S; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id 4-20020a170902c24400b001d09e83b3bfsi9307133plg.92.2023.12.13.03.34.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 03:34:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=RfzSBK9S; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 19ADF80C0376; Wed, 13 Dec 2023 03:34:22 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378138AbjLMLeM (ORCPT + 99 others); Wed, 13 Dec 2023 06:34:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49970 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377778AbjLMLdd (ORCPT ); Wed, 13 Dec 2023 06:33:33 -0500 Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 50C33130 for ; Wed, 13 Dec 2023 03:33:23 -0800 (PST) Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-40c32e205fcso10694115e9.1 for ; Wed, 13 Dec 2023 03:33:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1702467202; x=1703072002; darn=vger.kernel.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=KKPObWVuIFXSRwOfIm7U25jwf++f1sQGlTYA9JTEt2I=; b=RfzSBK9SpNVuBJ654n3yp6K89HTEUNgLDz1Sbt6qD1ReJvEFqKJNWWjquoQuURed/7 44oanJh4FfD1MTUJeQPIDNmOGHYMOfr3rZwDb1EWck4Hm/TM/6DOXF9J7bxb1uwvOJI7 hmR0sqBCxhqSin/1N2o7WE9V7Qkjz5HsR2IKc+wPDvElfWdR4qHrySS82awQH0gPWgzG SjQhYrmxuYmJiZ7KEkg2tS0x08mZ7qU2Xo5JiXjzO7qAJwe99Mp5MUfRxG3CXhwEHqEl 9KF8k0oRR+ccrWlyyOk++AVWrFr0TEGOuoocx30+8XMa/RDMy2RBfelCU9UmAW0IU0Es tfDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702467202; x=1703072002; 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=KKPObWVuIFXSRwOfIm7U25jwf++f1sQGlTYA9JTEt2I=; b=cpbl3oXfoBPj68F0wg1/K3tDGLLuCnLZek9/T3aEooZtxHgBNTmsCK0C6mpdgA48AQ /MopNbhJhNBEIfdo41b6pVxCFO3VlrQAvgtzmn42IIHeooM6o6tj5UpkSsgOKwK+f2dq dBbcWqZImXrM/2P3eo8tTLJ127gLIxkkU75bWqsqvszK/QRMkq70O/f8SdmA97ux9ZkB iJ1jbJeAAFnQ6hTUsUEbmkLHY0/+fMQafINhbF5p+x5wgFe/5oB4Ejr4qK6TmPmMZnkE oX/7JmEHaMpUaZd1ieRfWj/zqrAIRftY5KWil/sVnXgCz1CRVJLzlq0nB7Q4k3tWtgTW NpXw== X-Gm-Message-State: AOJu0YwfEI2bXP8sUCkpNxHOOn2zH7h8bc/ZjPIj9EgNztuGWQneiS4e xHxHu9tESzuDGr0wL8xgxCszdQ== X-Received: by 2002:a05:600c:3b23:b0:40c:2631:7c3d with SMTP id m35-20020a05600c3b2300b0040c26317c3dmr9593791wms.2.1702467201829; Wed, 13 Dec 2023 03:33:21 -0800 (PST) Received: from carbon-x1.. ([2a01:e0a:999:a3a0:c564:f167:d072:5672]) by smtp.gmail.com with ESMTPSA id m27-20020a05600c3b1b00b0040b38292253sm22433137wms.30.2023.12.13.03.33.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 03:33:21 -0800 (PST) From: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= To: linux-doc@vger.kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Cc: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= , Jonathan Corbet , Paul Walmsley , Palmer Dabbelt , Albert Ou , Conor Dooley , Rob Herring , Krzysztof Kozlowski , Robbin Ehn Subject: [PATCH 9/9] riscv: hwprobe: export Zicond extension Date: Wed, 13 Dec 2023 12:33:05 +0100 Message-ID: <20231213113308.133176-10-cleger@rivosinc.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231213113308.133176-1-cleger@rivosinc.com> References: <20231213113308.133176-1-cleger@rivosinc.com> MIME-Version: 1.0 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 13 Dec 2023 03:34:22 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785166313030539208 X-GMAIL-MSGID: 1785166313030539208 Export the zicond extension to userspace using hwprobe. Signed-off-by: Clément Léger --- Documentation/arch/riscv/hwprobe.rst | 5 +++++ arch/riscv/include/uapi/asm/hwprobe.h | 1 + arch/riscv/kernel/sys_riscv.c | 1 + 3 files changed, 7 insertions(+) diff --git a/Documentation/arch/riscv/hwprobe.rst b/Documentation/arch/riscv/hwprobe.rst index 510e49878834..a42c3b5d6bc3 100644 --- a/Documentation/arch/riscv/hwprobe.rst +++ b/Documentation/arch/riscv/hwprobe.rst @@ -172,6 +172,11 @@ The following keys are defined: defined in the Atomic Compare-and-Swap (CAS) instructions manual starting from commit 5059e0ca641c ("update to ratified"). + * :c:macro:`RISCV_HWPROBE_EXT_ZICOND`: The Zicond extension is supported as + defined in the RISC-V Integer Conditional (Zicond) operations extension + manual starting from commit 95cf1f9 ("Add changes requested by Ved + during signoff") + * :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 7ec4331122e7..4287aa391cf5 100644 --- a/arch/riscv/include/uapi/asm/hwprobe.h +++ b/arch/riscv/include/uapi/asm/hwprobe.h @@ -59,6 +59,7 @@ struct riscv_hwprobe { #define RISCV_HWPROBE_EXT_ZTSO (1ULL << 33) #define RISCV_HWPROBE_EXT_ZAM (1ULL << 34) #define RISCV_HWPROBE_EXT_ZACAS (1ULL << 35) +#define RISCV_HWPROBE_EXT_ZICOND (1ULL << 36) #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 abb0eea3ee08..d94f11534efa 100644 --- a/arch/riscv/kernel/sys_riscv.c +++ b/arch/riscv/kernel/sys_riscv.c @@ -177,6 +177,7 @@ static void hwprobe_isa_ext0(struct riscv_hwprobe *pair, EXT_KEY(ZTSO); EXT_KEY(ZAM); EXT_KEY(ZACAS); + EXT_KEY(ZICOND); if (has_vector()) { EXT_KEY(ZVBB);