From: Xiaochun Yu Commit b5060a4aa33d ("RISC-V: KVM: fix vcpu vector context handling for kernel-mode vector") made the KVM vCPU load and put paths call get_cpu_vector_context() and put_cpu_vector_context() unconditionally. It also added an unconditional call to __kvm_riscv_vector_restore() on the guest entry path. The no-op definitions of the first two helpers live in , but includes that header only when CONFIG_RISCV_ISA_V is enabled. The KVM header also does not provide a no-op __kvm_riscv_vector_restore() in its disabled branch. As a result, a KVM build without CONFIG_RISCV_ISA_V fails with missing helper declarations. Include unconditionally to reuse its existing no-op helpers, and provide the missing KVM restore stub when Vector support is disabled. This does not change the Vector-enabled path. Fixes: b5060a4aa33d ("RISC-V: KVM: fix vcpu vector context handling for kernel-mode vector") Cc: stable@vger.kernel.org Signed-off-by: Xiaochun Yu --- This single patch fixes a build regression when KVM is enabled without the RISC-V Vector extension. Tested on base a804c5742bff (Torvalds master): - CONFIG_RISCV_ISA_V=n, CONFIG_KVM=m: full Image modules build passed. - CONFIG_RISCV_ISA_V=y, CONFIG_KVM=m: vcpu.o and vcpu_vector.o rebuilt. --- arch/riscv/include/asm/kvm_vcpu_vector.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/arch/riscv/include/asm/kvm_vcpu_vector.h b/arch/riscv/include/asm/kvm_vcpu_vector.h index 6371d5ea5392..ebc619ed67dd 100644 --- a/arch/riscv/include/asm/kvm_vcpu_vector.h +++ b/arch/riscv/include/asm/kvm_vcpu_vector.h @@ -11,9 +11,9 @@ #define __KVM_VCPU_RISCV_VECTOR_H #include +#include #ifdef CONFIG_RISCV_ISA_V -#include #include static __always_inline void __kvm_riscv_vector_save(struct kvm_cpu_context *context) @@ -55,6 +55,10 @@ static inline void kvm_riscv_v_exit(void) struct kvm_cpu_context; +static inline void __kvm_riscv_vector_restore(struct kvm_cpu_context *context) +{ +} + static inline void kvm_riscv_vcpu_vector_reset(struct kvm_vcpu *vcpu) { } --- base-commit: a804c5742bff224d4cb4d25dd383554d598be32b change-id: 20261021-ospp-c1-b4-submit-e22dc09faf5a Best regards, -- slack up