From patchwork Wed Jun 19 11:35:13 2024 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: 13703727 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 3E877C2BA15 for ; Wed, 19 Jun 2024 11:35:53 +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=PocqbuouJ/+JYlF58RwIXiHPq4cXAkXH+XdnHiVXsVw=; b=3mN2fA1s2JAMo5 aA6Di5XexrQ16B6+EBYJsBfYbdFJ27OICPcHuak9tR2gN4I7HU5ef2ay95MDxwhoajW0cM54chL46 ps0CjEzJ9FnyrZO5gYtn7ha2u/CGju4Khij6I/++OoGMt0vqOKTEMcX/F0m5vPU8tnTC4zzPIGR48 xNuYXzFfBjkfvEPqdbo+oTvGFlMLVZce4BWXvdVizy25F0yNq+m8bEKMg+XDfe57g1xTUEk44IdQr DJQTalTS903r9n/XCgh8tdfzTeBUgAqH0i1LIeFLT7D3HbNbXHigK8acM1HWKY0xPpdbnvS+4e9lC 3Twh7Ozj7h3XfFK0FiWw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJtbQ-00000000zlX-2ARp; Wed, 19 Jun 2024 11:35:48 +0000 Received: from mail-lj1-x22e.google.com ([2a00:1450:4864:20::22e]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJtbI-00000000zdD-1hRV for linux-riscv@lists.infradead.org; Wed, 19 Jun 2024 11:35:42 +0000 Received: by mail-lj1-x22e.google.com with SMTP id 38308e7fff4ca-2ebd6ae2f56so7293731fa.0 for ; Wed, 19 Jun 2024 04:35:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1718796939; x=1719401739; 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=3NeIVokKZeou2DRmWwx696jQqaRNB0bo5tdjndOt75M=; b=GiBU6FtoAReXsCpA4h2GTMZVZUvSuAnGHXA2CnGN42h7LQDVAug+GoP9/800ZrE2GI gFhOMFdvXV6Sk0MeVIOQCTloE9LNNjKaepxNkR44XdhBF+x+8XnRgSZ89AZuZ5mSxcdy JU5069LMvqVPY3PedcOoFTf/+2lWrx1Qnre3IYADz2wE+LA43fi+x2JQ7QjOOQejybYW VdYetaD6xhYPaORRh4ujBMgmZRTlVXOrP8OYTe5pkpBviFdkYHxVgcCWGQmmCwUUEo4J jQPQMxeRJcXh1I7q/IxWEuTqF5A7R4NfkwPj5eR717COQPuBxKToi6NV1bAU8M2pWU+k lxKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718796939; x=1719401739; 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=3NeIVokKZeou2DRmWwx696jQqaRNB0bo5tdjndOt75M=; b=f7HoT3oA8wqS41jMjNVzZy78qOdBMk0h0QrgU6W9goz/MkOQwEmLYwoGpV+zCQnSfo E9yVavIzBcseqRrC+poJCcs7+mJKTn86LE/Qx42ZlH9AoHWGfEynHgO7TL2fVdU4Mlj7 eCrtX1MrcbI6F9GJxAWqiKYSqFQAXH5lltA24itwIiQiNmfyr5+vG5I3EQUKaQy3FOtm NF5mOVZXLdHW7Jw/qItvFk9QdZA8MGnfxVByelSh1fpP904hj5WrrcLTnTAX9ikyjQjI 7b6VnzB/LdYWA3gY3oR2aypxvwSGF0JYn/Bw8u+8TZ0o4A7ooEmWInF8lHX4lAOCEtoV Ih4g== X-Forwarded-Encrypted: i=1; AJvYcCXUp98lUnpYTMz7q8xPszfqtn18sCzpyjv0wwH+I5n5IwLxriSKQfzdPCJcvzdo1hdfza0MvXwiuCoImeyIQ3lSHF45JR+VAm5PXHQp0UEt X-Gm-Message-State: AOJu0YzZxOrRw1AVFrN0vHu4jGWr5/e8J6LnWDNFWdTo2g063ThbZuLi W/SBLWdUAHZK4KAAWDyvimomP2l3SiD9Uxj+6R/GN4c4TGCAUaxgDwI9az0WFLw= X-Google-Smtp-Source: AGHT+IHXMR+p5Jiwrk26C4hD41FJdRZ01s6AEWYRELMLJ9ACvKi0hM30z5n9fFC1USLH9An4IqbrFw== X-Received: by 2002:a2e:9654:0:b0:2eb:e49c:45df with SMTP id 38308e7fff4ca-2ec3d007606mr11998811fa.4.1718796938764; Wed, 19 Jun 2024 04:35:38 -0700 (PDT) Received: from carbon-x1.. ([2a01:e0a:999:a3a0:e67b:7ea9:5658:701a]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-422870e9681sm266192075e9.28.2024.06.19.04.35.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Jun 2024 04:35:37 -0700 (PDT) From: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= To: Jonathan Corbet , Paul Walmsley , Palmer Dabbelt , Albert Ou , Conor Dooley , Rob Herring , Krzysztof Kozlowski , Anup Patel , Shuah Khan Cc: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= , Atish Patra , linux-doc@vger.kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, kvm@vger.kernel.org, kvm-riscv@lists.infradead.org, linux-kselftest@vger.kernel.org, Charlie Jenkins Subject: [PATCH v7 03/16] riscv: hwprobe: export Zimop ISA extension Date: Wed, 19 Jun 2024 13:35:13 +0200 Message-ID: <20240619113529.676940-4-cleger@rivosinc.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240619113529.676940-1-cleger@rivosinc.com> References: <20240619113529.676940-1-cleger@rivosinc.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240619_043540_697986_EBD20AF5 X-CRM114-Status: GOOD ( 11.60 ) 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 Zimop ISA extension through hwprobe. Signed-off-by: Clément Léger Reviewed-by: Charlie Jenkins --- Documentation/arch/riscv/hwprobe.rst | 4 ++++ arch/riscv/include/uapi/asm/hwprobe.h | 1 + arch/riscv/kernel/sys_hwprobe.c | 1 + 3 files changed, 6 insertions(+) diff --git a/Documentation/arch/riscv/hwprobe.rst b/Documentation/arch/riscv/hwprobe.rst index fc015b452ebf..2b7f1d05b2e3 100644 --- a/Documentation/arch/riscv/hwprobe.rst +++ b/Documentation/arch/riscv/hwprobe.rst @@ -207,6 +207,10 @@ The following keys are defined: * :c:macro:`RISCV_HWPROBE_EXT_ZVE64D`: The Vector sub-extension Zve64d is supported, as defined by version 1.0 of the RISC-V Vector extension manual. + * :c:macro:`RISCV_HWPROBE_EXT_ZIMOP`: The Zimop May-Be-Operations extension is + supported as defined in the RISC-V ISA manual starting from commit + 58220614a5f ("Zimop is ratified/1.0"). + * :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 7b95fadbea2a..538c404938e6 100644 --- a/arch/riscv/include/uapi/asm/hwprobe.h +++ b/arch/riscv/include/uapi/asm/hwprobe.h @@ -65,6 +65,7 @@ struct riscv_hwprobe { #define RISCV_HWPROBE_EXT_ZVE64X (1ULL << 39) #define RISCV_HWPROBE_EXT_ZVE64F (1ULL << 40) #define RISCV_HWPROBE_EXT_ZVE64D (1ULL << 41) +#define RISCV_HWPROBE_EXT_ZIMOP (1ULL << 42) #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_hwprobe.c b/arch/riscv/kernel/sys_hwprobe.c index 83fcc939df67..04a2ed4ee415 100644 --- a/arch/riscv/kernel/sys_hwprobe.c +++ b/arch/riscv/kernel/sys_hwprobe.c @@ -112,6 +112,7 @@ static void hwprobe_isa_ext0(struct riscv_hwprobe *pair, EXT_KEY(ZACAS); EXT_KEY(ZICOND); EXT_KEY(ZIHINTPAUSE); + EXT_KEY(ZIMOP); /* * All the following extensions must depend on the kernel