[Backport] KVM: add 'vlenb' Vector CSR#264
Conversation
|
开始测试 log: https://github.com/RVCK-Project/rvck/actions/runs/25144653384 参数解析结果
测试完成 详细结果:
Kunit Test Result[02:49:18] Testing complete. Ran 457 tests: passed: 445, skipped: 12
Kernel Build Result
Check Patch Result
|
|
5月rebase后审阅。 |
mainline inclusion from mainline-6.10-rc1 commit 197bd23 category: feature bugzilla: RVCK-Project#263 -------------------------------- 'vlenb', added to riscv_v_ext_state by commit c35f3aa ("RISC-V: vector: export VLENB csr in __sc_riscv_v_state"), isn't being initialized in guest_context. If we export 'vlenb' as a KVM CSR, something we want to do in the next patch, it'll always return 0. Set 'vlenb' to riscv_v_size/32. Signed-off-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com> Reviewed-by: Anup Patel <anup@brainfault.org> Signed-off-by: Anup Patel <anup@brainfault.org> Signed-off-by: Wang Yechao <wang.yechao255@zte.com.cn>
mainline inclusion from mainline-6.10-rc1 commit 2fa2903 category: feature bugzilla: RVCK-Project#263 -------------------------------- Userspace requires 'vlenb' to be able to encode it in reg ID. Otherwise it is not possible to retrieve any vector reg since we're returning EINVAL if reg_size isn't vlenb (see kvm_riscv_vcpu_vreg_addr()). Signed-off-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com> Reviewed-by: Anup Patel <anup@brainfault.org> Signed-off-by: Anup Patel <anup@brainfault.org> Signed-off-by: Wang Yechao <wang.yechao255@zte.com.cn>
mainline inclusion from mainline-v6.17-rc4 commit 7997662 category: feature bugzilla: RVCK-Project#263 -------------------------------- The userspace load can put up to 2048 bits into an xlen bit stack buffer. We want only xlen bits, so check the size beforehand. Fixes: 2fa2903 ("RISC-V: KVM: add 'vlenb' Vector CSR") Cc: stable@vger.kernel.org Signed-off-by: Radim Krčmář <rkrcmar@ventanamicro.com> Reviewed-by: Nutty Liu <liujingqi@lanxincomputing.com> Reviewed-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com> Link: https://lore.kernel.org/r/20250805104418.196023-4-rkrcmar@ventanamicro.com Signed-off-by: Anup Patel <anup@brainfault.org> Signed-off-by: Wang Yechao <wang.yechao255@zte.com.cn>
|
开始测试 log: https://github.com/RVCK-Project/rvck/actions/runs/25425044662 参数解析结果
测试完成 详细结果:
Kunit Test Result[08:43:55] Testing complete. Ran 457 tests: passed: 445, skipped: 12
Kernel Build Result
Check Patch Result
|
已rebase,请审阅 |
系上游补丁backport,boot测试通过,先合了。 |
issues: #263
补丁来自upstream,未做修改。
kvm one reg 增加对vlenb的支持,解决kvm虚拟机启动失败问题。
测试命令:
kvm虚拟机启动成功。