Received: by 2002:a05:6500:1b41:b0:1fb:d597:ff75 with SMTP id cz1csp80826lqb; Tue, 4 Jun 2024 05:54:34 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUIsqObmeMiPk4uAeWdSZSWnggQk/SVOZG0JnerstE86emXKBG+AHTB4OLF2ldws53I17ihF2ZyVaAnEs4PHKjUd+jkKDcQAcPkYMWKSA== X-Google-Smtp-Source: AGHT+IHagSaLvzhDAsDEPW+q1VhcLTILjre6OzVd3NqiZSN9QRIVf0YP5gpWel2TWwUVxF7YYne8 X-Received: by 2002:a05:6214:4345:b0:6ad:7081:6d0f with SMTP id 6a1803df08f44-6aecd725485mr155814626d6.62.1717505674328; Tue, 04 Jun 2024 05:54:34 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717505674; cv=pass; d=google.com; s=arc-20160816; b=mloYaos1nZPtykTWaMWI0OWlrQE3vp6R241jO9Xhy147SzgYOMdv6wKhBZoOnO4ky+ K0iYI+SGfeJufY9lE/sCN8Gm/VBvgGXteaYYzwQESNDpEmm+AuyFSRUFLV6h7Jo6krnT vc3n741z2mRZFLIt9vituC5BxKJ5YzjDJG88uGVTwnQLhQfAbEGEW166e0pLa850C6hU wZEWYjxA9RO2crI6gn7YMe/wwOGKdHhu7hC6HQ43PKUFdzrmx0ZNefGcrAWmAey1Nxlb Cza+mrRUDr6B0qWgGUT78RxNqi+UzzFDc85ji85ghH+9PCzd5FrGzKJFBYtefoQMziyL 9spQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=lMpkyLkaSRVaEO/feaH2dKMkG1i5I5KHxmVTKeHtvyc=; fh=IMiddMOhJM0mkA3I3hJo9ZMvwTRx18/bdjMVDYzBGxA=; b=sEyIGus7iuZSytJFDiBs/QtdiaChQpEjOtAp6i6jZ4pj57Qi3jvbA/YHNNpPijYKk2 nGUt9KwM34OL/apvj1m+7wjf3Oh5UWj460//qWhWM5IYBUipFlGjM6KVcyf/yxrbSDag WVQWBqeZ4nkFGecWjLmcnVPzkSJscOHDJ2LHdHykk9VYPjNl9Ilyic6x/mLjCmEFMwL3 5kY4aOpr7wgXaeCFzH5ykAmcSF2c8e189as30bUNSAfO5LF3RUVuln18lfZLtbjos3fN ASPqmhBHECCvNJWFgCP4K4xR13vgI2QY2/754idhdYsmwj0o9/u43gD0PiD64EZMFD/S qctw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=cfUco6y9; arc=pass (i=1 spf=pass spfdomain=rivosinc.com dkim=pass dkdomain=rivosinc-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-200643-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-200643-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 6a1803df08f44-6ae4a732a13si107614896d6.26.2024.06.04.05.54.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jun 2024 05:54:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-200643-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=cfUco6y9; arc=pass (i=1 spf=pass spfdomain=rivosinc.com dkim=pass dkdomain=rivosinc-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-200643-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-200643-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 95D011C253DA for ; Tue, 4 Jun 2024 12:52:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 649C914A09E; Tue, 4 Jun 2024 12:48:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=rivosinc-com.20230601.gappssmtp.com header.i=@rivosinc-com.20230601.gappssmtp.com header.b="cfUco6y9" Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4FD5C146D62 for ; Tue, 4 Jun 2024 12:48:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717505336; cv=none; b=A9rzaWfilCR7TCMccwJpo9DlqzfEqNbPdv9bfsACvnGe2PhidXMtHhCZU4qi/HBoE8BVwBrHlZfRAoKnC+BDM3eZatObVUrbrqThcQ4tTAwZRcyEvkbaHJX5wGTB/0WxPcgsRMqjc5GKyjuGCRVwAp8IXAUx6XoxG40Xi/Fs8EU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717505336; c=relaxed/simple; bh=fbtxheV0cDi84/+JGvjHvPffIZlUo37W9TjstXw8xkA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=b6EMTnerByUT296iIsZtTJ6egCRPPVjI5+aXwgmhWZZMricAwtBdmq2IiLlwWHdKr6HlzuV3DIFi3W4res7xLGvyJnWu7M0+M5AESeqQjEy2Uiw9G3VAUX5cCjhVycROlmQXw6PzBVZ9AQYFKveLfkA8ldje5Tw6BopW4xIUbZQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=rivosinc.com; spf=pass smtp.mailfrom=rivosinc.com; dkim=pass (2048-bit key) header.d=rivosinc-com.20230601.gappssmtp.com header.i=@rivosinc-com.20230601.gappssmtp.com header.b=cfUco6y9; arc=none smtp.client-ip=209.85.214.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=rivosinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=rivosinc.com Received: by mail-pl1-f179.google.com with SMTP id d9443c01a7336-1f2e3249d5eso4369155ad.3 for ; Tue, 04 Jun 2024 05:48:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1717505334; x=1718110134; darn=vger.kernel.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=lMpkyLkaSRVaEO/feaH2dKMkG1i5I5KHxmVTKeHtvyc=; b=cfUco6y9OWXxEGnLr7UNtkjYotGqevLDImY54XXzjgXdRYl5f61FvAHVhVEle7Z7GP XeRlUz6g6m79CC0CPduS/KasyesQIaG6pK7Oc/RGe72h32gQBD6vzpwsNyqxgIkTng2t FnePmZPcuaavUIj8b+hwkvNOilpysz7FGXsr7Xj4UzF3QMiDMD753svK2bPIXxfAPZD1 0hp8hyD/KIh00x+tr64dZOVenwDw8yo+ENnD93HVUSPycqwwlAs96mXZY2viXY28sDwl h+XZopHYde+sdL3SFRCgGPmes89yaTbR1PrQXsWjcUqhanc8wssjk403ardCnqh7RE+E cmhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717505334; x=1718110134; 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=lMpkyLkaSRVaEO/feaH2dKMkG1i5I5KHxmVTKeHtvyc=; b=r6QI/6JMIjphKSwJRoG/4p2HqPhfm2JaL9M7f5qeY8lHBhFUEuOp2ISKqkyMH2QmwN 19yXsqMG5/2xTabsLC9iZz/qZbYRqtnXVrlfFyJpBnsY4KdAqZxyvBgobZX8a8Ls+6vp vSZc1VpBRhMlhm66IbZ4wxhvtzKUH4OvOJsgw0CbWtfk4Y/iqvcyZvRE1k3IHqHRpy6e QXSKnoRr6vbPWLIrgawaldp6urWIBm2zlZqDz67SojaWWoNh5MNdAE5DHNgiShDTJdtk St/lVWLKOfzZnYdGlTyjHu7TzzVzli6p1OQfhvvDXYv9XweIkwbSQc2++jbJ52UisJCW vjCw== X-Forwarded-Encrypted: i=1; AJvYcCW2r8m7Ujtl1XrYsmPu772HTx3OojPpsXhLMQ6XCe1gLiKwTrrhdL9SuKxFX4HJSsROobFEL+jdLotqm+oS3ujeikk5ncuhVihig2hk X-Gm-Message-State: AOJu0YznQ7P7h/UOjZthyneSl9yhPPdqTtqQ98xLNIf7GffZU0wmXxcB X9RAC+qpAa62xZkLrGdXjySYx2PGtY2fppaNWZ8MM265XaQzp0o1jvH3miZlXAU= X-Received: by 2002:a17:902:ec8c:b0:1f2:ffbc:7156 with SMTP id d9443c01a7336-1f636fcf230mr130005385ad.1.1717505334634; Tue, 04 Jun 2024 05:48:54 -0700 (PDT) Received: from carbon-x1.. ([2a01:e0a:999:a3a0:327b:5ba3:8154:37ed]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1f6323ebc69sm83042885ad.211.2024.06.04.05.48.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jun 2024 05:48:54 -0700 (PDT) From: =?UTF-8?q?Cl=C3=A9ment=20L=C3=A9ger?= To: Jonathan Corbet , Paul Walmsley , Palmer Dabbelt , Albert Ou , Conor Dooley , Rob Herring , Krzysztof Kozlowski , Anup Patel , Shuah Khan Cc: =?UTF-8?q?Cl=C3=A9ment=20L=C3=A9ger?= , 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 v6 14/16] riscv: hwprobe: export Zcmop ISA extension Date: Tue, 4 Jun 2024 14:45:46 +0200 Message-ID: <20240604124550.3214710-15-cleger@rivosinc.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240604124550.3214710-1-cleger@rivosinc.com> References: <20240604124550.3214710-1-cleger@rivosinc.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 cad84f51412d..9a77b7d14539 100644 --- a/Documentation/arch/riscv/hwprobe.rst +++ b/Documentation/arch/riscv/hwprobe.rst @@ -216,6 +216,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 fba3d74154b1..480d7bb01088 100644 --- a/arch/riscv/include/uapi/asm/hwprobe.h +++ b/arch/riscv/include/uapi/asm/hwprobe.h @@ -65,6 +65,7 @@ struct riscv_hwprobe { #define RISCV_HWPROBE_EXT_ZCB (1ULL << 39) #define RISCV_HWPROBE_EXT_ZCD (1ULL << 40) #define RISCV_HWPROBE_EXT_ZCF (1ULL << 41) +#define RISCV_HWPROBE_EXT_ZCMOP (1ULL << 42) #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 11def345a42d..34c95eaf8cd1 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); if (has_vector()) { EXT_KEY(ZVBB); -- 2.45.1