Re: [PATCH v4 1/5] RISC-V: KVM: Add the split page cache for ioctl context

From: wang.yechao255

Date: Fri Jul 31 2026 - 02:11:51 EST


> > @@ -54,6 +54,12 @@ void kvm_arch_destroy_vm(struct kvm *kvm)
> > kvm_destroy_vcpus(kvm);
> >
> > kvm_riscv_aia_destroy_vm(kvm);
> > +
> > + /*
> > + * Free the split page cache after all vCPUs and devices are destroyed.
> > + * At this point, there are no concurrent accesses to the cache.
> > + */
> > + kvm_mmu_free_memory_cache(&kvm->arch.pgd_split_page_cache);
>
> Better to do this in kvm_riscv_mmu_free_pgd()
>
> Regards,
> Anup

Thanks for the review. I'll move it back to kvm_riscv_mmu_free_pgd() in v5 version.

Regards,
Yechao