From patchwork Wed Jun 19 15:39:08 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: 13704189 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 AB94CC27C79 for ; Wed, 19 Jun 2024 15:41:25 +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=e+DEyBC0RXFWUqHdFrx9J8yQrLnrr0RmS9ktfSXDyew=; b=C/c2+YfzmVKVGA 6mhoaX2ngQ/0nlUzzApKegSQSVevgrSTf5Ppar6TqdeWSCy/rXYYuekQVimjY2hAb8/488ZrX8lx2 /z7FtAxiExJJyvB44hpCaVGmcwLmEbEWmV57Vua6BBzrEicgq3g6/FV6YZ2PX8zIQjiK9QYrXf4gt iKayyYreU5Ca6OFqloFxdg0q7j+dt5PcgPU7LOuqou0tb2QQPPE20heD47Nq8SigSIGqwTlbpOMXq PsTSjDxXsq1wQ51ZcpEBe4jyinFYUVpjWZnnXbbs2KYgx2Nr/dNJJWt2+8Y7aFm6JBP9c+oYw9QsZ EhTcsdfdC7vMGLaIF4Vg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJxR1-00000001qZF-20Z4; Wed, 19 Jun 2024 15:41:19 +0000 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJxQv-00000001qTA-0frr for linux-riscv@lists.infradead.org; Wed, 19 Jun 2024 15:41:15 +0000 Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-35f0dac5909so523291f8f.0 for ; Wed, 19 Jun 2024 08:41:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1718811671; x=1719416471; 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=4SiklklSKLnUGvj1C6ENo1sDkOQpn+QWruzZ6zUta1c=; b=XmXtInNafrU+jwnsJpzJKlce8RvfzMVPIliHeLlFYIvNBEGYSCw1BZtiUMGKQActKs fhsNI1n0KKakm4m3/gemJP2v7nCi59nAPDG0qk5AEk8APVAZTeXOOVvTIwFXAM9xky7K YZw9wwyGXRzqeIt5wNEnf23Qe2AC30Crc86VkvgIkUqRXYMXK79+BXLIxQU/XGREvGIA /7Vn6rlOnOO14JI/Am4UAgQthOknwu8irYp54Q81CVcjDT2u2WZFKLm/+PxLmMp1iPcU JAkcuAcpITNIwJH/3TYS4AZBdS8MsPpRAZOVPHKlWudsVTHPcjHy/CbHTuru41OAUHGU RvNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718811671; x=1719416471; 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=4SiklklSKLnUGvj1C6ENo1sDkOQpn+QWruzZ6zUta1c=; b=WYfy6A/baGjdIXUbfnw5RGY66ihOhDCiSQwAt+JsxFPwfsx3odp8ivMaZ7DtWxI7ge +DGtmFT7J4ZCgaZQmmV36HcE+VjPnKw2/zhBsF4enPWJ6Kwipm1JJWnEC1yW+UmgTOrX GAPYyy4k6QROoG/0ZBON2ntruWdqd9FNO+jhBBHOhxNJ/IIMGOoS86DqHHvYB4Jtpvwy P165vuLYftOutQ3ZtZKdjuJqDogXKGFo4dychQBNRdyrvwoaE81X39Bu7wIGPTl4hrOg 1Xfqai/C4RnvtTVtWezjmWbKIWJN5bnhcEkICywAPTYZHqfMI3n5jOvmB7GcFm1N8qmp yR2g== X-Forwarded-Encrypted: i=1; AJvYcCXlzqUyta8s2JIfc/NnhSke17XdKI5muF0F6f6M0QjjlMnDofsgSNTA8LmasSQ2Ltg0nZsqbrcIYXXBVmrg969uec04o7JM9EiiNlbNmaAo X-Gm-Message-State: AOJu0Yyla5XBPNe3HjNFBOTbjHnevAJBc1qtTaxxAK9li/Gu4aIfm1eK fTMkaA6McAac7PCG/Ki9XFCgJmv63VMOwZ4qv6sD+AGBGDJa5FigHbsZzxQxdRo= X-Google-Smtp-Source: AGHT+IFM9BO+cRboDOZItswqfJhKnEJlq+pT+xsqwOnHXCasZo7t145rk+2pPxABjV30c0ZiYjwFGQ== X-Received: by 2002:a05:6000:1787:b0:35f:247e:fbce with SMTP id ffacd0b85a97d-363170ed4c8mr2179347f8f.1.1718811671025; Wed, 19 Jun 2024 08:41:11 -0700 (PDT) Received: from carbon-x1.. ([2a01:e0a:999:a3a0:819d:b9d2:9c2:3b7a]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3607509c785sm17392292f8f.34.2024.06.19.08.41.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Jun 2024 08:41:10 -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 , Atish Patra Cc: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= , 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 1/5] dt-bindings: riscv: add Zaamo and Zalrsc ISA extension description Date: Wed, 19 Jun 2024 17:39:08 +0200 Message-ID: <20240619153913.867263-2-cleger@rivosinc.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240619153913.867263-1-cleger@rivosinc.com> References: <20240619153913.867263-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_084113_211372_25FE887A X-CRM114-Status: UNSURE ( 9.26 ) X-CRM114-Notice: Please train this message. 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 Add description for the Zaamo and Zalrsc ISA extension[1]. Link: https://github.com/riscv/riscv-zaamo-zalrsc [1] Signed-off-by: Clément Léger Acked-by: Conor Dooley --- .../devicetree/bindings/riscv/extensions.yaml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/Documentation/devicetree/bindings/riscv/extensions.yaml b/Documentation/devicetree/bindings/riscv/extensions.yaml index 33f1a86efed8..982684e4daa1 100644 --- a/Documentation/devicetree/bindings/riscv/extensions.yaml +++ b/Documentation/devicetree/bindings/riscv/extensions.yaml @@ -171,12 +171,24 @@ properties: memory types as ratified in the 20191213 version of the privileged ISA specification. + - const: zaamo + description: | + The standard Zaamo extension for atomic memory operations as + ratified at commit e87412e621f1 ("integrate Zaamo and Zalrsc text + (#1304)") of the unprivileged ISA specification. + - const: zacas description: | The Zacas extension for Atomic Compare-and-Swap (CAS) instructions is supported as ratified at commit 5059e0ca641c ("update to ratified") of the riscv-zacas. + - const: zalrsc + description: | + The standard Zalrsc extension for load-reserved/store-conditional as + ratified at commit e87412e621f1 ("integrate Zaamo and Zalrsc text + (#1304)") of the unprivileged ISA specification. + - const: zba description: | The standard Zba bit-manipulation extension for address generation @@ -591,6 +603,13 @@ properties: then: contains: const: zca + # Zacas depends on Zaamo + - if: + contains: + const: zacas + then: + contains: + const: zaamo allOf: # Zcf extension does not exist on rv64 From patchwork Wed Jun 19 15:39:09 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: 13704190 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 C8E3DC27C79 for ; Wed, 19 Jun 2024 15:41:28 +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=BREfKWqb1iJFstFLyky+22XIpY9GmirsHhrYc8I3s1Q=; b=KODIGTc+6TvXfd eC8d/LCvt5bJ9wog8uJ60KEvSz6HdKEyynnU78WnXT/zQYgzZKynMVsCEPiAJPQrlBKwW5m3zAdfL Lqf6Un4zTqk5L55eCbtUzGk3sh7a0gZwOW5O7d8iHs7Kijsyre99Q/tx0yXhKDNpwHMuq2FdzNWgR VCFOhcXX6dJmK/Xyc9PPZ/TJ2ue71USlamJxKhh8slCLcFAXJ289/0CIF+rApdGzBC2kSkb3qy3m9 EOC2scAzb30+0uXBSnktrcHO5c7OA7G4hxweJJbFcH377C1thT34r1m0TXNxTBvy/3AXrVgKU/T4z 5bT0jy/Kwpi7vvWP4/tw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJxR3-00000001qap-2Y6w; Wed, 19 Jun 2024 15:41:21 +0000 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJxQx-00000001qUc-1clc for linux-riscv@lists.infradead.org; Wed, 19 Jun 2024 15:41:17 +0000 Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-364068c0ec5so76625f8f.2 for ; Wed, 19 Jun 2024 08:41:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1718811673; x=1719416473; 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=XxBaoVReHjYi8LCIKzJk71raI5rhLtFKE/0A3hAurqc=; b=XujtEj0Vqty134XKkkMujJTmdwC3WwmBuw0rzi31szqLHCJtWbSCL4nYThfpFUpHag 1l9NzWJ8I5UxaB5zoHzH069GjSdQCjpNKJApQhE2zkzFPnNztFaEVZDaZTKyf30kUd5a GORTEnKxUT+TpLnKKXH1jfEcB+SorSTIUrA8NSULb5w2GPaNS5KudlegppzFXgj3fxDW 7tzkeFfUpYd2yjrZAdTDQUiLHkuMkaha//2uOb/dzGlhS5LCUnthDMtXlo9vh3T2KN9f SKE/yay9XcPENcv5EPA5D76x7Rit0c4dcRJ/wE74LgngHcvt9xUsvHQNVQwhC7dOPwPE qaKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718811673; x=1719416473; 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=XxBaoVReHjYi8LCIKzJk71raI5rhLtFKE/0A3hAurqc=; b=RqA9yF0H1wBnbibC403SivvWJ8MVxG0yfcm7DSXpvtPSH99vu4JntfHlqgJnVzmYOJ rxp0hWSSl2GKE6+csnrPcAawyzG8Ktwy8CsgjqC8tXHwLKK/Y8XzoUe3trdlRPFuOVkD l/meacZuqm9+EsREzLo357tKwBCxhZPB9yrXr4ei23ytZJKSUqgg2KwO0RWqD91i/5vz h63VhkDr4b5GBiJ7KYGeP1hbR8Cp5zSsNiWevMGOPF5FUctn/QYaFEkBi6v4xKxnC0JW tt7HWZ445Q8Kx+ItHyIcrU0V3USn7ZkLjIaVcV1I0nkL3ug4e/9tQExndaDvwrGxI5MR 1hVg== X-Forwarded-Encrypted: i=1; AJvYcCWIyi0wKUT9XznE8jSNyToPiRfShIxvn+ItcLlzK7dyZ2QsbK3UrH9reJ9qT8CS0fr60cmqpeOSSlhfyggc86A93/PZ9m1Ir3Ea5VRe0oV0 X-Gm-Message-State: AOJu0YxrnmrsWY9wWOfxu8e8a5U9k80TwmxzirvYaxC/WwL1Ii7p8wgn LEQDoDaeikDQnDmJyhUCmyViuUHborzFj9sziMgbAidZ5MpqX3Tf7VRP0Zxb0mI= X-Google-Smtp-Source: AGHT+IFz7mNhNVrkeHHVYr8mBns/F7ItFsjrGXd+9ip+r+Vpj1iuLdfUz+P+4a8dyx9jXLcARTyeFg== X-Received: by 2002:adf:cf02:0:b0:364:7a63:93c7 with SMTP id ffacd0b85a97d-3647a639555mr16771f8f.1.1718811672887; Wed, 19 Jun 2024 08:41:12 -0700 (PDT) Received: from carbon-x1.. ([2a01:e0a:999:a3a0:819d:b9d2:9c2:3b7a]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3607509c785sm17392292f8f.34.2024.06.19.08.41.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Jun 2024 08:41:11 -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 , Atish Patra Cc: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= , 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 2/5] riscv: add parsing for Zaamo and Zalrsc extensions Date: Wed, 19 Jun 2024 17:39:09 +0200 Message-ID: <20240619153913.867263-3-cleger@rivosinc.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240619153913.867263-1-cleger@rivosinc.com> References: <20240619153913.867263-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_084115_480411_22C0AA0F X-CRM114-Status: GOOD ( 12.29 ) 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 These 2 new extensions are actually a subset of the A extension which provides atomic memory operations and load-reserved/store-conditional instructions. Signed-off-by: Clément Léger Acked-by: Conor Dooley --- arch/riscv/include/asm/hwcap.h | 2 ++ arch/riscv/kernel/cpufeature.c | 9 ++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/arch/riscv/include/asm/hwcap.h b/arch/riscv/include/asm/hwcap.h index 4880324a1b29..69be244bce4b 100644 --- a/arch/riscv/include/asm/hwcap.h +++ b/arch/riscv/include/asm/hwcap.h @@ -92,6 +92,8 @@ #define RISCV_ISA_EXT_ZCD 83 #define RISCV_ISA_EXT_ZCF 84 #define RISCV_ISA_EXT_ZCMOP 85 +#define RISCV_ISA_EXT_ZAAMO 86 +#define RISCV_ISA_EXT_ZALRSC 87 #define RISCV_ISA_EXT_XLINUXENVCFG 127 diff --git a/arch/riscv/kernel/cpufeature.c b/arch/riscv/kernel/cpufeature.c index ec4bff7a827c..d71e5bd58acc 100644 --- a/arch/riscv/kernel/cpufeature.c +++ b/arch/riscv/kernel/cpufeature.c @@ -156,6 +156,11 @@ static int riscv_ext_zcf_validate(const struct riscv_isa_ext_data *data, return -EPROBE_DEFER; } +static const unsigned int riscv_a_exts[] = { + RISCV_ISA_EXT_ZAAMO, + RISCV_ISA_EXT_ZALRSC, +}; + static const unsigned int riscv_zk_bundled_exts[] = { RISCV_ISA_EXT_ZBKB, RISCV_ISA_EXT_ZBKC, @@ -327,7 +332,7 @@ static const unsigned int riscv_c_exts[] = { const struct riscv_isa_ext_data riscv_isa_ext[] = { __RISCV_ISA_EXT_DATA(i, RISCV_ISA_EXT_i), __RISCV_ISA_EXT_DATA(m, RISCV_ISA_EXT_m), - __RISCV_ISA_EXT_DATA(a, RISCV_ISA_EXT_a), + __RISCV_ISA_EXT_SUPERSET(a, RISCV_ISA_EXT_a, riscv_a_exts), __RISCV_ISA_EXT_DATA(f, RISCV_ISA_EXT_f), __RISCV_ISA_EXT_DATA(d, RISCV_ISA_EXT_d), __RISCV_ISA_EXT_DATA(q, RISCV_ISA_EXT_q), @@ -346,7 +351,9 @@ const struct riscv_isa_ext_data riscv_isa_ext[] = { __RISCV_ISA_EXT_DATA(zihintpause, RISCV_ISA_EXT_ZIHINTPAUSE), __RISCV_ISA_EXT_DATA(zihpm, RISCV_ISA_EXT_ZIHPM), __RISCV_ISA_EXT_DATA(zimop, RISCV_ISA_EXT_ZIMOP), + __RISCV_ISA_EXT_DATA(zaamo, RISCV_ISA_EXT_ZAAMO), __RISCV_ISA_EXT_DATA(zacas, RISCV_ISA_EXT_ZACAS), + __RISCV_ISA_EXT_DATA(zalrsc, RISCV_ISA_EXT_ZALRSC), __RISCV_ISA_EXT_DATA(zfa, RISCV_ISA_EXT_ZFA), __RISCV_ISA_EXT_DATA(zfh, RISCV_ISA_EXT_ZFH), __RISCV_ISA_EXT_DATA(zfhmin, RISCV_ISA_EXT_ZFHMIN), From patchwork Wed Jun 19 15:39:10 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: 13704191 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 8057AC27C53 for ; Wed, 19 Jun 2024 15:41:30 +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=KDUb7/GwHtyOErh8lOGTXWNjVbGphgFwZEJDkB85d5w=; b=hst6KqXFlrA6cp P46LvWSlNPEhUEZ5hXsJltEWP6xA8f+Rkg2FC5DZmF3BwEDqwQbXsVWiEsThvGV3BN5D8H78UBsrb otje1wmBrRaqqHpFO3oX00YD3KXrmvgAVABEQPb+Mml6dgqWeKmcU4auGlIe272O5gxeKtpjsYALS Sk4rEWVpemzXk1QNmWKKD3sCxjUjj0npfA86FThVhjP6lDbCEm0w3dyL1dCCyXJX+KYwx8kHHi+WN TfuEwJDYfSOIjwhwjjs3fyZZIy0RNjH6eBgJc7ZmJRY3xiXPsasK7DBlBDjk2c8R+F0aBGrBP6MCK cQLb9+PMw+TRs5R861KQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJxR8-00000001qcY-0XAk; Wed, 19 Jun 2024 15:41:26 +0000 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJxQx-00000001qVB-2Z55 for linux-riscv@lists.infradead.org; Wed, 19 Jun 2024 15:41:17 +0000 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-42181803bf2so4909185e9.1 for ; Wed, 19 Jun 2024 08:41:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1718811674; x=1719416474; 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=GPY+3E4dBoFlMa6qj3x8QVsLE7eX+roIHLt6ynEnu2U=; b=MGy0S+zwTDbP01RGavRb3eKm9pY1ZxLLcaUmkCAPXqAtXes64jZBVjR5p/v0USNRJs nXD4R6TAr8OHssMLBtmeMW7ARQFlAl1k6jq3MKPfEulXa568o0iFBq1ttCueCBSI+FPH B9hS32KgoXSAbPh6fhMqAoDIej204tMe+tMjyWYNni0LMq94G3SNWpU+6xuihgyryGxy CIIzrN9pbfdZPhqNCDgel5fFFXxYicL/hkxhAzFVBk6M9QchE3So3UxURmtLtYYtB+Hx DsrwPAnBsF73rCdCtMdadR/a3qcQoEAXsk5KI7HrX2ikCKGQj1DcOU4nndjDrpW4667K 7Y9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718811674; x=1719416474; 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=GPY+3E4dBoFlMa6qj3x8QVsLE7eX+roIHLt6ynEnu2U=; b=miFk8DnrXQkcsGZBmsqDVXY0oq4SL8M7NkyzWIm0PExwJ0inVlLJ1rhejIXMulN5WL 9ozxAou8kb1edns5AhnhKi/FClj6Jw5vz9F68SsehbdlPOSIIuD+Y8vMH2nddwTpNEbn 7BmyoID1mN6DyMCRSFpnAq9eRyysUZMpqTvkuUQMVssayNXXml53/FR3b3wBkhDwza7m hbIZeQoJ16WxG1UiImXFH1Jh8XqVDQ7m53sJx4BJINX8ZsdLNLaZpOhdowyD1Y3NytmB nJ+RCrJNutxAs8X6AnfceDGcZKkjGQV5o4dsDEFGi0jYbmfl/5NrvafKNDepWgms7f9V kVPw== X-Forwarded-Encrypted: i=1; AJvYcCUfM4gGiTvUWFVJHslpdxrKRK/WQuX+/0XHV8zqj4i9HuDrs5YN8mXdxsHdMq+frS/fc1HZn82eCbUrJCx5BZwXpbkSOd0FWKL3QAgMkuHY X-Gm-Message-State: AOJu0Yx7jvBY1RzBwABErkeUU/+IqLyKTcRpn/5Gv9ekEIwDTKGGvEgh fl8TBdBEKZQOEMMCcz5/fSoDqxvN9jpFeThfAivt0O8xczSaqOGidWWCZIx3Fuk= X-Google-Smtp-Source: AGHT+IHEyMK/ITgXlMXOhDLGJETYUb24IsTevTAqgLrmuWFBKFkU3n8nX5A972+nIAwKJBmfBumqAA== X-Received: by 2002:a5d:5f93:0:b0:35f:2929:846e with SMTP id ffacd0b85a97d-363171e28demr2732165f8f.1.1718811673916; Wed, 19 Jun 2024 08:41:13 -0700 (PDT) Received: from carbon-x1.. ([2a01:e0a:999:a3a0:819d:b9d2:9c2:3b7a]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3607509c785sm17392292f8f.34.2024.06.19.08.41.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Jun 2024 08:41:13 -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 , Atish Patra Cc: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= , 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 3/5] riscv: hwprobe: export Zaamo and Zalrsc extensions Date: Wed, 19 Jun 2024 17:39:10 +0200 Message-ID: <20240619153913.867263-4-cleger@rivosinc.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240619153913.867263-1-cleger@rivosinc.com> References: <20240619153913.867263-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_084115_849897_16B313F1 X-CRM114-Status: GOOD ( 11.31 ) 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 the Zaamo and Zalrsc extensions to userspace using hwprobe. Signed-off-by: Clément Léger Reviewed-by: Charlie Jenkins --- Documentation/arch/riscv/hwprobe.rst | 8 ++++++++ arch/riscv/include/uapi/asm/hwprobe.h | 2 ++ arch/riscv/kernel/sys_hwprobe.c | 2 ++ 3 files changed, 12 insertions(+) diff --git a/Documentation/arch/riscv/hwprobe.rst b/Documentation/arch/riscv/hwprobe.rst index 25d783be2878..6836a789a9b1 100644 --- a/Documentation/arch/riscv/hwprobe.rst +++ b/Documentation/arch/riscv/hwprobe.rst @@ -235,6 +235,14 @@ The following keys are defined: supported as defined in the RISC-V ISA manual starting from commit c732a4f39a4 ("Zcmop is ratified/1.0"). + * :c:macro:`RISCV_HWPROBE_EXT_ZAAMO`: The Zaamo extension is supported as + defined in the in the RISC-V ISA manual starting from commit e87412e621f1 + ("integrate Zaamo and Zalrsc text (#1304)"). + + * :c:macro:`RISCV_HWPROBE_EXT_ZALRSC`: The Zalrsc extension is supported as + defined in the in the RISC-V ISA manual starting from commit e87412e621f1 + ("integrate Zaamo and Zalrsc text (#1304)"). + * :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 920fc6a586c9..52cd161e9a94 100644 --- a/arch/riscv/include/uapi/asm/hwprobe.h +++ b/arch/riscv/include/uapi/asm/hwprobe.h @@ -71,6 +71,8 @@ struct riscv_hwprobe { #define RISCV_HWPROBE_EXT_ZCD (1ULL << 45) #define RISCV_HWPROBE_EXT_ZCF (1ULL << 46) #define RISCV_HWPROBE_EXT_ZCMOP (1ULL << 47) +#define RISCV_HWPROBE_EXT_ZAAMO (1ULL << 48) +#define RISCV_HWPROBE_EXT_ZALRSC (1ULL << 49) #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 3d1aa13a0bb2..e09f1bc3af17 100644 --- a/arch/riscv/kernel/sys_hwprobe.c +++ b/arch/riscv/kernel/sys_hwprobe.c @@ -116,6 +116,8 @@ static void hwprobe_isa_ext0(struct riscv_hwprobe *pair, EXT_KEY(ZCA); EXT_KEY(ZCB); EXT_KEY(ZCMOP); + EXT_KEY(ZAAMO); + EXT_KEY(ZALRSC); /* * All the following extensions must depend on the kernel From patchwork Wed Jun 19 15:39:11 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: 13704192 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 E837FC27C79 for ; Wed, 19 Jun 2024 15:41:35 +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=fTVkaHOimV6BlGE9pDLeePZvvrW6ZhXcr3N17VdzIGw=; b=nboqBJRxYZaK9o DX0imXWSfkihPvC2HRASUgMaq2Dzfr+grnU4va3nxdzUf0b6oFVSKA+423QtShmYNUHj5TgyXlJKd SlCiq5f6z6u/VGF7gQy7c3Xqo2FPTEkfKT7X4bC5EzZGCaEgrLGU453SQNxDe0RjDJiY52ncnUFP/ Wc/mjmjaWpaq2PP2RdGGgmPpiKKwBG6m3jaERBWxf+OWS65wlLMubFaWjP6RUjU6N1rkaNI+BfOae 4FNCVvzeaGBB7x12xIma4M87Tw/C+ZZuwezl+ZXtbzgw33L0gZ3NQy7TdVt7CHuPvS1ZKgFjJLqXx UX3e+SU/GLd5U17UFrzg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJxRB-00000001qfV-0GHa; Wed, 19 Jun 2024 15:41:29 +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 1sJxQy-00000001qVk-15V0 for linux-riscv@lists.infradead.org; Wed, 19 Jun 2024 15:41:18 +0000 Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-363d0f1ceaeso70952f8f.2 for ; Wed, 19 Jun 2024 08:41:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1718811675; x=1719416475; 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=6obIhMCgJtCMV7DNAB1Eq7WrI+7/yuJDuJixMHQfyjs=; b=hB3HlfdKP5AGq4YqeEuX4ar/NT+NwmQ3XNmeogKzvCs8jBl5nPrbWYePk8PLmRbJS3 0VzF/0NGVB+QhXF66gxcznoeLxUMuq/r5a0NMIXHtj8cMS11cir8M4pdD59nqOcqbptW kyMSz7+JG9S2oIAkclXvD4yMv2U6FR4fN3gFHW0+BB43Qa+dvq7L0ZjRLZ74VOnB3fAC GBsEwMWTrDW3OZV6w457nWinlxsfFZKbBLfy07XUpX/swhdjK09genoudqJ3SaOnbXeI TLOJKxzBGRJu+K1N/zG3Dh+sHhVFLDB85pkQiF1zTSn52KZp6syzQTneCTPeZ00irkDr cPlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718811675; x=1719416475; 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=6obIhMCgJtCMV7DNAB1Eq7WrI+7/yuJDuJixMHQfyjs=; b=lC3ybIJP2dXZvxptuJpcEcP/e82YjrHYIQX/hDi50jHJsHUd7mQ/5bSZucO7mPKQdv r4W1tWSB+oir9ZGymM+7NjZdjrtGB1az2+jg7whoRsknf0xMjXTeryWs/i+IrIpdEYzP cNyFBrDY08Rpjfg3msGVp9c/1ky3YTkHqnbHSuOwNp6jjs378EJQGW9wyFLtxpM/V17U 3Ng3JDhMedpT4mwzzm43GaOAs6IfOO72j38yCF/yj//wmHpFzXtdjpswvHBtBZR+SrUj I9djQU5VS0XPXDRZcsFhj2ji0ZuX3g7t46U1iLuBEBN7FzFhL5nhgndyIh0k0A58DoEQ XZ2A== X-Forwarded-Encrypted: i=1; AJvYcCWZVbA+AzoTz7va3WJCWqWhZ5BHF3D5d9rvw+tRC0UiNo8zUM24Roy93wGv+Cv4GYCzqaoo5ndZLcjrVrX7BETJN2o5xCzokxqV2NbAyaRW X-Gm-Message-State: AOJu0YzltFDslZL3esfZl2Wfcvgu6r5H7x4oKEGnOb/suXpidnlDvM5W aEdkRPSU8bYMQrb8hbs5L90ouMk4vuUll79OClNg6lixPv0xsrwfP3RJyh/NRzw= X-Google-Smtp-Source: AGHT+IEsiGCR06DYSznwuNGZ/RtWasKc+Sn+mfD0wbhYFJwAh2e2fAjrUA7ukaEqVJFeFkb/5sRZzQ== X-Received: by 2002:a05:6000:18a2:b0:360:872b:7e03 with SMTP id ffacd0b85a97d-36313fd733dmr2801721f8f.0.1718811674851; Wed, 19 Jun 2024 08:41:14 -0700 (PDT) Received: from carbon-x1.. ([2a01:e0a:999:a3a0:819d:b9d2:9c2:3b7a]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3607509c785sm17392292f8f.34.2024.06.19.08.41.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Jun 2024 08:41:14 -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 , Atish Patra Cc: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= , 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 4/5] RISC-V: KVM: Allow Zaamo/Zalrsc extensions for Guest/VM Date: Wed, 19 Jun 2024 17:39:11 +0200 Message-ID: <20240619153913.867263-5-cleger@rivosinc.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240619153913.867263-1-cleger@rivosinc.com> References: <20240619153913.867263-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_084116_439094_57DC47E4 X-CRM114-Status: UNSURE ( 9.76 ) X-CRM114-Notice: Please train this message. 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 Extend the KVM ISA extension ONE_REG interface to allow KVM user space to detect and enable Zaamo/Zalrsc extensions for Guest/VM. Signed-off-by: Clément Léger --- arch/riscv/include/uapi/asm/kvm.h | 2 ++ arch/riscv/kvm/vcpu_onereg.c | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/arch/riscv/include/uapi/asm/kvm.h b/arch/riscv/include/uapi/asm/kvm.h index a6215634df7c..f10c6e133d4d 100644 --- a/arch/riscv/include/uapi/asm/kvm.h +++ b/arch/riscv/include/uapi/asm/kvm.h @@ -174,6 +174,8 @@ enum KVM_RISCV_ISA_EXT_ID { KVM_RISCV_ISA_EXT_ZCD, KVM_RISCV_ISA_EXT_ZCF, KVM_RISCV_ISA_EXT_ZCMOP, + KVM_RISCV_ISA_EXT_ZAAMO, + KVM_RISCV_ISA_EXT_ZALRSC, KVM_RISCV_ISA_EXT_MAX, }; diff --git a/arch/riscv/kvm/vcpu_onereg.c b/arch/riscv/kvm/vcpu_onereg.c index fa5ee544bc69..0972a997beca 100644 --- a/arch/riscv/kvm/vcpu_onereg.c +++ b/arch/riscv/kvm/vcpu_onereg.c @@ -41,7 +41,9 @@ static const unsigned long kvm_isa_ext_arr[] = { KVM_ISA_EXT_ARR(SVINVAL), KVM_ISA_EXT_ARR(SVNAPOT), KVM_ISA_EXT_ARR(SVPBMT), + KVM_ISA_EXT_ARR(ZAAMO), KVM_ISA_EXT_ARR(ZACAS), + KVM_ISA_EXT_ARR(ZALRSC), KVM_ISA_EXT_ARR(ZBA), KVM_ISA_EXT_ARR(ZBB), KVM_ISA_EXT_ARR(ZBC), @@ -131,7 +133,9 @@ static bool kvm_riscv_vcpu_isa_disable_allowed(unsigned long ext) case KVM_RISCV_ISA_EXT_SSTC: case KVM_RISCV_ISA_EXT_SVINVAL: case KVM_RISCV_ISA_EXT_SVNAPOT: + case KVM_RISCV_ISA_EXT_ZAAMO: case KVM_RISCV_ISA_EXT_ZACAS: + case KVM_RISCV_ISA_EXT_ZALRSC: case KVM_RISCV_ISA_EXT_ZBA: case KVM_RISCV_ISA_EXT_ZBB: case KVM_RISCV_ISA_EXT_ZBC: From patchwork Wed Jun 19 15:39:12 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: 13704193 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 E5C38C27C53 for ; Wed, 19 Jun 2024 15:41:38 +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=Abz7UAFqiN67ddQZR5wsOJSM/BeJeVsqyZKOjwE2fX8=; b=KOMOzXtVLKlvYO pMR3wpKBeVEot84LYXoTS1YUEn/q08TLAaJm7tVrOJ8wDfOrVoej/gyT6z2TicVm9o4pJkzSGTV8i ogbYfc4FGb3KuW+ksrUMpuEf3k1cfFiUpemHdyLm308gdb8TIjhP6pmrSIavxL866/p5kVLUutiqs R0BAYd310pGsUK9p+vO1996WBTOBxxZPRM3lQ0xd4BKc6dNupY1IOLvAVWrDx7E2ImOoyxrontaRY 9YSj2y+XkRineuxLgf8//bYsnrEERPuW2xCgMp1nnefoqGn4Bk6STJlhfsGKC8jFVhApZIocNQTcu 6bIvzJ4NP+f7Ax+GIBmg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJxRH-00000001qjg-2FgT; Wed, 19 Jun 2024 15:41:35 +0000 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJxR0-00000001qWp-26OL for linux-riscv@lists.infradead.org; Wed, 19 Jun 2024 15:41:20 +0000 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-42181803bf2so4909285e9.1 for ; Wed, 19 Jun 2024 08:41:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1718811676; x=1719416476; 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=uhmrjq4H2Oq8xJPevOPzXZFQ+Nl3u1sJLUiSeD49DFE=; b=RGE9CB2EQzeCSocRK1YporQkp08YmIMYUU4SYQEHPSagkPYC3iTPw4z/DV21HEXBmM 5k5FD7OK9734pO6YmcdJaakKeCK8oVxWV45xs3FQVkLs6+dKmwBuJp2z9KNSu6bSj2uK CgqKiWs9fRjYjYCl6h1A4nVhE7Gm4pSj8r1N4/ApxP2SOJW7mnqGaVLw7Vtx8WXDLRPF oFOguyJ5fmQD8CnJhjHFK+iES8t5ZiOjDuKL/P6oMCQLA1jzGSClygTmsGwqRXTILo83 r4dF16DdcmQFDnVTfvz8S6yRQY8MrhEXrPDL/WOxk9aQTRLgtpAOg/WIyiEibXn1fXym lB9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718811676; x=1719416476; 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=uhmrjq4H2Oq8xJPevOPzXZFQ+Nl3u1sJLUiSeD49DFE=; b=XglyrMygj+OSK7R2yCFrB9KI7iWxlmwMTmKsd9L/V3SFYiXUREhPSWqeyXO4nQ2M6p xod0K0optoO2pXKGX7LK2enfOgd5rRJbsJMOrfmk+AgEhxICSXi2uQg2LHytuB8LOKxu k1t29rcP8sPzyb6ZyjXtiJPsxQDOGR9udl4wdIE0X+GwdQD602w8+HW/o7gpBmEpdoK+ 2o8FPZKeeUar/HiN53CViNc89/r6S72EUO3YVG9zzo6AOdh4mSOodE9XqfLEFoisrG70 Kozn6PXzb1MmJBmwKOeWMGOjnwahrYKKeO3bKJClL9PmLU/gV3OV+wQlILwss3RXsP1E UUgw== X-Forwarded-Encrypted: i=1; AJvYcCUI5IRMFSXPO3zn/06d4/YgZODzaS4Zb7yk5VE+zpA1y45t6+kapxdLR0yMEu/YYBrBVwjsGPDvKwtuPV0yvL1VV1vMBd0Fgq2/vmoTTj+q X-Gm-Message-State: AOJu0YwEsuucm0y0hrSCKcFy2XjysdZiRjAmzlRx5vd4QlKJcXBK91Z3 w58SWkiLNdQoarbXRj9uZHU8rnWh+FCSUYXpDD3Yxbk4LkscY+XlJBqSTmwVOOA= X-Google-Smtp-Source: AGHT+IGjwtUZf3kMWB9g1O1qJeQzBRQZ0qEbWnfWNveuCVuurscQ/RMRjo/RFMkwbrEud2Tb1Hd71w== X-Received: by 2002:a05:600c:1d09:b0:422:2f06:92d1 with SMTP id 5b1f17b1804b1-42475296800mr18928745e9.2.1718811675796; Wed, 19 Jun 2024 08:41:15 -0700 (PDT) Received: from carbon-x1.. ([2a01:e0a:999:a3a0:819d:b9d2:9c2:3b7a]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3607509c785sm17392292f8f.34.2024.06.19.08.41.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Jun 2024 08:41:15 -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 , Atish Patra Cc: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= , 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 5/5] KVM: riscv: selftests: Add Zaamo/Zalrsc extensions to get-reg-list test Date: Wed, 19 Jun 2024 17:39:12 +0200 Message-ID: <20240619153913.867263-6-cleger@rivosinc.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240619153913.867263-1-cleger@rivosinc.com> References: <20240619153913.867263-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_084118_556547_178C7F56 X-CRM114-Status: UNSURE ( 9.44 ) X-CRM114-Notice: Please train this message. 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 The KVM RISC-V allows Zaamo/Zalrsc extensions for Guest/VM so add these extensions to get-reg-list test. Signed-off-by: Clément Léger --- tools/testing/selftests/kvm/riscv/get-reg-list.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tools/testing/selftests/kvm/riscv/get-reg-list.c b/tools/testing/selftests/kvm/riscv/get-reg-list.c index 1a5637a6ea1e..70216a1760c3 100644 --- a/tools/testing/selftests/kvm/riscv/get-reg-list.c +++ b/tools/testing/selftests/kvm/riscv/get-reg-list.c @@ -48,7 +48,9 @@ bool filter_reg(__u64 reg) case KVM_REG_RISCV_ISA_EXT | KVM_REG_RISCV_ISA_SINGLE | KVM_RISCV_ISA_EXT_SVINVAL: case KVM_REG_RISCV_ISA_EXT | KVM_REG_RISCV_ISA_SINGLE | KVM_RISCV_ISA_EXT_SVNAPOT: case KVM_REG_RISCV_ISA_EXT | KVM_REG_RISCV_ISA_SINGLE | KVM_RISCV_ISA_EXT_SVPBMT: + case KVM_REG_RISCV_ISA_EXT | KVM_REG_RISCV_ISA_SINGLE | KVM_RISCV_ISA_EXT_ZAAMO: case KVM_REG_RISCV_ISA_EXT | KVM_REG_RISCV_ISA_SINGLE | KVM_RISCV_ISA_EXT_ZACAS: + case KVM_REG_RISCV_ISA_EXT | KVM_REG_RISCV_ISA_SINGLE | KVM_RISCV_ISA_EXT_ZALRSC: case KVM_REG_RISCV_ISA_EXT | KVM_REG_RISCV_ISA_SINGLE | KVM_RISCV_ISA_EXT_ZBA: case KVM_REG_RISCV_ISA_EXT | KVM_REG_RISCV_ISA_SINGLE | KVM_RISCV_ISA_EXT_ZBB: case KVM_REG_RISCV_ISA_EXT | KVM_REG_RISCV_ISA_SINGLE | KVM_RISCV_ISA_EXT_ZBC: @@ -420,7 +422,9 @@ static const char *isa_ext_single_id_to_str(__u64 reg_off) KVM_ISA_EXT_ARR(SVINVAL), KVM_ISA_EXT_ARR(SVNAPOT), KVM_ISA_EXT_ARR(SVPBMT), + KVM_ISA_EXT_ARR(ZAAMO), KVM_ISA_EXT_ARR(ZACAS), + KVM_ISA_EXT_ARR(ZALRSC), KVM_ISA_EXT_ARR(ZBA), KVM_ISA_EXT_ARR(ZBB), KVM_ISA_EXT_ARR(ZBC), @@ -950,7 +954,9 @@ KVM_ISA_EXT_SIMPLE_CONFIG(sstc, SSTC); KVM_ISA_EXT_SIMPLE_CONFIG(svinval, SVINVAL); KVM_ISA_EXT_SIMPLE_CONFIG(svnapot, SVNAPOT); KVM_ISA_EXT_SIMPLE_CONFIG(svpbmt, SVPBMT); +KVM_ISA_EXT_SIMPLE_CONFIG(zaamo, ZAAMO); KVM_ISA_EXT_SIMPLE_CONFIG(zacas, ZACAS); +KVM_ISA_EXT_SIMPLE_CONFIG(zalrsc, ZALRSC); KVM_ISA_EXT_SIMPLE_CONFIG(zba, ZBA); KVM_ISA_EXT_SIMPLE_CONFIG(zbb, ZBB); KVM_ISA_EXT_SIMPLE_CONFIG(zbc, ZBC); @@ -1012,7 +1018,9 @@ struct vcpu_reg_list *vcpu_configs[] = { &config_svinval, &config_svnapot, &config_svpbmt, + &config_zaamo, &config_zacas, + &config_zalrsc, &config_zba, &config_zbb, &config_zbc,