From: Greg Kroah-Hartman Date: Mon, 20 Sep 2021 12:59:51 +0000 (+0200) Subject: 5.10-stable patches X-Git-Tag: v4.4.284~27 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fa2e6b89e4f7db8a4173cfae1f266c49a2485cc5;p=thirdparty%2Fkernel%2Fstable-queue.git 5.10-stable patches added patches: mm-memory_hotplug-use-unsigned-long-for-pfn-in-zone_for_pfn_range.patch --- diff --git a/queue-5.10/mm-memory_hotplug-use-unsigned-long-for-pfn-in-zone_for_pfn_range.patch b/queue-5.10/mm-memory_hotplug-use-unsigned-long-for-pfn-in-zone_for_pfn_range.patch new file mode 100644 index 00000000000..85e1152656c --- /dev/null +++ b/queue-5.10/mm-memory_hotplug-use-unsigned-long-for-pfn-in-zone_for_pfn_range.patch @@ -0,0 +1,127 @@ +From 7cf209ba8a86410939a24cb1aeb279479a7e0ca6 Mon Sep 17 00:00:00 2001 +From: David Hildenbrand +Date: Tue, 7 Sep 2021 19:54:59 -0700 +Subject: mm/memory_hotplug: use "unsigned long" for PFN in zone_for_pfn_range() + +From: David Hildenbrand + +commit 7cf209ba8a86410939a24cb1aeb279479a7e0ca6 upstream. + +Patch series "mm/memory_hotplug: preparatory patches for new online policy and memory" + +These are all cleanups and one fix previously sent as part of [1]: +[PATCH v1 00/12] mm/memory_hotplug: "auto-movable" online policy and memory +groups. + +These patches make sense even without the other series, therefore I pulled +them out to make the other series easier to digest. + +[1] https://lkml.kernel.org/r/20210607195430.48228-1-david@redhat.com + +This patch (of 4): + +Checkpatch complained on a follow-up patch that we are using "unsigned" +here, which defaults to "unsigned int" and checkpatch is correct. + +As we will search for a fitting zone using the wrong pfn, we might end +up onlining memory to one of the special kernel zones, such as ZONE_DMA, +which can end badly as the onlined memory does not satisfy properties of +these zones. + +Use "unsigned long" instead, just as we do in other places when handling +PFNs. This can bite us once we have physical addresses in the range of +multiple TB. + +Link: https://lkml.kernel.org/r/20210712124052.26491-2-david@redhat.com +Fixes: e5e689302633 ("mm, memory_hotplug: display allowed zones in the preferred ordering") +Signed-off-by: David Hildenbrand +Reviewed-by: Pankaj Gupta +Reviewed-by: Muchun Song +Reviewed-by: Oscar Salvador +Cc: David Hildenbrand +Cc: Vitaly Kuznetsov +Cc: "Michael S. Tsirkin" +Cc: Jason Wang +Cc: Pankaj Gupta +Cc: Wei Yang +Cc: Michal Hocko +Cc: Dan Williams +Cc: Anshuman Khandual +Cc: Dave Hansen +Cc: Vlastimil Babka +Cc: Mike Rapoport +Cc: "Rafael J. Wysocki" +Cc: Len Brown +Cc: Pavel Tatashin +Cc: Heiko Carstens +Cc: Michael Ellerman +Cc: Catalin Marinas +Cc: virtualization@lists.linux-foundation.org +Cc: Andy Lutomirski +Cc: "Aneesh Kumar K.V" +Cc: Anton Blanchard +Cc: Ard Biesheuvel +Cc: Baoquan He +Cc: Benjamin Herrenschmidt +Cc: Borislav Petkov +Cc: Christian Borntraeger +Cc: Christophe Leroy +Cc: Dave Jiang +Cc: "H. Peter Anvin" +Cc: Ingo Molnar +Cc: Jia He +Cc: Joe Perches +Cc: Kefeng Wang +Cc: Laurent Dufour +Cc: Michel Lespinasse +Cc: Nathan Lynch +Cc: Nicholas Piggin +Cc: Paul Mackerras +Cc: Peter Zijlstra +Cc: Pierre Morel +Cc: "Rafael J. Wysocki" +Cc: Rich Felker +Cc: Scott Cheloha +Cc: Sergei Trofimovich +Cc: Thiago Jung Bauermann +Cc: Thomas Gleixner +Cc: Vasily Gorbik +Cc: Vishal Verma +Cc: Will Deacon +Cc: Yoshinori Sato +Cc: +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: David Hildenbrand +Signed-off-by: Greg Kroah-Hartman +--- + include/linux/memory_hotplug.h | 4 ++-- + mm/memory_hotplug.c | 4 ++-- + 2 files changed, 4 insertions(+), 4 deletions(-) + +--- a/include/linux/memory_hotplug.h ++++ b/include/linux/memory_hotplug.h +@@ -359,8 +359,8 @@ extern void sparse_remove_section(struct + unsigned long map_offset, struct vmem_altmap *altmap); + extern struct page *sparse_decode_mem_map(unsigned long coded_mem_map, + unsigned long pnum); +-extern struct zone *zone_for_pfn_range(int online_type, int nid, unsigned start_pfn, +- unsigned long nr_pages); ++extern struct zone *zone_for_pfn_range(int online_type, int nid, ++ unsigned long start_pfn, unsigned long nr_pages); + #endif /* CONFIG_MEMORY_HOTPLUG */ + + #endif /* __LINUX_MEMORY_HOTPLUG_H */ +--- a/mm/memory_hotplug.c ++++ b/mm/memory_hotplug.c +@@ -765,8 +765,8 @@ static inline struct zone *default_zone_ + return movable_node_enabled ? movable_zone : kernel_zone; + } + +-struct zone * zone_for_pfn_range(int online_type, int nid, unsigned start_pfn, +- unsigned long nr_pages) ++struct zone *zone_for_pfn_range(int online_type, int nid, ++ unsigned long start_pfn, unsigned long nr_pages) + { + if (online_type == MMOP_ONLINE_KERNEL) + return default_kernel_zone_for_pfn(nid, start_pfn, nr_pages); diff --git a/queue-5.10/series b/queue-5.10/series index 32da2cedcb6..f29404c3240 100644 --- a/queue-5.10/series +++ b/queue-5.10/series @@ -51,3 +51,4 @@ net-hns3-pad-the-short-tunnel-frame-before-sending-to-hardware.patch net-hns3-change-affinity_mask-to-numa-node-range.patch net-hns3-disable-mac-in-flr-process.patch net-hns3-fix-the-timing-issue-of-vf-clearing-interrupt-sources.patch +mm-memory_hotplug-use-unsigned-long-for-pfn-in-zone_for_pfn_range.patch