From patchwork Tue Jun 4 12:45:35 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: 13685242 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 7AF62C25B78 for ; Tue, 4 Jun 2024 12:46:55 +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=Yv8UUFxNA/LD0FCOiagbwn48XfNW4wM/dDT6LvQkItc=; b=ah9PDrBWPlrZne upM7qU737WJBanHi7+H6cV4U5Xuq8PdXPbN9eiVRQjbPja1iB5l6HhcMifbu75K3LpMjjainELVSs XjLZWGeFrl36oiWfhnNaRfRtlqcMSGYYMBkt2eO6ehfPgIWn5w7c0pGtMPgAB33Iz07mC0+0TAaeT CqGBKLUueBwg2Nt/I9uJ5+liFLMMqFbSALjR5gZ93LX/W6gSIHPmBm9keEi33nTlx+qBr3Lxt3mRB RSPvmnV1HXgmowunGDOAP8sfAx9zhMrZ09N8br2WAnNFpPHsSxgpUPWlKgOZFsjw3TQb6yptAbhe6 LVId4sPlMPSdmHp2aN4Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sETYw-00000002LV4-0Fdh; Tue, 04 Jun 2024 12:46:50 +0000 Received: from mail-pg1-x52b.google.com ([2607:f8b0:4864:20::52b]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sETYs-00000002LRt-0aAm for linux-riscv@lists.infradead.org; Tue, 04 Jun 2024 12:46:47 +0000 Received: by mail-pg1-x52b.google.com with SMTP id 41be03b00d2f7-6c8b6e40ea6so337535a12.3 for ; Tue, 04 Jun 2024 05:46:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1717505204; x=1718110004; 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=degCLXX+XHlviO1qHS0Zal5T+84ciDG6Q4Lb35fjmT4=; b=2SIyN8cDwSgKbHu1EGeLx6mZJTD54RkymDahJi0jIfSZsNqLpeQ5txX3srZbSzPj4Z fvq/XEFL4O5mZJ/kcnAOXJA/iChYCGbbVlpCYeqoMAGTQtf1eyZKnYdw0ePVz7SXNG70 oEc3Kza1yASeOqXDRzYB3sKsiIjoOui83i9XAs7A5Cj60uglr7F6FknOVyJGTdQDtSGn 6WFz5RJk1zgZBUs8gHLr1hTP1S8aUmaGyDu4vUgaFKLHLaxions0YIiwTavUMeg5xZsg YrVxAHrufCi8kk58H7Jif+c2dD6X+3DtvztNkzHM1NPz0GFQNo8DZe7Ibc6+rQOUKkOQ hS4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717505204; x=1718110004; 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=degCLXX+XHlviO1qHS0Zal5T+84ciDG6Q4Lb35fjmT4=; b=Fwgdd9kko82/dGm4ybHEqQOf1xGjzhdUJ4jrm42tCk2lyr5eZ4PXfliEj2XsuYeX4a whpO9Cstzn9uZS1iOGrUTUBrQjwojUL++lAFJr0YeVe0PIKCKmXC3wvl5a0JDSn8UbWe l8Rdt72SgbYrzudKy8ZpjQJD4Wu3xtMXr+Ug6a1x7gVW/7/5/K/BruPFjZ2hgBepMHh4 Kqr143+BMP9/aV/nza5XYx6yMpvcnS/6w1stxZ6vkMd7iBfvGNEs2CV6MtoAkNNZC1SB UM2GOiZhkARVJMA7MyukIUoaGnHEcY7/eejF/O1/jFBdOE19XqQW6/H8U/9RYDENi0zP pinw== X-Forwarded-Encrypted: i=1; AJvYcCWF8MUQwFrj/FPC1lPCMY5CCZqPtSiyUbRK+SaBaPUxu9kKFaQ/YKhowRNv3SlRSCREdM6mivxvDLDTNzsUcOTZdiadf0jERHQkE1sQZib8 X-Gm-Message-State: AOJu0YwxMD2IsOjS1EP0kPuIaWWhkI4RWI8/fNxl0xq91Y2tCn40Qxyx CJZgcwdogVun3BmHx29h7Uktfv5HVz+IWpBNLjD90/pXaLepuwhaEef+nWhRxns= X-Google-Smtp-Source: AGHT+IE7zjnoMPDLUunpx6Exg1+SZFG8SqiUAnSVY1fKx+9xoXFT3WVdqzkHkbK298PA0agj34W4eA== X-Received: by 2002:a05:6a21:339e:b0:1af:d9a3:f3a3 with SMTP id adf61e73a8af0-1b26f327d1amr13632883637.4.1717505204132; Tue, 04 Jun 2024 05:46:44 -0700 (PDT) Received: from carbon-x1.. ([2a01:e0a:999:a3a0:327b:5ba3:8154:37ed]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1f6323ebc69sm83042885ad.211.2024.06.04.05.46.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jun 2024 05:46:43 -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 v6 03/16] riscv: hwprobe: export Zimop ISA extension Date: Tue, 4 Jun 2024 14:45:35 +0200 Message-ID: <20240604124550.3214710-4-cleger@rivosinc.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240604124550.3214710-1-cleger@rivosinc.com> References: <20240604124550.3214710-1-cleger@rivosinc.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240604_054646_264196_521C4E41 X-CRM114-Status: GOOD ( 10.64 ) 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 204cd4433af5..48be38e0b788 100644 --- a/Documentation/arch/riscv/hwprobe.rst +++ b/Documentation/arch/riscv/hwprobe.rst @@ -192,6 +192,10 @@ The following keys are defined: supported as defined in the RISC-V ISA manual starting from commit d8ab5c78c207 ("Zihintpause is ratified"). + * :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 dda76a05420b..575b95744843 100644 --- a/arch/riscv/include/uapi/asm/hwprobe.h +++ b/arch/riscv/include/uapi/asm/hwprobe.h @@ -60,6 +60,7 @@ struct riscv_hwprobe { #define RISCV_HWPROBE_EXT_ZACAS (1ULL << 34) #define RISCV_HWPROBE_EXT_ZICOND (1ULL << 35) #define RISCV_HWPROBE_EXT_ZIHINTPAUSE (1ULL << 36) +#define RISCV_HWPROBE_EXT_ZIMOP (1ULL << 37) #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 969ef3d59dbe..fc6f4238f0b3 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); if (has_vector()) { EXT_KEY(ZVBB);