Re: [PATCH v6 22/33] KVM: s390: Prepare KVM/s390 for a second KVM module

[email protected]
Newsgroups dev.linux.lists.kvmarm,org.kernel.vger.kvm,org.kernel.vger.linux-s390
Message-ID <[email protected]>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] The patch fails to provide all necessary stubs to make s390 KVM compile when merged with an arm64 KVM Kconfig, leading to undefined references to functions like `kvm_get_dirty_log` and `kvm_arch_allow_write_without_running_vcpu`.
--

--- Patch [22]: [PATCH v6 22/33] KVM: s390: Prepare KVM/s390 for a second KVM module ---
commit fb387e8f82c2198f5fffbab975b0cb04cd2ac49c
Author: Steffen Eiden <[email protected]>

KVM: s390: Prepare KVM/s390 for a second KVM module

The second KVM module will have a different Kconfig set. When both
modules are compiled the Kconfig sets get merged and the native s390 KVM
needs to implement functionality required by the respective config
options. Ensure that s390-KVM will still compile by implementing a stub
for kvm_arch_vcpu_run_pid_change if CONFIG_HAVE_KVM_VCPU_RUN_PID_CHANGE
is enabled and defining KVM_NO_MMIO to disable KVM_MMIO.

> diff --git a/arch/s390/kvm/s390/s390.c b/arch/s390/kvm/s390/s390.c
> index 1d0d94f000f72..d1e736e1f06f2 100644
> --- a/arch/s390/kvm/s390/s390.c
> +++ b/arch/s390/kvm/s390/s390.c
> @@ -5868,6 +5868,14 @@ bool kvm_unmap_gfn_range(struct kvm *kvm, struct kvm_gfn_range *range)
>  	return gmap_unmap_gfn_range(kvm->arch.gmap, range->slot, range->start, range->end);
>  }
>  
> +#ifdef CONFIG_HAVE_KVM_VCPU_RUN_PID_CHANGE
> +/* Make s390 compile if arm64-on-s390 is selected */
> +int kvm_arch_vcpu_run_pid_change(struct kvm_vcpu *vcpu)
> +{
> +	return 0;
> +}
> +#endif /* CONFIG_HAVE_KVM_VCPU_RUN_PID_CHANGE */

[Severity: Low]
Are there other missing stubs required to make s390 KVM compile when merged
with the arm64 KVM Kconfig?

If CONFIG_KVM_GENERIC_DIRTYLOG_READ_PROTECT and
CONFIG_NEED_KVM_DIRTY_RING_WITH_BITMAP are enabled by the merged configs,
could there be undefined references to functions like kvm_get_dirty_log() and
kvm_arch_allow_write_without_running_vcpu()?

For instance, s390_kvm_mmu_get_dirty_log() in arch/s390/kvm/gmap/kvm_mmu.c
calls kvm_get_dirty_log(), which is omitted from virt/kvm/kvm_main.c when
CONFIG_KVM_GENERIC_DIRTYLOG_READ_PROTECT is selected.

Would adding stubs for these functions be needed to fully resolve the linker
errors this patch aims to fix?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=22
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.