diff options
| author | Robin Murphy <robin.murphy@arm.com> | 2019-07-16 15:30:47 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-07-16 18:23:25 -0800 |
| commit | 175967318c3018d01931ac950c82adab5deb47ca (patch) | |
| tree | 50f6ae5525c0bfe5a01e5480ee32a85911426e42 /mm | |
| parent | 7588adf8dff12c4b358557a13796a25fef796548 (diff) | |
| download | linux-stable-175967318c3018d01931ac950c82adab5deb47ca.tar.gz linux-stable-175967318c3018d01931ac950c82adab5deb47ca.tar.bz2 linux-stable-175967318c3018d01931ac950c82adab5deb47ca.tar.xz linux-stable-175967318c3018d01931ac950c82adab5deb47ca.zip | |
mm: introduce ARCH_HAS_PTE_DEVMAP
ARCH_HAS_ZONE_DEVICE is somewhat meaningless in itself, and combined
with the long-out-of-date comment can lead to the impression than an
architecture may just enable it (since __add_pages() now "comprehends
device memory" for itself) and expect things to work.
In practice, however, ZONE_DEVICE users have little chance of
functioning correctly without __HAVE_ARCH_PTE_DEVMAP, so let's clean
that up the same way as ARCH_HAS_PTE_SPECIAL and make it the proper
dependency so the real situation is clearer.
Link: http://lkml.kernel.org/r/87554aa78478a02a63f2c4cf60a847279ae3eb3b.1558547956.git.robin.murphy@arm.com
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Acked-by: Dan Williams <dan.j.williams@intel.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Acked-by: Oliver O'Halloran <oohall@gmail.com>
Reviewed-by: Anshuman Khandual <anshuman.khandual@arm.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: Jerome Glisse <jglisse@redhat.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Will Deacon <will.deacon@arm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
| -rw-r--r-- | mm/Kconfig | 5 | ||||
| -rw-r--r-- | mm/gup.c | 2 |
2 files changed, 3 insertions, 4 deletions
diff --git a/mm/Kconfig b/mm/Kconfig index 495d7368ced8..56cec636a1fc 100644 --- a/mm/Kconfig +++ b/mm/Kconfig | |||
| @@ -649,8 +649,7 @@ config IDLE_PAGE_TRACKING | |||
| 649 | See Documentation/admin-guide/mm/idle_page_tracking.rst for | 649 | See Documentation/admin-guide/mm/idle_page_tracking.rst for |
| 650 | more details. | 650 | more details. |
| 651 | 651 | ||
| 652 | # arch_add_memory() comprehends device memory | 652 | config ARCH_HAS_PTE_DEVMAP |
| 653 | config ARCH_HAS_ZONE_DEVICE | ||
| 654 | bool | 653 | bool |
| 655 | 654 | ||
| 656 | config ZONE_DEVICE | 655 | config ZONE_DEVICE |
| @@ -658,7 +657,7 @@ config ZONE_DEVICE | |||
| 658 | depends on MEMORY_HOTPLUG | 657 | depends on MEMORY_HOTPLUG |
| 659 | depends on MEMORY_HOTREMOVE | 658 | depends on MEMORY_HOTREMOVE |
| 660 | depends on SPARSEMEM_VMEMMAP | 659 | depends on SPARSEMEM_VMEMMAP |
| 661 | depends on ARCH_HAS_ZONE_DEVICE | 660 | depends on ARCH_HAS_PTE_DEVMAP |
| 662 | select XARRAY_MULTI | 661 | select XARRAY_MULTI |
| 663 | 662 | ||
| 664 | help | 663 | help |
| @@ -1895,7 +1895,7 @@ static int gup_pte_range(pmd_t pmd, unsigned long addr, unsigned long end, | |||
| 1895 | } | 1895 | } |
| 1896 | #endif /* CONFIG_ARCH_HAS_PTE_SPECIAL */ | 1896 | #endif /* CONFIG_ARCH_HAS_PTE_SPECIAL */ |
| 1897 | 1897 | ||
| 1898 | #if defined(__HAVE_ARCH_PTE_DEVMAP) && defined(CONFIG_TRANSPARENT_HUGEPAGE) | 1898 | #if defined(CONFIG_ARCH_HAS_PTE_DEVMAP) && defined(CONFIG_TRANSPARENT_HUGEPAGE) |
| 1899 | static int __gup_device_huge(unsigned long pfn, unsigned long addr, | 1899 | static int __gup_device_huge(unsigned long pfn, unsigned long addr, |
| 1900 | unsigned long end, struct page **pages, int *nr) | 1900 | unsigned long end, struct page **pages, int *nr) |
| 1901 | { | 1901 | { |
