/* If the vma has a linear pfn mapping for the entire range, we get the prot from pte and reserve the entire vma range with single reserve_pfn_range call.  */
int track_pfn_vma_copy(struct vm_area_struct *vma)
/* If the vma has a linear pfn mapping for the entire range, we get the prot from pte and reserve the entire vma range with single reserve_pfn_range call.  */
int track_pfn_vma_copy(struct vm_area_struct *vma)
{
	resource_size_t paddr;
	unsigned long prot;
	unsigned long vma_size = vma->vm_end - vma->vm_start;
	pgprot_t pgprot;
	if (is_linear_pfn_mapping(vma)) {
		if (follow_phys(vma, vma->vm_start, 0, &prot, &paddr)) {
			WARN_ON_ONCE(1);
			return -EINVAL;
		}
		pgprot = __pgprot(prot);
		return reserve_pfn_range(paddr, vma_size, &pgprot, 1);
	}
	return 0;
}