From patchwork Wed Jun 19 11:35:24 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: 13703738 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 36D22C27C53 for ; Wed, 19 Jun 2024 11:37: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=N5Y8RPYR35F7gLzegEJJBkifO7fCBRPrWbHGu6Va2WI=; b=0NIgQV6pNHiiwg 5M46Ipmz16Vr340SUU+ASNxGnVWaC/HmI4f9zIeD5t0Dml5VV5i9Hc6T+ybyYhEs1xNWDbRCa6veT 9iQFPo4z3Wychp0AmwcveFZUtUE9j7AZ4+YSYrkkO+exekCbnff1FJVPZbAUdxXcmXd8qsfUu+jh6 OPojpX1m0e6DplX1m26fjBJROISEvkllkmZoUOFGh4NG/1z7GQBVyDcJe5Ui8qc/kfFu+S2TgMVYN 7DfvcUQlrma0KIxbI05qLyxsbj1FyX4+z3S5/OzxahzTntiu53zQopI1PxLYgYIgYZZ/W18miz6ZG Y9+dBZyejuM8ftRt9jxg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJtcW-000000010lA-1BhX; Wed, 19 Jun 2024 11:36:56 +0000 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJtbb-00000000ztv-05og for linux-riscv@lists.infradead.org; Wed, 19 Jun 2024 11:36:03 +0000 Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-35f25530406so367520f8f.3 for ; Wed, 19 Jun 2024 04:35:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1718796957; x=1719401757; 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=QNTR87ViStRTLjbLTFramo32AnhtfCIqG+mY5nzsVhg=; b=0ZiGEn7cDhIQpqPaRg6TqvLDWY/Vb3Ii7WtLZe3zpIa3WRufQllOCP45RnNPvKo0VP sAKUWG5KKJbvllj3r+uari5wuept5OCbeao6Yn9xdgEbySOkeyfB/Ah9suMv7JtM802u TibL1LCsHZm7ddC5/j1Ide+ujxO9CouLquYc13MWogdIyLXQKimUuaTRv90BivRqTTzj hSfwNwTO0X13/QqcKZueaIbF6XI1lecfUUYqu/zwCqMH+MjHQrIFLWhizZHu9dIfK4gg MpoAxeVdztJWnijqApytUfMLXyKvhuhM1VStnwYdVP9+BcpqeahiABnL5/OmrQ6EdiPR 0aJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718796957; x=1719401757; 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=QNTR87ViStRTLjbLTFramo32AnhtfCIqG+mY5nzsVhg=; b=UdjnftnrbFeuCSj3Gi/85cYxnwVHMM/6fPQJm06/4Ag7nSl2QYQixykSli+RQykJEc uuHh9itnNRoOmWrXPZw8nOTiGfexKelePkOtMEtlrKDzNXhmUd9JzzSN/tEV7c1MOsai SzVdK8wh7Fx+YnQvd3nzuVtmMIhD1lP2cmMzk5eI4vw33pKd1e9hg2a1WVNGQM8OPNeJ mKreBsW+IoPW76aAJ1jWTYlZfyWFf41Jwhft2rqWl68qXUeWTyMv1rGNbKRpiLea1xOQ u7VW1i758NxG3J2/fgqXi57MOvVU3h8N8KdAMJrGqbskEhp+8MEHZOuAzV96+mWzm3aA wj1A== X-Forwarded-Encrypted: i=1; AJvYcCUfHYfbrjxvL1CC9Oe03bliVvK+jpOy92+puq71L/cvS3yCh/jweXm1YHI2zwnaCPwiF4cjaahOqlURcOciP0vrTsfSasuS+rg7Kjzhl/+m X-Gm-Message-State: AOJu0YwZ3XDoJjeaB+NMiI7oHCTsmKNMVjps4l1+0EpqQ42Dvt4AN1gX dH0aWKKOCI+I3phJpPjJSPC4QML+Y+BXzvFyiRZANInPc/PtwXNr18fgYpGGGDw= X-Google-Smtp-Source: AGHT+IGn/LpwHNx73QtNZmX0LVZG43iWR+YwELGXaE1GpTfJ5aoWVLtbw2nzaPBzkFgiYXBhTTJV0Q== X-Received: by 2002:a05:600c:511d:b0:423:445:4aad with SMTP id 5b1f17b1804b1-42475016e88mr16022565e9.0.1718796957512; Wed, 19 Jun 2024 04:35:57 -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.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Jun 2024 04:35:56 -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 Subject: [PATCH v7 14/16] riscv: hwprobe: export Zcmop ISA extension Date: Wed, 19 Jun 2024 13:35:24 +0200 Message-ID: <20240619113529.676940-15-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_043559_492622_C8EDCCEC X-CRM114-Status: GOOD ( 12.47 ) 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 Zcmop ISA extension through hwprobe. Signed-off-by: Clément Léger Reviewed-by: Evan Green --- 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 4d9b4ed34c96..25d783be2878 100644 --- a/Documentation/arch/riscv/hwprobe.rst +++ b/Documentation/arch/riscv/hwprobe.rst @@ -231,6 +231,10 @@ The following keys are defined: ("Zcf doesn't exist on RV64 as it contains no instructions") of riscv-code-size-reduction. + * :c:macro:`RISCV_HWPROBE_EXT_ZCMOP`: The Zcmop May-Be-Operations extension is + supported as defined in the RISC-V ISA manual starting from commit + c732a4f39a4 ("Zcmop 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 c38f3f2b8382..920fc6a586c9 100644 --- a/arch/riscv/include/uapi/asm/hwprobe.h +++ b/arch/riscv/include/uapi/asm/hwprobe.h @@ -70,6 +70,7 @@ struct riscv_hwprobe { #define RISCV_HWPROBE_EXT_ZCB (1ULL << 44) #define RISCV_HWPROBE_EXT_ZCD (1ULL << 45) #define RISCV_HWPROBE_EXT_ZCF (1ULL << 46) +#define RISCV_HWPROBE_EXT_ZCMOP (1ULL << 47) #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 89e03cdf38b7..3d1aa13a0bb2 100644 --- a/arch/riscv/kernel/sys_hwprobe.c +++ b/arch/riscv/kernel/sys_hwprobe.c @@ -115,6 +115,7 @@ static void hwprobe_isa_ext0(struct riscv_hwprobe *pair, EXT_KEY(ZIMOP); EXT_KEY(ZCA); EXT_KEY(ZCB); + EXT_KEY(ZCMOP); /* * All the following extensions must depend on the kernel