summaryrefslogtreecommitdiff
path: root/scripts/Makefile.thinlto
diff options
context:
space:
mode:
authorBreno Leitao <leitao@debian.org>2026-08-12 04:31:52 -0700
committerMike Rapoport (Microsoft) <rppt@kernel.org>2026-08-31 14:17:41 +0300
commitc5c9a4e14bfa7163ef77c95272c7949ae1501134 (patch)
tree8d2359abbc6c329964dca23ad94eb62dac823d26 /scripts/Makefile.thinlto
parentc711461303af9f796b293b5ac06f49a885e46e71 (diff)
downloadlinux-next-c5c9a4e14bfa7163ef77c95272c7949ae1501134.tar.gz
linux-next-c5c9a4e14bfa7163ef77c95272c7949ae1501134.zip
kexec: keep the next kernel off hardware-poisoned pages
Memory failures (such as unrecoverable ECCs errors) are getting more and more common. The kernel knows how to handle it while running, marking it as poisoned (and SIGBUS user tasks). Poisoned memory is removed from the buddy allocator, but, not from other places. A current problem is that kexec will load new kernel on top of a bad/poisoned memory, which is undesirable. If the next kernel's image, initrd or purgatory lands on a poisoned frame, the relocation copy puts it on memory that is known bad. The error happens on the first read from a bad page, and that is what we want to avoid. Skip hardware-poisoned frames that were detected by the memory failure subsystem earlier when placing kexec segments. To do so, add a helper that reports the first or the last poisoned page in a range: memory is walked top-down by locate_mem_hole_top_down() and bottom-up by locate_mem_hole_bottom_up(), so each direction needs a different answer to stay clear of the poison. kexec_load() gets its destinations from userspace and cannot move them, so there sanity_check_segment_list() just rejects a segment that happens to have a poisoned page. is_page_hwpoison() also covers hugetlb, so a poisoned hugetlb folio is skipped as a whole. Suggested-by: Kiryl Shutsemau <kas@kernel.org> Signed-off-by: Breno Leitao <leitao@debian.org> Reviewed-by: Kiryl Shutsemau (Meta) <kas@kernel.org> Reviewed-by: Pratyush Yadav <pratyush@kernel.org> Reviewed-by: Bradley Morgan <include@grrlz.net> Reviewed-by: Miaohe Lin <linmiaohe@huawei.com> Link: https://patch.msgid.link/20260812-kexec_posioned-v6-2-e477887086f0@debian.org Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions