Commit 21aa65bf authored by Alistair Popple's avatar Alistair Popple Committed by Andrew Morton
Browse files

mm: remove callers of pfn_t functionality

All PFN_* pfn_t flags have been removed.  Therefore there is no longer a
need for the pfn_t type and all uses can be replaced with normal pfns.

Link: https://lkml.kernel.org/r/bbedfa576c9822f8032494efbe43544628698b1f.1750323463.git-series.apopple@nvidia.com


Signed-off-by: default avatarAlistair Popple <apopple@nvidia.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarJason Gunthorpe <jgg@nvidia.com>
Acked-by: default avatarDavid Hildenbrand <david@redhat.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: Dan Williams <dan.j.williams@intel.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: default avatarAndrew Morton <akpm@linux-foundation.org>
parent 984921ed
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -36,7 +36,6 @@
#include <linux/debugfs.h>
#include <linux/ioport.h>
#include <linux/kernel.h>
#include <linux/pfn_t.h>
#include <linux/slab.h>
#include <linux/io.h>
#include <linux/mm.h>
+11 −12
Original line number Diff line number Diff line
@@ -4,7 +4,6 @@
#include <linux/pagemap.h>
#include <linux/module.h>
#include <linux/device.h>
#include <linux/pfn_t.h>
#include <linux/cdev.h>
#include <linux/slab.h>
#include <linux/dax.h>
@@ -73,7 +72,7 @@ __weak phys_addr_t dax_pgoff_to_phys(struct dev_dax *dev_dax, pgoff_t pgoff,
	return -1;
}

static void dax_set_mapping(struct vm_fault *vmf, pfn_t pfn,
static void dax_set_mapping(struct vm_fault *vmf, unsigned long pfn,
			      unsigned long fault_size)
{
	unsigned long i, nr_pages = fault_size / PAGE_SIZE;
@@ -89,7 +88,7 @@ static void dax_set_mapping(struct vm_fault *vmf, pfn_t pfn,
			ALIGN_DOWN(vmf->address, fault_size));

	for (i = 0; i < nr_pages; i++) {
		struct folio *folio = pfn_folio(pfn_t_to_pfn(pfn) + i);
		struct folio *folio = pfn_folio(pfn + i);

		if (folio->mapping)
			continue;
@@ -104,7 +103,7 @@ static vm_fault_t __dev_dax_pte_fault(struct dev_dax *dev_dax,
{
	struct device *dev = &dev_dax->dev;
	phys_addr_t phys;
	pfn_t pfn;
	unsigned long pfn;
	unsigned int fault_size = PAGE_SIZE;

	if (check_vma(dev_dax, vmf->vma, __func__))
@@ -125,11 +124,11 @@ static vm_fault_t __dev_dax_pte_fault(struct dev_dax *dev_dax,
		return VM_FAULT_SIGBUS;
	}

	pfn = phys_to_pfn_t(phys, 0);
	pfn = PHYS_PFN(phys);

	dax_set_mapping(vmf, pfn, fault_size);

	return vmf_insert_page_mkwrite(vmf, pfn_t_to_page(pfn),
	return vmf_insert_page_mkwrite(vmf, pfn_to_page(pfn),
					vmf->flags & FAULT_FLAG_WRITE);
}

@@ -140,7 +139,7 @@ static vm_fault_t __dev_dax_pmd_fault(struct dev_dax *dev_dax,
	struct device *dev = &dev_dax->dev;
	phys_addr_t phys;
	pgoff_t pgoff;
	pfn_t pfn;
	unsigned long pfn;
	unsigned int fault_size = PMD_SIZE;

	if (check_vma(dev_dax, vmf->vma, __func__))
@@ -169,11 +168,11 @@ static vm_fault_t __dev_dax_pmd_fault(struct dev_dax *dev_dax,
		return VM_FAULT_SIGBUS;
	}

	pfn = phys_to_pfn_t(phys, 0);
	pfn = PHYS_PFN(phys);

	dax_set_mapping(vmf, pfn, fault_size);

	return vmf_insert_folio_pmd(vmf, page_folio(pfn_t_to_page(pfn)),
	return vmf_insert_folio_pmd(vmf, page_folio(pfn_to_page(pfn)),
				vmf->flags & FAULT_FLAG_WRITE);
}

@@ -185,7 +184,7 @@ static vm_fault_t __dev_dax_pud_fault(struct dev_dax *dev_dax,
	struct device *dev = &dev_dax->dev;
	phys_addr_t phys;
	pgoff_t pgoff;
	pfn_t pfn;
	unsigned long pfn;
	unsigned int fault_size = PUD_SIZE;


@@ -215,11 +214,11 @@ static vm_fault_t __dev_dax_pud_fault(struct dev_dax *dev_dax,
		return VM_FAULT_SIGBUS;
	}

	pfn = phys_to_pfn_t(phys, 0);
	pfn = PHYS_PFN(phys);

	dax_set_mapping(vmf, pfn, fault_size);

	return vmf_insert_folio_pud(vmf, page_folio(pfn_t_to_page(pfn)),
	return vmf_insert_folio_pud(vmf, page_folio(pfn_to_page(pfn)),
				vmf->flags & FAULT_FLAG_WRITE);
}
#else
+0 −1
Original line number Diff line number Diff line
@@ -2,7 +2,6 @@
#include <linux/platform_device.h>
#include <linux/memregion.h>
#include <linux/module.h>
#include <linux/pfn_t.h>
#include <linux/dax.h>
#include "../bus.h"

+0 −1
Original line number Diff line number Diff line
@@ -5,7 +5,6 @@
#include <linux/memory.h>
#include <linux/module.h>
#include <linux/device.h>
#include <linux/pfn_t.h>
#include <linux/slab.h>
#include <linux/dax.h>
#include <linux/fs.h>
+0 −1
Original line number Diff line number Diff line
@@ -2,7 +2,6 @@
/* Copyright(c) 2016 - 2018 Intel Corporation. All rights reserved. */
#include <linux/memremap.h>
#include <linux/module.h>
#include <linux/pfn_t.h>
#include "../nvdimm/pfn.h"
#include "../nvdimm/nd.h"
#include "bus.h"
Loading