Files
linux/mm
David Hildenbrand 56531761d4 kfence: drop nth_page() usage
We want to get rid of nth_page(), and kfence init code is the last user.

Unfortunately, we might actually walk a PFN range where the pages are not
contiguous, because we might be allocating an area from memblock that
could span memory sections in problematic kernel configs (SPARSEMEM
without SPARSEMEM_VMEMMAP).

We could check whether the page range is contiguous using
page_range_contiguous() and failing kfence init, or making kfence
incompatible these problemtic kernel configs.

Let's keep it simple and simply use pfn_to_page() by iterating PFNs.

Link: https://lkml.kernel.org/r/20250901150359.867252-36-david@redhat.com
Signed-off-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Marco Elver <elver@google.com>
Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: Alexander Potapenko <glider@google.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2025-09-21 14:22:09 -07:00
..
2025-09-21 14:22:09 -07:00
2025-06-05 22:02:25 -07:00
2024-11-03 01:28:06 -05:00
2025-09-13 16:55:20 -07:00
2025-08-02 12:06:09 -07:00
2025-09-21 14:21:59 -07:00
2025-09-21 14:22:00 -07:00
2025-09-13 16:54:50 -07:00
2025-09-13 16:54:58 -07:00
2025-09-13 16:55:07 -07:00
2025-08-02 12:06:09 -07:00
2025-09-13 16:54:46 -07:00
2024-07-10 12:14:54 -07:00
2025-09-13 16:55:08 -07:00
2025-09-13 16:55:08 -07:00
2025-09-13 16:55:07 -07:00
2025-09-13 16:55:02 -07:00
2025-09-13 16:55:02 -07:00
2025-09-13 16:55:20 -07:00
2025-09-13 16:55:07 -07:00
2025-09-21 14:21:59 -07:00