Skip to content

sync: rvck #89: KVM RISC-V report more ISA extensions through ONE_REG#161

Merged
xmzzz merged 20 commits into
OLK-6.6from
sync/rvck-pr-89
Apr 8, 2026
Merged

sync: rvck #89: KVM RISC-V report more ISA extensions through ONE_REG#161
xmzzz merged 20 commits into
OLK-6.6from
sync/rvck-pr-89

Conversation

@xmzzz
Copy link
Copy Markdown
Contributor

@xmzzz xmzzz commented Apr 8, 2026

Sync commits from rvck PR #89.

Source PR: RVCK-Project/rvck#89

Commits

  • 690bf231652d RISC-V: KVM: Allow Zicond extension for Guest/VM
  • 7d6c12bcf841 RISC-V: KVM: Allow Zbc extension for Guest/VM
  • f65d1abe7536 RISC-V: KVM: Allow scalar crypto extensions for Guest/VM
  • db3801758c11 RISC-V: KVM: Allow vector crypto extensions for Guest/VM
  • 7aab129a51cc RISC-V: KVM: Allow Zfh[min] extensions for Guest/VM
  • bceda3ff8308 RISC-V: KVM: Allow Zihintntl extension for Guest/VM
  • 3b1cf94480c5 RISC-V: KVM: Allow Zvfh[min] extensions for Guest/VM
  • 949de194fb88 RISC-V: KVM: Allow Zfa extension for Guest/VM
  • ab1454067495 RISC-V: KVM: Forward SEED CSR access to user space
  • 765b91bded99 RISC-V: KVM: Allow Ztso extension for Guest/VM
  • 68a5141f75e6 RISC-V: KVM: Allow Zacas extension for Guest/VM
  • 649e604e70c3 RISC-V: KVM: Allow Zimop extension for Guest/VM
  • 6a23a77fdb68 RISC-V: KVM: Allow Zca, Zcf, Zcd and Zcb extensions for Guest/VM
  • 34b77e23eca8 RISC-V: KVM: Allow Zcmop extension for Guest/VM
  • aed05fdc8d03 KVM: riscv: Support guest wrs.nto
  • 65a64a053874 RISC-V: KVM: Allow Smnpm and Ssnpm extensions for guests
  • 7004e8a8023c RISC-V: KVM: Add Svade and Svadu Extensions Support for Guest/VM
  • 12275108327d RISC-V: KVM: Allow Svvptc extension for Guest/VM
  • 0f05c1fdedb3 RISC-V: KVM: Allow Zabha extension for Guest/VM
  • 0359996619d2 RISC-V: KVM: Allow Ziccrse extension for Guest/VM

avpatel and others added 20 commits April 8, 2026 14:54
mainline inclusion
from Linux 6.6-rc6
commit df68f4d8cb496ea31fa42cf2620366571c05376b
category: feature
bugzilla: RVCK-Project/rvck#79

--------------------------------

We extend the KVM ISA extension ONE_REG interface to allow KVM
user space to detect and enable Zicond extension for Guest/VM.

Signed-off-by: Anup Patel <apatel@ventanamicro.com>
Signed-off-by: Anup Patel <anup@brainfault.org>
Signed-off-by: yechao-w <wang.yechao255@zte.com.cn>
Signed-off-by: Yanteng Si <si.yanteng@linux.dev>
Signed-off-by: Mingzheng Xing <xingmingzheng@iscas.ac.cn>
(cherry picked from commit 690bf23)
mainline inclusion
from Linux 6.6-rc6
commit 367188297254e7f81e3c3c94e6d6a623f757c4cb
category: feature
bugzilla: RVCK-Project/rvck#79

--------------------------------

We extend the KVM ISA extension ONE_REG interface to allow KVM
user space to detect and enable Zbc extension for Guest/VM.

Signed-off-by: Anup Patel <apatel@ventanamicro.com>
Signed-off-by: Anup Patel <anup@brainfault.org>
Signed-off-by: yechao-w <wang.yechao255@zte.com.cn>
Signed-off-by: Yanteng Si <si.yanteng@linux.dev>
Signed-off-by: Mingzheng Xing <xingmingzheng@iscas.ac.cn>
(cherry picked from commit 7d6c12b)
mainline inclusion
from Linux 6.6-rc6
commit f370b4e668f017f523968f7490163fa922dcd92e
category: feature
bugzilla: RVCK-Project/rvck#79

