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: 1949652 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=nEDYNRxc; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=rivosinc-com.20230601.gappssmtp.com header.i=@rivosinc-com.20230601.gappssmtp.com header.a=rsa-sha256 header.s=20230601 header.b=0ZiGEn7c; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=kvm-riscv-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W41mt66PSz20XW for ; Wed, 19 Jun 2024 21:37:02 +1000 (AEST) 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=plCA0IrKKlk6b7/rvvamwvTtyzlWNY1DenadmwfIThY=; b=nEDYNRxc8lGKIc hSAVOnwDbgGfXUk81V16Vdm/ktx37HO3WIf9S0kOYItBu6buSmdHDE4XR0J4iB9lZOPE5qa+hVpBl dJ00prtQZ4TUhua+St4rC06RhBZZIZzASRE79UqTJ/jwLDcDIpx1bUm1vFxoz1WOfs6kU0ZxukD9h A+XjH8tAZrkI1rxy4QvilQ3j3akOE3iUdtBDwErEeGPua9kQiTylAN5Y7InS/n5TC7jR0+0TyNWNO WtwJPqbAF0mApedPd01Gj5kRkQVdsCp+HAzicAgNaSPkxoVWGGZ2c9S8T4kWip3MLQBeFrVqpcYW8 3hoN9Upj+xCkSZwfaGcQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJtcb-000000010qD-1Efi; Wed, 19 Jun 2024 11:37:01 +0000 Received: from mail-wr1-f43.google.com ([209.85.221.43]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJtbb-00000000zu6-2uFp for kvm-riscv@lists.infradead.org; Wed, 19 Jun 2024 11:36:06 +0000 Received: by mail-wr1-f43.google.com with SMTP id ffacd0b85a97d-3632e0f80e5so49016f8f.0 for ; Wed, 19 Jun 2024 04:35:59 -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=bQ0p45HAhZ+kogWmjgnmBwH2akx0n8GW8/bRWvE9cEO5iakvPeOLZnLNoWfatTEfli MbIyFiVA6Kjm/2WHVc+Qfg4CBbC91ZWBX6nqRG7AMniAlhQM5DSad1kdwpiaDJKksv0j QiIHtDxCm1c/pes9IfcKxJV7YY6RL8XK0C8jDhvJe4+bX2cEZEmQeFZ+i6ywndzKItID S4rDNUk/0eHq0MF3JFSL/gVs1es9kAAfrSU/Kuu1zRQZ8sXpdW75/GAva5k2G6cH7qJS 0SYRRgbJnmFc795xFj6CtMvonjlvE4npWOh27AB1nSaqSpXbNE9nV24P3rJ0M4wWhClc mKOA== X-Forwarded-Encrypted: i=1; AJvYcCWL5CRhmMUILdQPbHp3prZh2iCkopn9xXs3NUnU1nC9uon4SIXukvz23wdeN3C+RDYhvlITT0csBe0Sai/S7T2bF2bRQ4rNNLF3Mttmeg== X-Gm-Message-State: AOJu0Ywk5DJ+Ju9ska9dI2XKQaEvszVf2wx1edbYBe2rRp/u/ya7kaI0 s+RMMgBGEhIQHFmN21gzWwDrYKuyIU/6/ss39HQNyu8Ae+k7vPpplOeShC+/v04= 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_043600_076670_8C1FD206 X-CRM114-Status: GOOD ( 12.47 ) X-Spam-Score: -0.0 (/) X-Spam-Report: =?unknown-8bit?q?Spam_detection_software=2C_running_on_the_sy?= =?unknown-8bit?q?stem_=22bombadil=2Einfradead=2Eorg=22=2C?= =?unknown-8bit?q?_has_NOT_identified_this_incoming_email_as_spam=2E__The_ori?= =?unknown-8bit?q?ginal?= =?unknown-8bit?q?_message_has_been_attached_to_this_so_you_can_view_it_or_la?= =?unknown-8bit?q?bel?= =?unknown-8bit?q?_similar_future_email=2E__If_you_have_any_questions=2C_see?= =?unknown-8bit?q?_the_administrator_of_that_system_for_details=2E?= =?unknown-8bit?q?_?= =?unknown-8bit?q?_Content_preview=3A__Export_Zcmop_ISA_extension_through_hwp?= =?unknown-8bit?q?robe=2E_Signed-off-by=3A?= =?unknown-8bit?q?_Cl=C3=A9ment_L=C3=A9ger_=3Ccleger=40rivosinc=2Ecom=3E_---_?= =?unknown-8bit?q?Documentation/arch/riscv/hwprobe=2Erst?= =?unknown-8bit?q?_=7C_4_++++_arch/riscv/include/uapi/asm/hwprobe=2Eh_=7C_1_+?= =?unknown-8bit?q?_arch/riscv/kernel/sys=5Fhwprobe=2Ec?= =?unknown-8bit?b?IHwgMSArIDMgZmlsZXMgY2hhbmdlZCBbLi4uXSA=?= =?unknown-8bit?q?_?= =?unknown-8bit?q?_Content_analysis_details=3A___=28-0=2E0_points=2C_5=2E0_re?= =?unknown-8bit?q?quired=29?= =?unknown-8bit?q?_?= =?unknown-8bit?q?_pts_rule_name______________description?= =?unknown-8bit?q?_----_----------------------_------------------------------?= =?unknown-8bit?q?--------------------?= =?unknown-8bit?q?_-0=2E0_RCVD=5FIN=5FDNSWL=5FNONE_____RBL=3A_Sender_listed_a?= =?unknown-8bit?q?t_https=3A//www=2Ednswl=2Eorg/=2C_no?= =?unknown-8bit?q?_trust?= =?unknown-8bit?q?_=5B209=2E85=2E221=2E43_listed_in_list=2Ednswl=2Eorg=5D?= =?unknown-8bit?q?_-0=2E0_RCVD=5FIN=5FMSPIKE=5FH2______RBL=3A_Average_reputat?= =?unknown-8bit?q?ion_=28+2=29?= =?unknown-8bit?q?_=5B209=2E85=2E221=2E43_listed_in_wl=2Emailspike=2Enet=5D?= =?unknown-8bit?q?_-0=2E0_SPF=5FPASS_______________SPF=3A_sender_matches_SPF_?= =?unknown-8bit?q?record?= =?unknown-8bit?q?_0=2E0_SPF=5FHELO=5FNONE__________SPF=3A_HELO_does_not_publ?= =?unknown-8bit?q?ish_an_SPF_Record?= =?unknown-8bit?q?_0=2E1_DKIM=5FSIGNED____________Message_has_a_DKIM_or_DK_si?= =?unknown-8bit?q?gnature=2C_not_necessarily_valid?= =?unknown-8bit?q?_-0=2E1_DKIM=5FVALID_____________Message_has_at_least_one_v?= =?unknown-8bit?q?alid_DKIM_or_DK_signature?= =?unknown-8bit?q?_-0=2E0_T=5FSCC=5FBODY=5FTEXT=5FLINE___No_description_avail?= =?unknown-8bit?q?able=2E?= X-BeenThere: kvm-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: "kvm-riscv" Errors-To: kvm-riscv-bounces+incoming=patchwork.ozlabs.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