mirror of
https://github.com/torvalds/linux.git
synced 2026-09-24 06:24:02 +02:00
RISC-V: KVM: Add the split page cache for ioctl context
Add the split page cache for dirty logging enablement and the KVM_CLEAR_DIRTY_LOG ioctl. Signed-off-by: Wang Yechao <wang.yechao255@zte.com.cn> Reviewed-by: Anup Patel <anup@brainfault.org> Link: https://lore.kernel.org/r/20260731091215.1549430-2-wang.yechao255@zte.com.cn Signed-off-by: Anup Patel <anup@brainfault.org>
This commit is contained in:
parent
5044816169
commit
6c7f75ef09
|
|
@ -86,6 +86,7 @@ struct kvm_arch {
|
|||
pgd_t *pgd;
|
||||
phys_addr_t pgd_phys;
|
||||
unsigned long pgd_levels;
|
||||
struct kvm_mmu_memory_cache pgd_split_page_cache;
|
||||
|
||||
/* Guest Timer */
|
||||
struct kvm_guest_timer timer;
|
||||
|
|
|
|||
|
|
@ -677,6 +677,7 @@ int kvm_riscv_mmu_alloc_pgd(struct kvm *kvm)
|
|||
kvm->arch.pgd = page_to_virt(pgd_page);
|
||||
kvm->arch.pgd_phys = page_to_phys(pgd_page);
|
||||
kvm->arch.pgd_levels = kvm_riscv_gstage_max_pgd_levels;
|
||||
kvm->arch.pgd_split_page_cache.gfp_zero = __GFP_ZERO;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -704,6 +705,8 @@ void kvm_riscv_mmu_free_pgd(struct kvm *kvm)
|
|||
|
||||
if (pgd)
|
||||
free_pages((unsigned long)pgd, get_order(kvm_riscv_gstage_pgd_size));
|
||||
|
||||
kvm_mmu_free_memory_cache(&kvm->arch.pgd_split_page_cache);
|
||||
}
|
||||
|
||||
void kvm_riscv_mmu_update_hgatp(struct kvm_vcpu *vcpu)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user