Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

mm: remove remaining uses of PFN_DEV

PFN_DEV was used by callers of dax_direct_access() to figure out if the
returned PFN is associated with a page using pfn_t_has_page() or not.
However all DAX PFNs now require an assoicated ZONE_DEVICE page so can
assume a page exists.

Other users of PFN_DEV were setting it before calling vmf_insert_mixed().
This is unnecessary as it is no longer checked, instead relying on
pfn_valid() to determine if there is an associated page or not.

Link: https://lkml.kernel.org/r/74b293aebc21b941090bc3e7aeafa91b57c821a5.1750323463.git-series.apopple@nvidia.com
Signed-off-by: Alistair Popple <apopple@nvidia.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Reviewed-by: Dan Williams <dan.j.williams@intel.com>
Cc: Balbir Singh <balbirs@nvidia.com>
Cc: Björn Töpel <bjorn@kernel.org>
Cc: Björn Töpel <bjorn@rivosinc.com>
Cc: Chunyan Zhang <zhang.lyra@gmail.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: Deepak Gupta <debug@rivosinc.com>
Cc: Gerald Schaefer <gerald.schaefer@linux.ibm.com>
Cc: Inki Dae <m.szyprowski@samsung.com>
Cc: John Groves <john@groves.net>
Cc: John Hubbard <jhubbard@nvidia.com>
Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Will Deacon <will@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Alistair Popple and committed by
Andrew Morton
79065255 6b4a80e4

+8 -12
+1 -1
drivers/gpu/drm/gma500/fbdev.c
··· 33 33 vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); 34 34 35 35 for (i = 0; i < page_num; ++i) { 36 - err = vmf_insert_mixed(vma, address, __pfn_to_pfn_t(pfn, PFN_DEV)); 36 + err = vmf_insert_mixed(vma, address, __pfn_to_pfn_t(pfn, 0)); 37 37 if (unlikely(err & VM_FAULT_ERROR)) 38 38 break; 39 39 address += PAGE_SIZE;
+2 -3
drivers/gpu/drm/omapdrm/omap_gem.c
··· 371 371 VERB("Inserting %p pfn %lx, pa %lx", (void *)vmf->address, 372 372 pfn, pfn << PAGE_SHIFT); 373 373 374 - return vmf_insert_mixed(vma, vmf->address, 375 - __pfn_to_pfn_t(pfn, PFN_DEV)); 374 + return vmf_insert_mixed(vma, vmf->address, __pfn_to_pfn_t(pfn, 0)); 376 375 } 377 376 378 377 /* Special handling for the case of faulting in 2d tiled buffers */ ··· 467 468 468 469 for (i = n; i > 0; i--) { 469 470 ret = vmf_insert_mixed(vma, 470 - vaddr, __pfn_to_pfn_t(pfn, PFN_DEV)); 471 + vaddr, __pfn_to_pfn_t(pfn, 0)); 471 472 if (ret & VM_FAULT_ERROR) 472 473 break; 473 474 pfn += priv->usergart[fmt].stride_pfn;
+1 -2
drivers/s390/block/dcssblk.c
··· 923 923 if (kaddr) 924 924 *kaddr = __va(dev_info->start + offset); 925 925 if (pfn) 926 - *pfn = __pfn_to_pfn_t(PFN_DOWN(dev_info->start + offset), 927 - PFN_DEV); 926 + *pfn = __pfn_to_pfn_t(PFN_DOWN(dev_info->start + offset), 0); 928 927 929 928 return (dev_sz - offset) / PAGE_SIZE; 930 929 }
+2 -4
drivers/vfio/pci/vfio_pci_core.c
··· 1669 1669 break; 1670 1670 #ifdef CONFIG_ARCH_SUPPORTS_PMD_PFNMAP 1671 1671 case PMD_ORDER: 1672 - ret = vmf_insert_pfn_pmd(vmf, 1673 - __pfn_to_pfn_t(pfn, PFN_DEV), false); 1672 + ret = vmf_insert_pfn_pmd(vmf, __pfn_to_pfn_t(pfn, 0), false); 1674 1673 break; 1675 1674 #endif 1676 1675 #ifdef CONFIG_ARCH_SUPPORTS_PUD_PFNMAP 1677 1676 case PUD_ORDER: 1678 - ret = vmf_insert_pfn_pud(vmf, 1679 - __pfn_to_pfn_t(pfn, PFN_DEV), false); 1677 + ret = vmf_insert_pfn_pud(vmf, __pfn_to_pfn_t(pfn, 0), false); 1680 1678 break; 1681 1679 #endif 1682 1680 default:
+1 -1
fs/cramfs/inode.c
··· 412 412 for (i = 0; i < pages && !ret; i++) { 413 413 vm_fault_t vmf; 414 414 unsigned long off = i * PAGE_SIZE; 415 - pfn_t pfn = phys_to_pfn_t(address + off, PFN_DEV); 415 + pfn_t pfn = phys_to_pfn_t(address + off, 0); 416 416 vmf = vmf_insert_mixed(vma, vma->vm_start + off, pfn); 417 417 if (vmf & VM_FAULT_ERROR) 418 418 ret = vm_fault_to_errno(vmf, 0);
+1 -1
mm/memory.c
··· 2557 2557 2558 2558 pfnmap_setup_cachemode_pfn(pfn, &pgprot); 2559 2559 2560 - return insert_pfn(vma, addr, __pfn_to_pfn_t(pfn, PFN_DEV), pgprot, 2560 + return insert_pfn(vma, addr, __pfn_to_pfn_t(pfn, 0), pgprot, 2561 2561 false); 2562 2562 } 2563 2563 EXPORT_SYMBOL(vmf_insert_pfn_prot);