KVM-RISCV Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Mayuresh Chitale <mchitale@ventanamicro.com>
To: kvm-riscv@lists.infradead.org
Subject: [PATCH v5 1/7] RISC-V: Detect Smstateen extension
Date: Wed, 13 Sep 2023 22:08:59 +0530	[thread overview]
Message-ID: <20230913163905.480819-2-mchitale@ventanamicro.com> (raw)
In-Reply-To: <20230913163905.480819-1-mchitale@ventanamicro.com>

Extend the ISA string parsing to detect the Smstateen extension. If the
extension is enabled then access to certain 'state' such as AIA CSRs in
VS mode is controlled by *stateen0 registers.

Signed-off-by: Mayuresh Chitale <mchitale@ventanamicro.com>
Reviewed-by: Andrew Jones <ajones@ventanamicro.com>
---
 arch/riscv/include/asm/hwcap.h | 1 +
 arch/riscv/kernel/cpufeature.c | 1 +
 2 files changed, 2 insertions(+)

diff --git a/arch/riscv/include/asm/hwcap.h b/arch/riscv/include/asm/hwcap.h
index b7b58258f6c7..0f520f7d058a 100644
--- a/arch/riscv/include/asm/hwcap.h
+++ b/arch/riscv/include/asm/hwcap.h
@@ -58,6 +58,7 @@
 #define RISCV_ISA_EXT_ZICSR		40
 #define RISCV_ISA_EXT_ZIFENCEI		41
 #define RISCV_ISA_EXT_ZIHPM		42
+#define RISCV_ISA_EXT_SMSTATEEN		43
 
 #define RISCV_ISA_EXT_MAX		64
 
diff --git a/arch/riscv/kernel/cpufeature.c b/arch/riscv/kernel/cpufeature.c
index 1cfbba65d11a..3755a8c2a9de 100644
--- a/arch/riscv/kernel/cpufeature.c
+++ b/arch/riscv/kernel/cpufeature.c
@@ -175,6 +175,7 @@ const struct riscv_isa_ext_data riscv_isa_ext[] = {
 	__RISCV_ISA_EXT_DATA(zbb, RISCV_ISA_EXT_ZBB),
 	__RISCV_ISA_EXT_DATA(zbs, RISCV_ISA_EXT_ZBS),
 	__RISCV_ISA_EXT_DATA(smaia, RISCV_ISA_EXT_SMAIA),
+	__RISCV_ISA_EXT_DATA(smstateen, RISCV_ISA_EXT_SMSTATEEN),
 	__RISCV_ISA_EXT_DATA(ssaia, RISCV_ISA_EXT_SSAIA),
 	__RISCV_ISA_EXT_DATA(sscofpmf, RISCV_ISA_EXT_SSCOFPMF),
 	__RISCV_ISA_EXT_DATA(sstc, RISCV_ISA_EXT_SSTC),
-- 
2.34.1



  reply	other threads:[~2023-09-13 16:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-13 16:38 [PATCH v5 0/7] Risc-V Kvm Smstateen Mayuresh Chitale
2023-09-13 16:38 ` Mayuresh Chitale [this message]
2023-09-13 16:39 ` [PATCH v5 2/7] dt-bindings: riscv: Add smstateen entry Mayuresh Chitale
2023-09-13 16:39 ` [PATCH v5 3/7] RISC-V: KVM: Add kvm_vcpu_config Mayuresh Chitale
2023-09-13 16:39 ` [PATCH v5 4/7] RISC-V: KVM: Enable Smstateen accesses Mayuresh Chitale
2023-09-13 16:39 ` [PATCH v5 5/7] RISCV: KVM: Add senvcfg context save/restore Mayuresh Chitale
2023-09-13 16:39 ` [PATCH v5 6/7] RISCV: KVM: Add sstateen0 " Mayuresh Chitale
2023-09-13 16:39 ` [PATCH v5 7/7] RISCV: KVM: Add sstateen0 to ONE_REG Mayuresh Chitale
2023-09-15  6:57 ` [PATCH v5 0/7] Risc-V Kvm Smstateen Anup Patel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230913163905.480819-2-mchitale@ventanamicro.com \
    --to=mchitale@ventanamicro.com \
    --cc=kvm-riscv@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox