]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.15-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 21 Apr 2022 08:27:13 +0000 (10:27 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 21 Apr 2022 08:27:13 +0000 (10:27 +0200)
added patches:
arm64-mm-drop-have_arch_pfn_valid.patch

queue-5.15/arm64-mm-drop-have_arch_pfn_valid.patch [new file with mode: 0644]
queue-5.15/series
queue-5.15/xfs-return-errors-in-xfs_fs_sync_fs.patch

diff --git a/queue-5.15/arm64-mm-drop-have_arch_pfn_valid.patch b/queue-5.15/arm64-mm-drop-have_arch_pfn_valid.patch
new file mode 100644 (file)
index 0000000..4a8e5e7
--- /dev/null
@@ -0,0 +1,106 @@
+From 3de360c3fdb34fbdbaf6da3af94367d3fded95d3 Mon Sep 17 00:00:00 2001
+From: Anshuman Khandual <anshuman.khandual@arm.com>
+Date: Thu, 30 Sep 2021 04:30:39 +0300
+Subject: arm64/mm: drop HAVE_ARCH_PFN_VALID
+
+From: Anshuman Khandual <anshuman.khandual@arm.com>
+
+commit 3de360c3fdb34fbdbaf6da3af94367d3fded95d3 upstream.
+
+CONFIG_SPARSEMEM_VMEMMAP is now the only available memory model on arm64
+platforms and free_unused_memmap() would just return without creating any
+holes in the memmap mapping.  There is no need for any special handling in
+pfn_valid() and HAVE_ARCH_PFN_VALID can just be dropped.  This also moves
+the pfn upper bits sanity check into generic pfn_valid().
+
+[rppt: rebased on v5.15-rc3]
+
+Link: https://lkml.kernel.org/r/1621947349-25421-1-git-send-email-anshuman.khandual@arm.com
+Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
+Acked-by: David Hildenbrand <david@redhat.com>
+Acked-by: Mike Rapoport <rppt@linux.ibm.com>
+Cc: Catalin Marinas <catalin.marinas@arm.com>
+Cc: Will Deacon <will@kernel.org>
+Cc: David Hildenbrand <david@redhat.com>
+Cc: Mike Rapoport <rppt@kernel.org>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
+Link: https://lore.kernel.org/r/20210930013039.11260-3-rppt@kernel.org
+Signed-off-by: Will Deacon <will@kernel.org>
+Fixes: 859a85ddf90e ("mm: remove pfn_valid_within() and CONFIG_HOLES_IN_ZONE")
+Link: https://lore.kernel.org/r/Yl0IZWT2nsiYtqBT@linux.ibm.com
+Signed-off-by: Georgi Djakov <quic_c_gdjako@quicinc.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ arch/arm64/Kconfig            |    1 -
+ arch/arm64/include/asm/page.h |    1 -
+ arch/arm64/mm/init.c          |   37 -------------------------------------
+ 3 files changed, 39 deletions(-)
+
+--- a/arch/arm64/Kconfig
++++ b/arch/arm64/Kconfig
+@@ -154,7 +154,6 @@ config ARM64
+       select HAVE_ARCH_KGDB
+       select HAVE_ARCH_MMAP_RND_BITS
+       select HAVE_ARCH_MMAP_RND_COMPAT_BITS if COMPAT
+-      select HAVE_ARCH_PFN_VALID
+       select HAVE_ARCH_PREL32_RELOCATIONS
+       select HAVE_ARCH_RANDOMIZE_KSTACK_OFFSET
+       select HAVE_ARCH_SECCOMP_FILTER
+--- a/arch/arm64/include/asm/page.h
++++ b/arch/arm64/include/asm/page.h
+@@ -41,7 +41,6 @@ void tag_clear_highpage(struct page *to)
+ typedef struct page *pgtable_t;
+-int pfn_valid(unsigned long pfn);
+ int pfn_is_map_memory(unsigned long pfn);
+ #include <asm/memory.h>
+--- a/arch/arm64/mm/init.c
++++ b/arch/arm64/mm/init.c
+@@ -184,43 +184,6 @@ static void __init zone_sizes_init(unsig
+       free_area_init(max_zone_pfns);
+ }
+-int pfn_valid(unsigned long pfn)
+-{
+-      phys_addr_t addr = PFN_PHYS(pfn);
+-      struct mem_section *ms;
+-
+-      /*
+-       * Ensure the upper PAGE_SHIFT bits are clear in the
+-       * pfn. Else it might lead to false positives when
+-       * some of the upper bits are set, but the lower bits
+-       * match a valid pfn.
+-       */
+-      if (PHYS_PFN(addr) != pfn)
+-              return 0;
+-
+-      if (pfn_to_section_nr(pfn) >= NR_MEM_SECTIONS)
+-              return 0;
+-
+-      ms = __pfn_to_section(pfn);
+-      if (!valid_section(ms))
+-              return 0;
+-
+-      /*
+-       * ZONE_DEVICE memory does not have the memblock entries.
+-       * memblock_is_map_memory() check for ZONE_DEVICE based
+-       * addresses will always fail. Even the normal hotplugged
+-       * memory will never have MEMBLOCK_NOMAP flag set in their
+-       * memblock entries. Skip memblock search for all non early
+-       * memory sections covering all of hotplug memory including
+-       * both normal and ZONE_DEVICE based.
+-       */
+-      if (!early_section(ms))
+-              return pfn_section_valid(ms, pfn);
+-
+-      return memblock_is_memory(addr);
+-}
+-EXPORT_SYMBOL(pfn_valid);
+-
+ int pfn_is_map_memory(unsigned long pfn)
+ {
+       phys_addr_t addr = PFN_PHYS(pfn);
index 56a0ba1564fd0db90db4ef0f90bccfae0f459331..3c3c9e01e70500dc42b0e92e9c37e7c523dcb5f3 100644 (file)
@@ -1,6 +1,7 @@
-dma-mapping-remove-bogus-test-for-pfn_valid-from-dma_map_resource.patch
 fs-remove-__sync_filesystem.patch
 block-remove-__sync_blockdev.patch
 block-simplify-the-block-device-syncing-code.patch
 vfs-make-sync_filesystem-return-errors-from-sync_fs.patch
 xfs-return-errors-in-xfs_fs_sync_fs.patch
+dma-mapping-remove-bogus-test-for-pfn_valid-from-dma_map_resource.patch
+arm64-mm-drop-have_arch_pfn_valid.patch
index 64eeffd47a229f7229e20a4fc25949876b661383..c43f0f78501863dd68b6be12242807d8588adbcc 100644 (file)
@@ -16,11 +16,9 @@ Reviewed-by: Christoph Hellwig <hch@lst.de>
 Acked-by: Christian Brauner <brauner@kernel.org>
 Signed-off-by: Sasha Levin <sashal@kernel.org>
 ---
- fs/xfs/xfs_super.c | 6 +++++-
+ fs/xfs/xfs_super.c |    6 +++++-
  1 file changed, 5 insertions(+), 1 deletion(-)
 
-diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c
-index c4e0cd1c1c8c..170fee98c45c 100644
 --- a/fs/xfs/xfs_super.c
 +++ b/fs/xfs/xfs_super.c
 @@ -729,6 +729,7 @@ xfs_fs_sync_fs(
@@ -43,6 +41,3 @@ index c4e0cd1c1c8c..170fee98c45c 100644
        if (laptop_mode) {
                /*
                 * The disk must be active because we're syncing.
--- 
-2.35.1
-