From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 87E273E3166 for ; Mon, 10 Aug 2026 14:01:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786370504; cv=none; b=cwzmuuR8gSzIIhYf968Dih6odnJ2UFjOlibFwz4+f/qnOYIJMk1dbkzfeASMmf5ePiMAeWT7gGsP8lWHgk/4QHh9lM+kP5CnQoD3GUsOEaxWPFfF0DywGU/BJp68iP6ACwP5w1iFV8NlOxQ2xUkiLeZw/G4lzIrdo0RF+UVsMAU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786370504; c=relaxed/simple; bh=oDNQlxyFCoSbhArM3gadilMVGOdX8Z0+ja+dJ5H+4IU=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=Xb0s1xto32Re9u2UPzyMabV0JrqEya8gN0dmDykUkwWxf7uvVxXTrt6FcMQLDvpbuO6ug03rRadXOdKUCmzXz+554SAXO5F21Tn7ONLFiVdNWpBFKP4ULDV0Y57k3r5a178T46Ng7RZHymqG9RArTOV6GRrQY+Y+tM9zehdJnuQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=fv8tCIz6; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="fv8tCIz6" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 359A41F000E9; Mon, 10 Aug 2026 14:01:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1786370503; bh=ShdhYTN7VXanrMxGBiRoKkMNiBC1EYaMKFKCBl48mZA=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=fv8tCIz6OJ4rivSB8rzYXOymT6D5z8HgevUrzUBgndP114hVoydAIJZ5RiEUQclC5 CY/cpoNqYkeImQhm9rV+YKck4OP4+bBqvvZslb666+gYFAKLV0avGdI07hXNFBjPpS T6rqzTqPQ2Xb2v5ojYrrVaEqr1ANgiKwfwZT2kxoUIrJuVsjxiVd5OF088IeYXsvR0 l63W9Jqfo6OTSyt6eeJ6E3iXbUZXChNoesClU/DlCqQnyRnnP62/QNpDgRARzk71VD An9kUiw3IwQE5U1JO3Y9+byaVDjG2kHCGF8p0bWVTQsh0oRT+n4abIBXx6SIAmZkb/ VDklH4q5w70Zw== From: Pratyush Yadav To: Breno Leitao Cc: Andrew Morton , David Hildenbrand , Lorenzo Stoakes , "Liam R. Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Baoquan He , Pasha Tatashin , Pratyush Yadav , Miaohe Lin , Naoya Horiguchi , linux-mm@kvack.org, linux-kernel@vger.kernel.org, kexec@lists.infradead.org, rmikey@meta.com, riel@surriel.com, kernel-team@meta.com, Kiryl Shutsemau Subject: Re: [PATCH v5] kexec: keep the next kernel off hardware-poisoned pages In-Reply-To: <20260810-kexec_posioned-v5-1-95e1b5e2e656@debian.org> (Breno Leitao's message of "Mon, 10 Aug 2026 06:32:04 -0700") References: <20260810-kexec_posioned-v5-1-95e1b5e2e656@debian.org> Date: Mon, 10 Aug 2026 16:01:38 +0200 Message-ID: <2vxz7bly6pml.fsf@kernel.org> User-Agent: Gnus/5.13 (Gnus v5.13) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain On Mon, Aug 10 2026, Breno Leitao wrote: > 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 poisoned frame, > the relocation copy writes to the bad memory and the machine checks > during the kexec. > > Skip hardware-poisoned frames when placing segments: check them in the > kexec_file hole finder so it lays the next kernel down on good memory, > and reject a poisoned destination in sanity_check_segment_list() for > the kexec_load path, which cannot relocate. > > The two hole finders walk in opposite directions, so each asks for the > end of the poison it has to clear: the top-down walk for the first > poisoned page in the window, the bottom-up walk for the last. A poisoned > hugetlb folio counts in full, as hugetlb keeps the flag on the folio and > the poisoned subpages on its raw hwpoison list. > > Suggested-by: Kiryl Shutsemau > Signed-off-by: Breno Leitao Reviewed-by: Pratyush Yadav [...] -- Regards, Pratyush Yadav