--------------------------------

We extend the KVM ISA extension ONE_REG interface to allow KVM
user space to detect and enable scalar crypto extensions for
Guest/VM. This includes extensions Zbkb, Zbkc, Zbkx, Zknd, Zkne,
Zknh, Zkr, Zksed, Zksh, and Zkt.

Signed-off-by: Anup Patel <apatel@ventanamicro.com>
Signed-off-by: Anup Patel <anup@brainfault.org>
Signed-off-by: yechao-w <wang.yechao255@zte.com.cn>
Signed-off-by: Yanteng Si <si.yanteng@linux.dev>
Signed-off-by: Mingzheng Xing <xingmingzheng@iscas.ac.cn>
(cherry picked from commit f65d1ab)
mainline inclusion
from Linux 6.6-rc6
commit afd1ef3adfbc36e35fcf4f742fd90aea6480a276
category: feature
bugzilla: RVCK-Project/rvck#79

--------------------------------

We extend the KVM ISA extension ONE_REG interface to allow KVM
user space to detect and enable vector crypto extensions for
Guest/VM. This includes extensions Zvbb, Zvbc, Zvkb, Zvkg,
Zvkned, Zvknha, Zvknhb, Zvksed, Zvksh, and Zvkt.

Signed-off-by: Anup Patel <apatel@ventanamicro.com>
Signed-off-by: Anup Patel <anup@brainfault.org>
Signed-off-by: yechao-w <wang.yechao255@zte.com.cn>
Signed-off-by: Yanteng Si <si.yanteng@linux.dev>
Signed-off-by: Mingzheng Xing <xingmingzheng@iscas.ac.cn>
(cherry picked from commit db38017)
mainline inclusion
from Linux 6.6-rc6
commit f3901ece5b3894177d1816208d0fb06b295617e0
category: feature
bugzilla: RVCK-Project/rvck#79

--------------------------------

We extend the KVM ISA extension ONE_REG interface to allow KVM
user space to detect and enable Zfh[min] extensions for Guest/VM.

Signed-off-by: Anup Patel <apatel@ventanamicro.com>
Signed-off-by: Anup Patel <anup@brainfault.org>
Signed-off-by: yechao-w <wang.yechao255@zte.com.cn>
Signed-off-by: Yanteng Si <si.yanteng@linux.dev>
Signed-off-by: Mingzheng Xing <xingmingzheng@iscas.ac.cn>
(cherry picked from commit 7aab129)
mainline inclusion
from Linux 6.6-rc6
commit ab6da9cdc3f3d1d091d657219fb6e98f710ee098
category: feature
bugzilla: RVCK-Project/rvck#79

--------------------------------

We extend the KVM ISA extension ONE_REG interface to allow KVM
user space to detect and enable Zihintntl extension for Guest/VM.

Signed-off-by: Anup Patel <apatel@ventanamicro.com>
Signed-off-by: Anup Patel <anup@brainfault.org>
Signed-off-by: yechao-w <wang.yechao255@zte.com.cn>
Signed-off-by: Yanteng Si <si.yanteng@linux.dev>
Signed-off-by: Mingzheng Xing <xingmingzheng@iscas.ac.cn>
(cherry picked from commit bceda3f)
mainline inclusion
from Linux 6.6-rc6
commit f46300285926c2b0d0c79bf40c87d45e169cecb6
category: feature
bugzilla: RVCK-Project/rvck#79

--------------------------------

We extend the KVM ISA extension ONE_REG interface to allow KVM
user space to detect and enable Zvfh[min] extensions for Guest/VM.

Signed-off-by: Anup Patel <apatel@ventanamicro.com>
Signed-off-by: Anup Patel <anup@brainfault.org>
Signed-off-by: yechao-w <wang.yechao255@zte.com.cn>
Signed-off-by: Yanteng Si <si.yanteng@linux.dev>
Signed-off-by: Mingzheng Xing <xingmingzheng@iscas.ac.cn>
(cherry picked from commit 3b1cf94)
mainline inclusion
from Linux 6.6-rc6
commit 41182cc6f507011a2e6c82657779e451ed9942bb
category: feature
bugzilla: RVCK-Project/rvck#79

--------------------------------

We extend the KVM ISA extension ONE_REG interface to allow KVM
user space to detect and enable Zfa extension for Guest/VM.

Signed-off-by: Anup Patel <apatel@ventanamicro.com>
Signed-off-by: Anup Patel <anup@brainfault.org>
Signed-off-by: yechao-w <wang.yechao255@zte.com.cn>
Signed-off-by: Yanteng Si <si.yanteng@linux.dev>
Signed-off-by: Mingzheng Xing <xingmingzheng@iscas.ac.cn>
(cherry picked from commit 949de19)
mainline inclusion
from Linux 6.6-rc5
commit d808f0b1be4888a87524164bc7dad2242734de38
category: feature
bugzilla: RVCK-Project/rvck#79

--------------------------------

The SEED CSR access from VS/VU mode (guest) will always trap to
HS-mode (KVM) when Zkr extension is available to the Guest/VM.
Forward this CSR access to KVM user space so that it can be
emulated based on the method chosen by VMM.
Fixes: f370b4e668f0 ("RISC-V: KVM: Allow scalar crypto extensions for Guest/VM")

Signed-off-by: Anup Patel <apatel@ventanamicro.com>
Signed-off-by: Anup Patel <anup@brainfault.org>
Signed-off-by: yechao-w <wang.yechao255@zte.com.cn>
Signed-off-by: Yanteng Si <si.yanteng@linux.dev>
Signed-off-by: Mingzheng Xing <xingmingzheng@iscas.ac.cn>
(cherry picked from commit ab14540)
mainline inclusion
from Linux 6.6-rc6
commit f943ebe2ec26272d71f9c7643ec667c616419bb1
category: feature
bugzilla: RVCK-Project/rvck#79

--------------------------------

Extend the KVM ISA extension ONE_REG interface to allow KVM user space
to detect and enable Ztso extension for Guest/VM.

Signed-off-by: Anup Patel <apatel@ventanamicro.com>
Signed-off-by: Anup Patel <anup@brainfault.org>
Signed-off-by: yechao-w <wang.yechao255@zte.com.cn>
Signed-off-by: Yanteng Si <si.yanteng@linux.dev>
Signed-off-by: Mingzheng Xing <xingmingzheng@iscas.ac.cn>
(cherry picked from commit 765b91b)
mainline inclusion
from Linux 6.6-rc6
commit 77fc0bfa43f83c1080b35a4915c767cf2c4979ff
category: feature
bugzilla: RVCK-Project/rvck#79

--------------------------------

Extend the KVM ISA extension ONE_REG interface to allow KVM user space
to detect and enable Zacas extension for Guest/VM.

Signed-off-by: Anup Patel <apatel@ventanamicro.com>
Signed-off-by: Anup Patel <anup@brainfault.org>
Signed-off-by: yechao-w <wang.yechao255@zte.com.cn>
Signed-off-by: Yanteng Si <si.yanteng@linux.dev>
Signed-off-by: Mingzheng Xing <xingmingzheng@iscas.ac.cn>
(cherry picked from commit 68a5141)
mainline inclusion
from Linux 6.6-rc6
commit fb2a3d63efefe6bd3718201daba479f4339bb4bf
category: feature
bugzilla: RVCK-Project/rvck#79

--------------------------------

Extend the KVM ISA extension ONE_REG interface to allow KVM user space
to detect and enable Zimop extension for Guest/VM.

Signed-off-by: Clément Léger <cleger@rivosinc.com>
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Signed-off-by: yechao-w <wang.yechao255@zte.com.cn>
Signed-off-by: Yanteng Si <si.yanteng@linux.dev>
Signed-off-by: Mingzheng Xing <xingmingzheng@iscas.ac.cn>
(cherry picked from commit 649e604)
mainline inclusion
from Linux 6.6-rc6
commit d964e8f2ae65dcc088345332d479d4fcc5a1d757
category: feature
bugzilla: RVCK-Project/rvck#79

--------------------------------

Extend the KVM ISA extension ONE_REG interface to allow KVM user space
to detect and enable Zca, Zcf, Zcd and Zcb extensions for Guest/VM.

Signed-off-by: Clément Léger <cleger@rivosinc.com>
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Signed-off-by: yechao-w <wang.yechao255@zte.com.cn>
Signed-off-by: Yanteng Si <si.yanteng@linux.dev>
Signed-off-by: Mingzheng Xing <xingmingzheng@iscas.ac.cn>
(cherry picked from commit 6a23a77)
mainline inclusion
from Linux 6.6-rc6
commit 29cf9b803e6e9f1421f090478e624ca4c637c835
category: feature
bugzilla: RVCK-Project/rvck#79

--------------------------------

Extend the KVM ISA extension ONE_REG interface to allow KVM user space
to detect and enable Zcmop extension for Guest/VM.

Signed-off-by: Clément Léger <cleger@rivosinc.com>
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Signed-off-by: yechao-w <wang.yechao255@zte.com.cn>
Signed-off-by: Yanteng Si <si.yanteng@linux.dev>
Signed-off-by: Mingzheng Xing <xingmingzheng@iscas.ac.cn>
(cherry picked from commit 34b77e2)
mainline inclusion
from Linux 6.6-rc6
commit 86d6a86e59e3aa425d829a935c0d92388e4fe55b
category: feature
bugzilla: RVCK-Project/rvck#79

--------------------------------

When a guest traps on wrs.nto, call kvm_vcpu_on_spin() to attempt
to yield to the lock holding VCPU. Also extend the KVM ISA extension
ONE_REG interface to allow KVM userspace to detect and enable the
Zawrs extension for the Guest/VM.

Signed-off-by: Andrew Jones <ajones@ventanamicro.com>
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Signed-off-by: yechao-w <wang.yechao255@zte.com.cn>
Signed-off-by: Yanteng Si <si.yanteng@linux.dev>
Signed-off-by: Mingzheng Xing <xingmingzheng@iscas.ac.cn>
(cherry picked from commit aed05fd)
mainline inclusion
from Linux 6.12-rc5
commit 1851e7836212c76bebb6944bb1541ddcccbea535
category: feature
bugzilla: RVCK-Project/rvck#79

--------------------------------

The interface for controlling pointer masking in VS-mode is henvcfg.PMM,
which is part of the Ssnpm extension, even though pointer masking in
HS-mode is provided by the Smnpm extension. As a result, emulating Smnpm
in the guest requires (only) Ssnpm on the host.
The guest configures Smnpm through the SBI Firmware Features extension,
which KVM does not yet implement, so currently the ISA extension has no
visible effect on the guest, and thus it cannot be disabled. Ssnpm is
configured using the senvcfg CSR within the guest, so that extension
cannot be hidden from the guest without intercepting writes to the CSR.

Signed-off-by: Samuel Holland <samuel.holland@sifive.com>
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Signed-off-by: yechao-w <wang.yechao255@zte.com.cn>
Signed-off-by: Yanteng Si <si.yanteng@linux.dev>
Signed-off-by: Mingzheng Xing <xingmingzheng@iscas.ac.cn>
(cherry picked from commit 65a64a0)
mainline inclusion
from Linux 6.13-rc1
commit 97eccf7db4f2e5e59d16bca45f7803ae3aeff6e1
category: feature
bugzilla: RVCK-Project/rvck#79

--------------------------------

We extend the KVM ISA extension ONE_REG interface to allow VMM tools to
detect and enable Svade and Svadu extensions for Guest/VM. Since the
henvcfg.ADUE is read-only zero if the menvcfg.ADUE is zero, the Svadu
extension is available for Guest/VM and the Svade extension is allowed
to disabledonly when arch_has_hw_pte_young() is true.

