From patchwork Wed Dec 20 15:57:22 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: 13500316 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 56CD8C4706C for ; Wed, 20 Dec 2023 15:58:02 +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=WaaGBmTHu5Yd4KnWkl51rlAekVzsyPyUtuuwlTTNPxw=; b=T7OWZuM2B/18LX hsB6r5+pi7K1FYh8pIFU+aaTZ1RrdnY4q5Q4Og6m0lYQsq1/5GQdpZjw99Boew9Dc2ifAbp0OmikN uWCfJseQ1ejP2nH7qV9THlC5gUxFhD/Py/6nFtC0uStutopEXwix4/7/2c9BjpyvNEnfLA35nD0VK QOirCKziLA3RGPWxbe34lN1H7lJSEbJnDu7v9g52b8hFDZFxIa05QRY5sPUl5vEZ3LAXeB8uRiYWz gIghyZR4U7DNmC+oxP+JG1YtS/xMrKXZYCiP337HePp7toJ7d/XY2/NIBf9F6twNIpF8AAtO2+Bpd k4Wnz7JxQr3P0c3Lr/jQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rFyxJ-000KQg-1L; Wed, 20 Dec 2023 15:57:57 +0000 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rFyxC-000KKh-32 for linux-riscv@lists.infradead.org; Wed, 20 Dec 2023 15:57:52 +0000 Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-3367f8757d0so45869f8f.1 for ; Wed, 20 Dec 2023 07:57:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1703087867; x=1703692667; 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=TXiIygoI2xfoAtWyxNJaEZbhAX2C42esk/G1o5mFVH8=; b=U20dxp/QVH+052naua0PIKsU8Eto5QVztx1eawNQQdRDfYfyV6D2RKeKKhXuy1+BPe zFjQFA2C24W0UqzJYMMRDmgOHGM0MWGNr38GRCXekHTWF8KWhRlHdPa9Ka0FLWrz9pgG UkTbxjGkBDe32nCfRi106Z12ey5Xfx4/EwvoHg4oTUIH3npfG+d7uD3KTvXSx+oyNzbp ghSfjbVEvMtQcaBIFcjPEU1rnp91WuOgndNAuntdJgdUpj0Yw0E8lCvgWgkWUqws+7jM 2WpNobagwY/NcAucs/M1mRlGt7mWU6MvPjs/fwbUE4QqMzzqJool+pvCFeSUdKnN7/Nk EcCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703087867; x=1703692667; 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=TXiIygoI2xfoAtWyxNJaEZbhAX2C42esk/G1o5mFVH8=; b=R3eTMCvExNCHCchC9x1CwAoSIU9wExt8IoF8u4o2xhRbbFHZ2bkKYv6MBZvcYpWmJP lnor/sAnOLAUjfD4Fo0TrayLnU8AbXckM72HRzIgWKDTeSjCqLatCPaNsVTg2sAubp+o gJvfjHzvdSP60OJxvxT29bYo0wi4Ue7xHqqq4WuZ+dVOtvDUb1SdYu1hOM18xn1c5MvE aRtdPQZn1X9R9NcK7gsklMv2CJTUTgvHVBJ0Pm5r9aHYtC3NSX1HfNwL7BpN5KdDH7Vp k8l4lah11o/bh4e3P++l47L01Zzfsf0E7FKaxADEob98gli1vvrB1qsWn1oz2soCq8gZ UMEw== X-Gm-Message-State: AOJu0YwuSIXC0djog3JuiBI6pbawIzNTcdBx5NQKeSicxXdYlEjyU7M1 xvuQ2Bp9og0EuNEZvO2TPQHE/Q== X-Google-Smtp-Source: AGHT+IEpr+96oxZFiK4cxomHHqE/jg1PvdGozQiMvvlQ4NTHaFlfmPa9ipv0kbSLSizkLF3AkktCuw== X-Received: by 2002:adf:e2c4:0:b0:336:4a0e:4284 with SMTP id d4-20020adfe2c4000000b003364a0e4284mr12246378wrj.6.1703087867017; Wed, 20 Dec 2023 07:57:47 -0800 (PST) Received: from carbon-x1.. ([2a01:e0a:999:a3a0:3eae:b70:f27f:7aa1]) by smtp.gmail.com with ESMTPSA id h18-20020adffd52000000b003366af9d611sm7279693wrs.22.2023.12.20.07.57.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 07:57:46 -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 , Gianluca Guida Subject: [PATCH v2 6/6] riscv: hwprobe: export Zicond extension Date: Wed, 20 Dec 2023 16:57:22 +0100 Message-ID: <20231220155723.684081-7-cleger@rivosinc.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231220155723.684081-1-cleger@rivosinc.com> References: <20231220155723.684081-1-cleger@rivosinc.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231220_075750_981030_BE54D50D X-CRM114-Status: GOOD ( 11.02 ) 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 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 bff68004ad43..ee320fe7581b 100644 --- a/Documentation/arch/riscv/hwprobe.rst +++ b/Documentation/arch/riscv/hwprobe.rst @@ -169,6 +169,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 ac65bb43c8e7..fd7af0dddb12 100644 --- a/arch/riscv/include/uapi/asm/hwprobe.h +++ b/arch/riscv/include/uapi/asm/hwprobe.h @@ -58,6 +58,7 @@ struct riscv_hwprobe { #define RISCV_HWPROBE_EXT_ZFA (1ULL << 32) #define RISCV_HWPROBE_EXT_ZTSO (1ULL << 33) #define RISCV_HWPROBE_EXT_ZACAS (1ULL << 34) +#define RISCV_HWPROBE_EXT_ZICOND (1ULL << 35) #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 6c680c75ac0d..cca9b1e35647 100644 --- a/arch/riscv/kernel/sys_riscv.c +++ b/arch/riscv/kernel/sys_riscv.c @@ -176,6 +176,7 @@ static void hwprobe_isa_ext0(struct riscv_hwprobe *pair, EXT_KEY(ZIHINTNTL); EXT_KEY(ZTSO); EXT_KEY(ZACAS); + EXT_KEY(ZICOND); if (has_vector()) { EXT_KEY(ZVBB);