[PATCH] KVM: riscv: Implement kvm_arch_pre_fault_allowed()
Paolo Bonzini
pbonzini at redhat.com
Thu Oct 22 07:51:55 PDT 2026
On Thu, Oct 22, 2026 at 4:42 PM Sasha Levin <sashal at kernel.org> wrote:
>
> Commit caa63620f9e3 ("KVM: Allow architectures to disallow pre-fault")
> requires every architecture that selects KVM_GENERIC_PRE_FAULT_MEMORY to
> implement kvm_arch_pre_fault_allowed(), and there is no generic default.
>
> Commit e8b32e377951 ("KVM: riscv: Implement KVM_PRE_FAULT_MEMORY") was
> written before that hook existed, so it selects the option without
> implementing the hook. With both commits in the same tree, riscv builds
> with KVM enabled fail to link:
>
> ld.lld: error: undefined symbol: kvm_arch_pre_fault_allowed
> >>> referenced by kvm_main.c
> >>> virt/kvm/kvm_main.o:(kvm_vcpu_pre_fault_memory) in archive vmlinux.a
>
> The riscv implementation does not refuse pre-faulting in any state, so
> return 0 to keep its current behaviour.
>
> Fixes: e8b32e377951 ("KVM: riscv: Implement KVM_PRE_FAULT_MEMORY")
> Signed-off-by: Sasha Levin <sashal at kernel.org>
> ---
> Paolo, this is needed when kvm-riscv-7.4-1 is merged into kvm/next.
> Feel free to squash it into the merge instead.
Yup, done. It will be in tomorrow's linux-next via kvm/next.
I'll send the RISC-V PR to Linus next week, so if he complains it will
be there in kvm/next ready for 7.5. :)
Paolo
More information about the linux-riscv
mailing list