From patchwork Thu Apr 18 12:42:33 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: 13634683 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 24D4DC4345F for ; Thu, 18 Apr 2024 12:45:16 +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=ldfFck4dasffAa YSsQaMjylJ+/r6lletuO5i46xBM6AGpG1FF5Z6B8JyjW9p5fyM/oZ8RGgboNMJ46++sXBxFwWqsPi h+n/VOnpYyzv/8fYII2VHa+gzUPkwDC7pKH9pNwym7cM/DFRFtKntRoGESrTEZzLqKwby5rg1c9VQ pIdwAnUKgVTQRv0pdLLVLX2mj4jn5q/+k0/UoLUG9RCjRkUeyeyOuNgc6R/CWEfRT9vKBO4VeUEgX qjsOYxy/YejE9y8gYItESvdbIiDzOX7eNvCdnAvWF4j+DV8hBdwrwjKd8zKMwsjOFlWW5vVUUyhNk s3o16AIBvDdLkwY86FVQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rxR8Y-00000002DQr-2Xzl; Thu, 18 Apr 2024 12:45:10 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rxR7e-00000002CeG-1GNc for linux-riscv@bombadil.infradead.org; Thu, 18 Apr 2024 12:44:14 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:Content-Type :MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Sender:Reply-To:Content-ID:Content-Description; bh=rdCfPjm06PN8DLWdVlWU7iGB8QhHqS8f5T3HQCXkkpY=; b=NwHav7QhXtBOFGkNkCAtRRWIYw 2QjUTlwasgcmMyMHrpSg7wvOJGKo0rTm4F/M/TP/YY74Eb7/VRtLeKGrV2VZITQarBi2wqEVdoYNa OWMp+R8vAgLJLc+YdeV5gINHTJV76rGReBGmVX8l8GJPnkRlaOr7hckITV2jItidKltt8X4r1XCfT fH+/8gwGYRN6CQ26rmtCFlr5kDqyHq0RDy1Md8PotGtykQeKhhoD7lOslypA/Tc2TuVfWgrpgJjtL K6i3Y3uJBBd+MnAGAGE0AVXlHj5fU4LTg6Q84mkP9wXiS0/swoKQWTfHH2A22y/mmPhzw1O9HlzY4 mLxijDaw==; Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by desiato.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rxR7Y-0000000Bzrd-1Sz1 for linux-riscv@lists.infradead.org; Thu, 18 Apr 2024 12:44:12 +0000 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-347c6d6fc02so116320f8f.1 for ; Thu, 18 Apr 2024 05:44:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1713444246; x=1714049046; 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=XUjeQCkwJVsSV6+XotCLWQw0aqwJplmmbSvvbOt59vu3bstz+/Nriet7B0i6c9P/BC e7xfzvorIeFtMlaRfK6uNJUZJMeAuyzuWOIP5DCzGT3pJzE4oLtD4ryzAzW14pZ8ssnf LVdSYARwF7sdWalyVm5tcv/W7XG6uD9VMeOXz/QhevdameuS5PmtA2WIW+TIvMNTjTce Pxgq+jbrs8iVh4Ufcu9w1B4J3jjlmEUlJI2AfKLzYmfKNN0mvE1CSwVG/+DWourjRaW0 JyQwUov+aY3b8PQY4kreA2gGFEo9ouWbcj5IpBKLhL8yHp/JeZszeLK1Y49QDemhVTaH PKVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713444246; x=1714049046; 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=cvmbtY4SOd2Lk6d/03LqFqxDXyA+rlNbdKznN1C4x/vNySzGA+Ou7l7n913yZE1mys LzyCM99B+jgxz9sLoJ5F9yPVY53gHHoy1EIdmv3GANmd2lxkRvGduNrxPhJ/LuI68POX 2bExRrm19g8CpLutguaI929GecqhrWpPrWh7nvhB9C10ZNBhkSuCnadFBDAhQLoGjiJs eUZSlsPkzA07Cv1Nib/W/1MbxTpw+AJqjf6Ef5ZrRMZOsFMh7WM2QgR0zNo3pB6jwkRc Bdf5nIN/MZ0mQYXKpEQSLDNa5Fv3CvuOiA0b6mpD7epOeftiJuEEhVJXz018eHF0r40G ZtgQ== X-Forwarded-Encrypted: i=1; AJvYcCUr86ATF0qJQyunS+Rxe+UTQ0KjEuhrX0FQNyDTPdS9Ad8Vgsm06FjjgNBMDEe1TxQ0NfLt4cnXop0ioRRujebobTBX8pz0UM56qcC1wGsQ X-Gm-Message-State: AOJu0YyfDiRLBSXvB9+IXX5ID5G6OO5iElvziKJ6UO6mFHj/o2rm93tr 1X1voyFkp1lBwKt0toIilitDE4Go24zjOy4i3EYShSC+AB4VwlZa1B5h6TOOZRw= X-Google-Smtp-Source: AGHT+IGMuL1VEcAVu36oqMeDfSFjQ3yk2Wj7i500rFn3wK2To4nptMyU7omA9B2isyVdkpsEUDxcgg== X-Received: by 2002:a05:600c:1ca2:b0:418:2a57:3806 with SMTP id k34-20020a05600c1ca200b004182a573806mr1932349wms.0.1713444246501; Thu, 18 Apr 2024 05:44:06 -0700 (PDT) Received: from carbon-x1.. ([2a01:e0a:999:a3a0:7b64:4d1d:16d8:e38b]) by smtp.gmail.com with ESMTPSA id bi18-20020a05600c3d9200b00418d5b16fa2sm3373412wmb.30.2024.04.18.05.44.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Apr 2024 05:44:05 -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 v2 10/12] riscv: hwprobe: export Zcmop ISA extension Date: Thu, 18 Apr 2024 14:42:33 +0200 Message-ID: <20240418124300.1387978-11-cleger@rivosinc.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240418124300.1387978-1-cleger@rivosinc.com> References: <20240418124300.1387978-1-cleger@rivosinc.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240418_134408_688542_4BDEB9C5 X-CRM114-Status: GOOD ( 11.08 ) 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);