Re: [PATCH v2 18/24] KVM: arm64: Instantiate guest stage-2 page-tables at EL2

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



[...]

>  }
>  
>  void reclaim_guest_pages(struct kvm_shadow_vm *vm)
>  {
> -	unsigned long nr_pages;
> +	unsigned long nr_pages, pfn;
>  
>  	nr_pages = kvm_pgtable_stage2_pgd_size(vm->kvm.arch.vtcr) >> PAGE_SHIFT;
> -	WARN_ON(__pkvm_hyp_donate_host(hyp_virt_to_pfn(vm->pgt.pgd), nr_pages));
> +	pfn = hyp_virt_to_pfn(vm->pgt.pgd);
> +
> +	guest_lock_component(vm);
> +	kvm_pgtable_stage2_destroy(&vm->pgt);
> +	vm->kvm.arch.mmu.pgd_phys = 0ULL;
> +	guest_unlock_component(vm);
> +
> +	WARN_ON(__pkvm_hyp_donate_host(pfn, nr_pages));
>  }

The pfn introduction being removed in a subsequent patch, this is probably
unecessary noise.



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux