Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

RISC-V: KVM: Fix error code returned for Ssaia ONE_REG

Return -ENOENT for Ssaia ONE_REG when Ssaia is not enabled
for a VCPU.

This will make Ssaia ONE_REG error codes consistent with
other ONE_REG interfaces of KVM RISC-V.

Fixes: 2a88f38cd58d ("RISC-V: KVM: return ENOENT in *_one_reg() when reg is unknown")
Signed-off-by: Anup Patel <anup.patel@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20260120080013.2153519-3-anup.patel@oss.qualcomm.com
Signed-off-by: Anup Patel <anup@brainfault.org>

authored by

Anup Patel and committed by
Anup Patel
24433b2b 45700a74

+4
+4
arch/riscv/kvm/aia.c
··· 185 185 struct kvm_vcpu_aia_csr *csr = &vcpu->arch.aia_context.guest_csr; 186 186 unsigned long regs_max = sizeof(struct kvm_riscv_aia_csr) / sizeof(unsigned long); 187 187 188 + if (!riscv_isa_extension_available(vcpu->arch.isa, SSAIA)) 189 + return -ENOENT; 188 190 if (reg_num >= regs_max) 189 191 return -ENOENT; 190 192 ··· 206 204 struct kvm_vcpu_aia_csr *csr = &vcpu->arch.aia_context.guest_csr; 207 205 unsigned long regs_max = sizeof(struct kvm_riscv_aia_csr) / sizeof(unsigned long); 208 206 207 + if (!riscv_isa_extension_available(vcpu->arch.isa, SSAIA)) 208 + return -ENOENT; 209 209 if (reg_num >= regs_max) 210 210 return -ENOENT; 211 211