From patchwork Wed Apr 10 09:11:01 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: 13623929 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 5AFF4CD11C2 for ; Wed, 10 Apr 2024 09:12:08 +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=RnHKUFGKcWzMAn o7ElkxiaisQw+hApnw9wpPhCH/sF4LyYq5qgNKIvefL0e8lRQDjmF4ELEFCDWGeT1xwtHt1lg3/Ob r/6D5wDPP4vvqUa9FvUKisw7dmOeFY77Im1SqJ0MZ27R2ksIE9LMTs9EGyBGgx9TFtaVcSTuYUVnE ootGI/mNfcZzpdE1evTdQbm63Z2u68mK7YXoyWh7niZoAc38TSKY58Pj+20Ou9kEfs9ThF5uhgdFe 9keekLsQxisws0MT4vZYclqeO9EgSTGR/kxjkwIu1PXBEdwO/UBQMqIPZ7luxOFCaVqJkk71lZUU9 Ls+lKl1DoCtdJvCoKJpg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1ruTzu-000000063gI-256g; Wed, 10 Apr 2024 09:12:02 +0000 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1ruTzI-000000063A8-12Zt for linux-riscv@lists.infradead.org; Wed, 10 Apr 2024 09:11:32 +0000 Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-346407b8c9aso516618f8f.0 for ; Wed, 10 Apr 2024 02:11:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1712740281; x=1713345081; 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=Qi4W5GFvtThCxTLCDEhF/HOyZMzNzKKvXozs8o4lz24TqdhbsoA8Nmv0qNU8ZFDuZ2 OMMTaOV4xPHBzcKI8GWNQsJTFlnAWqtVuI9LcZSRn6mHBNMEByIH0PQbTHomkfw2O2As UDfcjCx+QA90aBjgDNxOAamH5S19WHC6HxH4uLnnDQHF9T744SnoJuwkxo/HF5vKzD97 RQgytgB5Qp8oofnm4nx7yPS0pH2t+Qznzr+tWV8jWVg3DZXbRob4x58AUl1IXtq5q2ZQ Ks2NTZlgkM5afXQP1lLXw+6gSMTArWHlql2kLH9RckAvLmvAWpRSWid+co5TAlalHbe/ +fAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712740281; x=1713345081; 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=qljdfc69ZDxipzp3pbLNr8CU69qsW+ZqIK38E3hUfwlSukfDF+Czy9Bz+Rttg6R5Ve s0Qyw1dF4XgVgDTq8XRuupwFVQeDR9BfiJMP8ueNgNT0wVIk6ZYrLgXRNzelQqdwBD5m QgwW9DiP1hUYCgycZeJv+dzr9zobbGh4uVk/A2CsFetkvudQk47ZJ9GBemiqTTJf5nPA iy+Ij/AMrokiiXUi3xH6vd4OG93Lks0TAb4EOC5/HrbHy4EuHf0jhuKGFwqYRD6hszgc fPBRYZV1yq8baf9vj27cj89F9m1UXSVOE8BgOrbHa5QYVpyE41SZN/N8JhAYJJO7QqC0 mn5Q== X-Forwarded-Encrypted: i=1; AJvYcCXCOECBrg1jxofNGRMiWiRckSmlhMDPgb1jUtQLD9GT0xszwsEXlt/YRSNUCMLttfnf+/wwrpwtCO14RP76tZo5DGqg7VGygzLxyVLsCeGD X-Gm-Message-State: AOJu0YyPuC2aK4MJ04h5wbkgiyyXLxdX7/5tSQAiNV0KV9u086Zv0jFi 5NhLKTRl4BrVeM78TEcCXDYaOUhRxTLxxX3UqhnGOn2O4z2AXnDkFGt4WCA+rPM= X-Google-Smtp-Source: AGHT+IFQJ5p7pLG6t5Azs3+BcKGV7vPPdom5bcR5KV8gVA1LUcuSXTuOIz79sOe0bN9WIkFT5A1jwg== X-Received: by 2002:a5d:47a4:0:b0:343:39d8:bf3a with SMTP id 4-20020a5d47a4000000b0034339d8bf3amr1645951wrb.4.1712740281298; Wed, 10 Apr 2024 02:11:21 -0700 (PDT) Received: from carbon-x1.. ([2a01:e0a:999:a3a0:d4a6:5856:3e6c:3dff]) by smtp.gmail.com with ESMTPSA id d6-20020a056000114600b003456c693fa4sm9079086wrx.93.2024.04.10.02.11.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Apr 2024 02:11:20 -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 08/10] riscv: hwprobe: export Zcmop ISA extension Date: Wed, 10 Apr 2024 11:11:01 +0200 Message-ID: <20240410091106.749233-9-cleger@rivosinc.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240410091106.749233-1-cleger@rivosinc.com> References: <20240410091106.749233-1-cleger@rivosinc.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240410_021124_588717_9A5CD93D X-CRM114-Status: GOOD ( 11.30 ) 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);