Signed-off-by: Yong-Xuan Wang <yongxuan.wang@sifive.com>
Signed-off-by: Anup Patel <anup@brainfault.org>
Signed-off-by: yechao-w <wang.yechao255@zte.com.cn>
Signed-off-by: Yanteng Si <si.yanteng@linux.dev>
Signed-off-by: Mingzheng Xing <xingmingzheng@iscas.ac.cn>
(cherry picked from commit 7004e8a)
mainline inclusion
from Linux 6.13-rc5
commit 0f891585971648a07e8b0c155e5b3eb697601d9d
category: feature
bugzilla: RVCK-Project/rvck#79

--------------------------------

Extend the KVM ISA extension ONE_REG interface to allow KVM user space
to detect and enable Svvptc extension for Guest/VM.

Signed-off-by: Quan Zhou <zhouquan@iscas.ac.cn>
Signed-off-by: Anup Patel <anup@brainfault.org>
Signed-off-by: yechao-w <wang.yechao255@zte.com.cn>
Signed-off-by: Yanteng Si <si.yanteng@linux.dev>
Signed-off-by: Mingzheng Xing <xingmingzheng@iscas.ac.cn>
(cherry picked from commit 1227510)
mainline inclusion
from Linux 6.13-rc6
commit 679e132c0ae2c34b425f32fb1a59fc04c6dc87cb
category: feature
bugzilla: RVCK-Project/rvck#79

--------------------------------

Extend the KVM ISA extension ONE_REG interface to allow KVM user space
to detect and enable Zabha extension for Guest/VM.

Signed-off-by: Quan Zhou <zhouquan@iscas.ac.cn>
Signed-off-by: Anup Patel <anup@brainfault.org>
Signed-off-by: yechao-w <wang.yechao255@zte.com.cn>
Signed-off-by: Yanteng Si <si.yanteng@linux.dev>
Signed-off-by: Mingzheng Xing <xingmingzheng@iscas.ac.cn>
(cherry picked from commit 0f05c1f)
mainline inclusion
from Linux 6.13-rc6
commit 79be257b579e72ae7c5aeb942700a449d467405f
category: feature
bugzilla: RVCK-Project/rvck#79

--------------------------------

Extend the KVM ISA extension ONE_REG interface to allow KVM user space
to detect and enable Ziccrse extension for Guest/VM.

Signed-off-by: Quan Zhou <zhouquan@iscas.ac.cn>
Signed-off-by: Anup Patel <anup@brainfault.org>
Signed-off-by: yechao-w <wang.yechao255@zte.com.cn>
Signed-off-by: Yanteng Si <si.yanteng@linux.dev>
Signed-off-by: Mingzheng Xing <xingmingzheng@iscas.ac.cn>
(cherry picked from commit 0359996)
@xmzzz xmzzz merged commit feb3156 into OLK-6.6 Apr 8, 2026
@xmzzz xmzzz deleted the sync/rvck-pr-89 branch April 8, 2026 06:54
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 8, 2026


开始测试 log: https://github.com/RVCK-Project/rvck-olk/actions/runs/24122211384

参数解析结果
args value
repository RVCK-Project/rvck-olk
head ref pull/161/head
base ref OLK-6.6
LAVA repo RVCK-Project/lavaci
LAVA Template lava-job-template/qemu/qemu-ltp.yaml
Testcase path lava-testcases/common-test/ltp/ltp.yaml
need run job kunit-test,kernel-build,check-patch,lava-trigger

测试完成

详细结果:

RVCK result

check result
kunit-test success
kernel-build success
lava-trigger success
check-patch success

Kunit Test Result

[06:59:52] Testing complete. Ran 454 tests: passed: 442, skipped: 12

Kernel Build Result

Kernel build succeeded: RVCK-Project/rvck-olk/161__1/

2a49631f984660101240e158599b8114 /srv/guix_result/e91305d2a1be596c205c383cbe33ac86bafbcf65/Image
070280c15aaf01fb930b4b2ba6d7cbfc /root/initramfs.img

LAVA Check

args:

result:

Lava check done! lava log: https://lava.oerv.ac.cn/scheduler/job/1753

lava result count: [fail]: 19, [pass]: 1587, [skip]: 293

Check Patch Result

Total Errors 0
Total Warnings 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants