linux/arch/riscv
Tan Chi 41e81f7e3e RISC-V: KVM: Fix HSM hart status error propagation
kvm_sbi_hsm_vcpu_get_status() returns SBI_ERR_INVALID_PARAM when
the requested hart does not exist. However, the HART_STATUS case
returns from the SBI handler without storing this error in
retdata->err_val.

As a result, a guest querying the status of a non-existent hart
observes SBI_SUCCESS instead of SBI_ERR_INVALID_PARAM.

Use the common SBI error handling path for HART_STATUS after
saving a valid hart state in retdata->out_val. This preserves
the returned error when kvm_sbi_hsm_vcpu_get_status() fails.

Fixes: bae0dfd74e ("RISC-V: KVM: Modify SBI extension handler to return SBI error code")
Cc: stable@vger.kernel.org
Assisted-by: LLM
Signed-off-by: Tan Chi <tanchi25@mails.ucas.ac.cn>
Reviewed-by: Anup Patel <anup@brainfault.org>
Link: https://lore.kernel.org/r/20260914031146.446157-1-tanchi25@mails.ucas.ac.cn
Signed-off-by: Anup Patel <anup@brainfault.org>
History 2026-09-15 18:55:51 +05:30
..
boot RISC-V updates for v7.3 2026-08-20 14:53:54 -07:00
configs soc: defconfig updates for 7.3 2026-08-18 19:47:08 -07:00
crypto crypto: riscv/aes - replace min_t with min in riscv64_aes_ctr_crypt 2026-05-22 20:25:29 +08:00
errata riscv/sifive: remove warning in errata 2026-07-29 11:43:28 -06:00
include RISC-V: KVM: Fix the conversion between vsip and hvip 2026-09-15 18:55:51 +05:30
kernel riscv: report Zfhmin/Zvfhmin when Zfh/Zvfh are present 2026-09-01 19:19:44 -06:00
kvm RISC-V: KVM: Fix HSM hart status error propagation 2026-09-15 18:55:51 +05:30
lib riscv: skip software algning code for HAVE_EFFICIENT_UNALIGNED_ACCESS 2026-09-02 11:47:08 -06:00
mm riscv: mm: make EXECMEM_KPROBES writable without CONFIG_STRICT_MODULE_RWX 2026-08-31 19:11:22 -06:00
net bpf, riscv: Make arena support depend on ZACAS 2026-09-06 16:23:12 +02:00
purgatory riscv/purgatory: add asm/purgatory.h 2026-06-06 20:17:52 -06:00
tools riscv: Stop considering R_RISCV_NONE as bad relocations 2025-07-16 08:13:55 -07:00
Kbuild riscv: migrate to the generic rule for built-in DTB 2025-03-18 13:30:13 +00:00
Kconfig riscv: bug: Make RV32 use GENERIC_BUG_RELATIVE_POINTERS 2026-08-31 19:11:23 -06:00
Kconfig.debug riscv: Add tests for riscv module loading 2023-11-07 14:59:32 -08:00
Kconfig.errata riscv: ERRATA_STARFIVE_JH7100: Fix missing dependency on new CONFIG_CACHEMAINT_FOR_DMA 2026-01-15 18:13:04 -07:00
Kconfig.socs riscv: add UltraRISC SoC family Kconfig support 2026-07-08 10:39:49 -06:00
Kconfig.vendor riscv: Add xmipsexectl as a vendor extension 2025-09-18 20:36:00 -06:00
Makefile riscv: cmpxchg: Use .option arch for Zacas and Zabha 2026-08-07 19:24:32 -06:00
Makefile.postlink kbuild: Create intermediate vmlinux build with relocations preserved 2025-03-17 00:29:50 +09:00