From patchwork Tue Apr 23 12:43:23 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: 13640023 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 1E90BC4345F for ; Tue, 23 Apr 2024 12:44: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=7hyTpju/nnUS/DmiEf83/G7pnb9Fb55NyKWDhsatQPg=; b=bIHlcAopdIoWt4 dLxw+hSFrbFoOqLu5kDhPTd5dnYlHMqlOnJlX/RAilQ3Y/OcaIeE7Uu6u6u5k/aGAivBsqiun9dbr 1nFhcLkj0d02caYnyhAkdaLdD2dAdAIgwtTWzjZ05ul2sQzHKNflYWjzXaxkbhN8OT9/8MwImjLK8 kvM8y+TH7Yh6Kjm1WVqK3rq0dzHeK036h7qZhq+tWAVkmw5EYqexfDCYgG/IEb6fXzrR31TowGZXL nM1bu+j4sIH0cdcNqStDNEqqVQl9SrJmvMHDuHtocBlMbQ37gNnGJNz59gzVLu6ZEGvtRFO0ZLQpO BYJqETX62EeDTDP8VlYQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rzFVx-0000000HTEL-1dp6; Tue, 23 Apr 2024 12:44:49 +0000 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rzFV2-0000000HSTz-3Sxe for linux-riscv@lists.infradead.org; Tue, 23 Apr 2024 12:43:58 +0000 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-34801b1bc4aso947619f8f.0 for ; Tue, 23 Apr 2024 05:43:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1713876231; x=1714481031; 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=rdCfPjm06PN8DLWdVlWU7iGB8QhHqS8f5T3HQCXkkpY=; b=WPicsT9Ib3viJBRKpQUfHYoOKD30Pcvs6UJVlZxpReNfBVXZD9UIuPNJmQLSeCM/io RaFKu6794SpaI8Hh7CJH48ULYnJoVXi3EPaQPKSZmccwWsYfZ1M+VwgDrbhqvqSCCOKF 2NlMI6P2Wao8iobeol6gT+upHP+w4vl0P8/EZyi5JrUrm0MoN91jBAgLgyL9hMUNkyMc lt6hhQZlEdeXvHFC75k7qaFWVSXlSf5Vf5p8KFadkgaQB3q2P7C2e4jv0vV08GUoYCdp rEAJ0kVHPivxiFrasnrL/110eQpgYQDtNQXz0qfxY7YcTSOy5UUUXNcJZ03hK1BGN4sg Y87w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713876231; x=1714481031; 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=rdCfPjm06PN8DLWdVlWU7iGB8QhHqS8f5T3HQCXkkpY=; b=lA9nsJc8O8raRuwc8C7ojBW3YAsExc/Qp2+zH6+u9LUhaCoFIEdRkNWlhdv31zi6FH Vr6UmotGnmWfeC9Kf4yUNgFVBzeEZLdk2Q95GRpR1Dl7O66XEu23Raf5DeWBt0M3M17T imN64JFFW2Q6xe29ncVSnZVlSYcVdw9LRHzXEFGO3E3AUKSqt0JMynSxfikknpNIvBxJ 89/RqkQ0Ixagh9EMDJn7DXRJ2a5Xu0CR81kAeKurqFAdfQI6ezZ16P24srciMjxPWusW jZdi9UHN8bc/mVPmI4nL+x/KvnWL9aR3bOGZ0oLTd5AV2VNLaUVSkgWSKiCJzwfvJeWj fMwg== X-Forwarded-Encrypted: i=1; AJvYcCUS2wFQD6ZWmtwFpQyNm/zPtSLzMthEkR/Z3KTa0hamFrRmZWo7a68MgoXeULM623oVvZ94yDweayb2azVOZNYyLtXjCZi68tUBFAwlofQq X-Gm-Message-State: AOJu0Yyhf7dl7ZCWqsTdEb/FgqfIUIhh7wkqD9MRaHff2/JuG9xBCZx4 JZFAQySuXiDcjw6ROG1qWfLcVbyaWSfgQ5eQ8hqwK6UfDhre/vUEtEBwXvDHVJA= X-Google-Smtp-Source: AGHT+IEwxP4cmnlN65ejt3BUPk7jfIkLB8aRDSbaf6thvUjYkqGY2x1c1seifl/qbhrG1IVOTMxUHw== X-Received: by 2002:a05:6000:22d:b0:34a:5640:453c with SMTP id l13-20020a056000022d00b0034a5640453cmr7273001wrz.2.1713876231406; Tue, 23 Apr 2024 05:43:51 -0700 (PDT) Received: from carbon-x1.. ([2a01:e0a:999:a3a0:71cb:1f75:7053:849c]) by smtp.gmail.com with ESMTPSA id v10-20020a05600c470a00b00418a386c059sm19975709wmo.42.2024.04.23.05.43.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Apr 2024 05:43:50 -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 v3 09/11] riscv: hwprobe: export Zcmop ISA extension Date: Tue, 23 Apr 2024 14:43:23 +0200 Message-ID: <20240423124326.2532796-10-cleger@rivosinc.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240423124326.2532796-1-cleger@rivosinc.com> References: <20240423124326.2532796-1-cleger@rivosinc.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240423_054356_147793_8DD631F3 X-CRM114-Status: GOOD ( 11.06 ) 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 --- 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 bf96b4e8ba3b..e3187659a077 100644 --- a/Documentation/arch/riscv/hwprobe.rst +++ b/Documentation/arch/riscv/hwprobe.rst @@ -212,6 +212,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 dd4ad77faf49..d97ac5436447 100644 --- a/arch/riscv/include/uapi/asm/hwprobe.h +++ b/arch/riscv/include/uapi/asm/hwprobe.h @@ -64,6 +64,7 @@ struct riscv_hwprobe { #define RISCV_HWPROBE_EXT_ZCB (1ULL << 38) #define RISCV_HWPROBE_EXT_ZCD (1ULL << 39) #define RISCV_HWPROBE_EXT_ZCF (1ULL << 40) +#define RISCV_HWPROBE_EXT_ZCMOP (1ULL << 41) #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 2ffa0fe5101e..9457231bd1c0 100644 --- a/arch/riscv/kernel/sys_hwprobe.c +++ b/arch/riscv/kernel/sys_hwprobe.c @@ -114,6 +114,7 @@ static void hwprobe_isa_ext0(struct riscv_hwprobe *pair, EXT_KEY(ZIMOP); EXT_KEY(ZCA); EXT_KEY(ZCB); + EXT_KEY(ZCMOP); if (has_vector()) { EXT_KEY(ZVBB);