From patchwork Wed Dec 20 15:57:18 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: 13500312 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 122BEC46CD2 for ; Wed, 20 Dec 2023 15:57:56 +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=NE1+WzsS1S30f205vmgax4nIUABj+hiQO8yCneWEllo=; b=bJEp2ifRxW3vcp UWjCXFyXCjSpfvkEgH+pAEstRIsGGLjg1ltIkSX4FfJZywVqg6MKbn7TyQvuSVgztwX9XukIjEm63 LdntI0s0Ob81/oaNs/axBWcn3Uca0zqtmCA2N3WNU6g/a2YpMF9j4st2Gro1AG7Rq14S/MaqWATDd cRoSt37VbXHyCLb1CPHBkLr9HXrtnGJH+JLa7iOcBVkjGWPtLbPDHZdRsSYlQySwVnSPTNwISVmOj /eHp6TKpz04WncrBpln3G1CUDYH1SVeGfkpSvPDgOm9/MG+R4EmIsIDGAgA/Hkf/8Cesg3JcRArZ+ NEgjJX9oWOPiABxjaJGQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rFyxB-000KLj-2u; Wed, 20 Dec 2023 15:57:49 +0000 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rFyx8-000KIt-0j for linux-riscv@lists.infradead.org; Wed, 20 Dec 2023 15:57:47 +0000 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-40c317ba572so13868495e9.0 for ; Wed, 20 Dec 2023 07:57:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1703087862; x=1703692662; 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=fxiI83AWHviDA1K2goPpANE3T3h3Nt6zkBhZOZxUOr0=; b=cm1DvnYAaTkwxAvfHRkJh1ODBZZxXQM0qqJiGNBEo/bZmD/lt/u+h7494VDIaBgMxM oXqDSL6GJQg6wf/STiRlMZcNroMHis38zciUiwuv8xfGapQNahcJSjoerBG6Q3te0CJq j5gwq0PKkWzl4NhOPntVvKihh1+mpvXF6OR3e28T+ti9ozxkuX2A7MAY7pI7hW4o7UZE oyDyVqQAY6XYeyd7UtuEXqVs+kZ3vxFHfSQVUSQa7UJ7Tpo0/U4O+I7ATY0Vb6GzPEWl 3NbFIrNJMRq9CRfd/I/LynECtkYxFLZT2TGlydqQyyVZv3W19uZ9QAFLrTf8/lztcWzk sRIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703087862; x=1703692662; 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=fxiI83AWHviDA1K2goPpANE3T3h3Nt6zkBhZOZxUOr0=; b=DTMnMlqDIVogpLHSKG+eRBOdaYCm/BObikzW63UPvUo1BSMZFSSHJxtZNyJv+/6m0r 0HBlPaXeeUF46fS87JOsD8Hot0JPzADBzyjU386lGrS8u934/gR7QKgc5FLysE8CJ5ZW THAu+0jjoXcny5jOdjKhPPKU1AmCVSXluG/5OpllBsFXwo3Eh4tK2oaRmXM6qi55dUwS OFDGSZEUCbOEp82kIiLic+JSsI+92CKpJBYSBFGJpgCGSx1bbwdy7cjdM3zQ8+SCsYqf DDBA2zY85UkQC/op//oMshliDZrf2oIvTQXfcw8zUK37ZQVktT7UWzVkvWiclEys4bXu AHSw== X-Gm-Message-State: AOJu0YwJM7RmeAqMcPBBj7YvRqK00qr1MfnCtorluHZE/1/UNampRMc4 qrzeN0ADFCiaxEd9qd8dAT+6PA== X-Google-Smtp-Source: AGHT+IFJbjR0PbYZ8f2Ct75zHWOpr+wt21lqG0IGhwGx4TEjDmQ++1Z336t5tRomVVKE9Pyr/5CpGA== X-Received: by 2002:a05:600c:214c:b0:40d:35c9:7b86 with SMTP id v12-20020a05600c214c00b0040d35c97b86mr1498909wml.4.1703087861906; Wed, 20 Dec 2023 07:57:41 -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.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 07:57:41 -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 2/6] riscv: hwprobe: export Ztso ISA extension Date: Wed, 20 Dec 2023 16:57:18 +0100 Message-ID: <20231220155723.684081-3-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_075746_267830_0494D50A X-CRM114-Status: GOOD ( 10.88 ) 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 Ztso extension to userspace. Signed-off-by: Clément Léger --- Documentation/arch/riscv/hwprobe.rst | 4 ++++ arch/riscv/include/uapi/asm/hwprobe.h | 1 + arch/riscv/kernel/sys_riscv.c | 1 + 3 files changed, 6 insertions(+) diff --git a/Documentation/arch/riscv/hwprobe.rst b/Documentation/arch/riscv/hwprobe.rst index 41463b932268..10bd7b170118 100644 --- a/Documentation/arch/riscv/hwprobe.rst +++ b/Documentation/arch/riscv/hwprobe.rst @@ -161,6 +161,10 @@ The following keys are defined: defined in the RISC-V ISA manual starting from commit 056b6ff467c7 ("Zfa is ratified"). + * :c:macro:`RISCV_HWPROBE_EXT_ZTSO`: The Ztso extension is supported as + defined in the RISC-V ISA manual starting from commit 5618fb5a216b + ("Ztso is now ratified.") + * :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 91fbe1a7f2e2..01ac3dc196e5 100644 --- a/arch/riscv/include/uapi/asm/hwprobe.h +++ b/arch/riscv/include/uapi/asm/hwprobe.h @@ -56,6 +56,7 @@ struct riscv_hwprobe { #define RISCV_HWPROBE_EXT_ZVFH (1 << 30) #define RISCV_HWPROBE_EXT_ZVFHMIN (1 << 31) #define RISCV_HWPROBE_EXT_ZFA (1ULL << 32) +#define RISCV_HWPROBE_EXT_ZTSO (1ULL << 33) #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 f0bd7b480b7f..6564fa9e7a7f 100644 --- a/arch/riscv/kernel/sys_riscv.c +++ b/arch/riscv/kernel/sys_riscv.c @@ -174,6 +174,7 @@ static void hwprobe_isa_ext0(struct riscv_hwprobe *pair, EXT_KEY(ZKSH); EXT_KEY(ZKT); EXT_KEY(ZIHINTNTL); + EXT_KEY(ZTSO); if (has_vector()) { EXT_KEY(ZVBB);