From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from stravinsky.debian.org (stravinsky.debian.org [82.195.75.108]) (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 91E28399003 for ; Thu, 30 Jul 2026 16:18:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=82.195.75.108 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785428304; cv=none; b=miio0Z1+55UZw9eVedS8vIgD7LcXNde2BPNzP68BX1cCaOQAV5o2UYOEjlTEFpvJ9mW+NZ/9AY7mO6JGmT2qlOFHDNxXDwyQEQYH7mRf+tBr2IIsgIuuvmv5UZw1e+BPAAbIvpYkQixtSX24C2c4jZqKBo4SYiWsUuW3C1yc+GU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785428304; c=relaxed/simple; bh=Rfdd7DogkYksZCadD6IVmQ2PYCDXdJ8Qqjq4JNtfvz4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=DOvU8yd0RhgEuXuZyQk0wFdWjKUTtoNvRRQ0ggeyfW5rqUU7S1uocO9iNLwEt2dsYpRZKbT6jLmahyQzcaeuXjp5khFE02iBLn+4mI/D8AklfjSjNTBi1wLJT8aiZu8uop22oSVmKUZaIQjQ4gNmPHM6UPZb7uQAhzSOnl9XaGs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=debian.org; spf=pass smtp.mailfrom=debian.org; dkim=pass (2048-bit key) header.d=debian.org header.i=@debian.org header.b=H30XaJZQ; arc=none smtp.client-ip=82.195.75.108 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=debian.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=debian.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=debian.org header.i=@debian.org header.b="H30XaJZQ" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debian.org; s=smtpauto.stravinsky; h=X-Debian-User:In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=w1Mc/92E8p+lO32h+qT72OZ7HfiwW0g4cTUB3qX11Fo=; b=H30XaJZQ7r7auy62y8eZtVmoVV G3l/41e0XdTegoohny+WA7lpvZpnLqqWgSSfj3UghOP2rLGuXgaSg+ZyfpuIRwgiktDQpjd+3saSp jp3hBS/EkFWKZMM+b7EempEwkf9zqNMhTW4hQU+6Baa8bJgwYrDLEZYX4gJCRbZ8GpS1dA7/dnuMx Epr/T7iZlu2URIwpixBO6Gm6IAjbRZdoId/JN8sOFhwmPGkpnOgq6kXOSH9kwwZQSxDLFvpg2Py6D ZnGtkfqjo7577UuywvqOr+ppHiYlH6oYRoll8Y8i3Df7bPv6jUn+fzRsJi+adm3g+jQ9bIMfh4mQv 7+DCfA/Q==; Received: from authenticated-user by stravinsky.debian.org with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.96) (envelope-from ) id 1wpTSQ-009MZJ-24; Thu, 30 Jul 2026 16:18:06 +0000 Date: Thu, 30 Jul 2026 09:18:00 -0700 From: Breno Leitao To: 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 Cc: 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 v2] kexec: keep the next kernel off hardware-poisoned pages Message-ID: References: <20260730-kexec_posioned-v2-1-f92d18551f64@debian.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260730-kexec_posioned-v2-1-f92d18551f64@debian.org> X-Debian-User: leitao On Thu, Jul 30, 2026 at 08:55:50AM -0700, 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. > > Suggested-by: Kiryl Shutsemau > Signed-off-by: Breno Leitao > --- > Changes in v2: - change from pfn_to_page() to pfn_to_online_page() (Miaohe Lin) - Return the poisioned address once we find a hit, to avoid O(n^2) chcek. (Sashiko)