Thread (15 messages) 15 messages, 5 authors, 2026-01-05

Re: [PATCH v2 4/5] riscv: KVM: allow Zilsd and Zclsd extensions for Guest/VM

From: Anup Patel <anup@brainfault.org>
Date: 2026-01-05 09:02:20
Also in: kvm, kvm-riscv, linux-devicetree, linux-kselftest, linux-riscv, lkml

On Tue, Aug 26, 2025 at 10:00 PM Pincheng Wang
[off-list ref] wrote:
quoted hunk ↗ jump to hunk
Extend the KVM ISA extension ONE_REG interface to allow KVM user space
to detect and enable Zilsd and Zclsd extensions for Guest/VM.

Signed-off-by: Pincheng Wang <redacted>
---
 arch/riscv/include/uapi/asm/kvm.h | 2 ++
 arch/riscv/kvm/vcpu_onereg.c      | 2 ++
 2 files changed, 4 insertions(+)
diff --git a/arch/riscv/include/uapi/asm/kvm.h b/arch/riscv/include/uapi/asm/kvm.h
index 5f59fd226cc5..beb7ce06dce8 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_ZCLSD,
+       KVM_RISCV_ISA_EXT_ZILSD,
        KVM_RISCV_ISA_EXT_ZAWRS,
        KVM_RISCV_ISA_EXT_SMNPM,
        KVM_RISCV_ISA_EXT_SSNPM,
The KVM_RISCV_ISA_EXT_ZCLSD and KVM_RISCV_ISA_EXT_ZILSD
MUST BE inserted at the end of enum to maintain backward compatibility
in the UAPI header.
quoted hunk ↗ jump to hunk
diff --git a/arch/riscv/kvm/vcpu_onereg.c b/arch/riscv/kvm/vcpu_onereg.c
index 2e1b646f0d61..8219769fc4a1 100644
--- a/arch/riscv/kvm/vcpu_onereg.c
+++ b/arch/riscv/kvm/vcpu_onereg.c
@@ -64,6 +64,7 @@ static const unsigned long kvm_isa_ext_arr[] = {
        KVM_ISA_EXT_ARR(ZCD),
        KVM_ISA_EXT_ARR(ZCF),
        KVM_ISA_EXT_ARR(ZCMOP),
+       KVM_ISA_EXT_ARR(ZCLSD),
        KVM_ISA_EXT_ARR(ZFA),
        KVM_ISA_EXT_ARR(ZFH),
        KVM_ISA_EXT_ARR(ZFHMIN),
@@ -78,6 +79,7 @@ static const unsigned long kvm_isa_ext_arr[] = {
        KVM_ISA_EXT_ARR(ZIHINTPAUSE),
        KVM_ISA_EXT_ARR(ZIHPM),
        KVM_ISA_EXT_ARR(ZIMOP),
+       KVM_ISA_EXT_ARR(ZILSD),
        KVM_ISA_EXT_ARR(ZKND),
        KVM_ISA_EXT_ARR(ZKNE),
        KVM_ISA_EXT_ARR(ZKNH),
Both ZCLSD and ZILSD must be inserted in alphabetical order
in the kvm_isa_ext_arr[] array.

I have taken care of the above comments at the time of merging.

Reviewed-by: Anup Patel <anup@brainfault.org>

Queued this patch for Linux-6.20

Thanks,
Anup
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help