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 0E2C238DC69 for ; Tue, 22 Sep 2026 12:51:20 +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=1790081482; cv=none; b=fJywKbkpEfuGghTFKpgFMjE5HySyIbkl3RngA+jXCNBxzr0jR3VofaDGdShN0CNPQ5WpTAxNR2kn65Hem9nwuHvx4AKb6tijUrHOywzYdbuGWOF7l5XqjoJDMil8A0TexdlY7Y3NFaC8FQIn9WObSqYi33OByYA4GID8eI0L0XU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790081482; c=relaxed/simple; bh=EuDFvoZYaAt+KyySYyhhT+xuusQE5J3tp3hQ2p0f3aE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=aNNCbaTqfiNODaWgB4LRGhgUOHdaoIT3MLF0ZGCZClgDAO+rBFWwLcxBWCPdIJOCAKOOYXDjButXJfCXJ3jtlgsLJhShGlZ2JsqF9p+NZqSKBh4ByUIOUpWPPqmcZ4/VB3901EhhQDoa/Y1TnPpVN8AQbavvJNf3n3OR3DkDpbk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=bJLV+Tbj; 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="bJLV+Tbj" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1B8251F000FF; Tue, 22 Sep 2026 12:51:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1790081480; bh=bjn6H9bAPusg9K8m56V4G1qk8427IsHI5UeWzmUJBww=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=bJLV+Tbj3RxhxJZcYtjDywlKvAzUbmxYg+jqYaDUsDf/BmM9L2J83+F4g/CDHfK+z 4WIX1BUszHwiL9aPFk/e5bST2MZSccSUn1M1f+t+UQRCEELfv/Dqz87xsM48Fhe4e4 VrMkKaznrdYugilrnbICgcq6cXdx12zLJbqO6UX4WDe2+3DFH3f2k2yNPF7+NYRYad TZApAWj99n+gpeYuTwRDrvxA0SMM1YEuvTEo8FIttiM1vP9mV5cKaGLDpxw/Gyo8zC hxVoxAVK5OgywEaj4uTtpN9HYuw2uvIvEduaeOF7jk6ZswhZSEPJ1EHxibM+k7KvL3 30/IBotrHghNw== Received: from phl-compute-05.internal (phl-compute-05.internal [10.202.2.45]) by mailfauth.ams.internal (Postfix) with ESMTP id 9D4B41980052; Tue, 22 Sep 2026 08:51:11 -0400 (EDT) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-05.internal (MEProxy); Tue, 22 Sep 2026 08:51:17 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTGJsDyAcE8QiCZz6dfbgOk9P/ImhfvjdTgEGi1dyPDTortTmKMOuYz4ch97JTuIJY fCTeb/jUDs7RR8+EO82LYzphUG3CyOtSymtz/L464Wc9DfgUawrMcTy2lA/clKyJoAksX0 ZH839lnzNd/xvI9x9FHSP0kzB6tqsirVPUdHuDCIJ/wWCTBeNdhCrHmzdo6sUbJdKR/2O/ sWo9+A4BnuafPVatN035tZ09J6Fj99W4S+sDDcIwrbw5dyhaeZ44nnTKKearwgnnRyhT8p 2DheY2M4Nvuau7iuiAq3/CO0Qk8O5FLAWWU3996mTM//yGu/EY0oyjBeIKfGh7ymLgF2dO XupXwF/czUZ2NpcRi/n/HbJd73UF6MopxxDLQXZZTZVEIq8jwxTtntgz1Fudldxc+duznM zyN0Jj4dGAXH3J5iS2JrkGwjaln77bkaPrm/ycPIVoKlFDoDCRdxpscdTHnPCICqfqS73s hy2SSZD3R9IdvfMM3cVc0eArLzOPt7zot16Rvzjau0S0mryVCZR9cKZJPrITNaxC2WJwRz fnTwgIn7q07MgFSsf9rXprcLoqngdr9uLOAXpUXXoVfYM4O+/VQT2vrRpXrrKl6q73ti/q doU1LkDyfW1eee9VOUfwBk/tMFKY1IzwPGNO8VK00HRjFLNHKhCBI+4vXJKw X-ME-Proxy: Feedback-ID: i10464835:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 22 Sep 2026 08:51:09 -0400 (EDT) Date: Tue, 22 Sep 2026 13:51:08 +0100 From: Kiryl Shutsemau To: "David Hildenbrand (Arm)" Cc: Breno Leitao , Ard Biesheuvel , Ilias Apalodimas , Miaohe Lin , Naoya Horiguchi , Andrew Morton , kexec@lists.infradead.org, Lorenzo Stoakes , "Liam R. Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Brendan Jackman , Johannes Weiner , Zi Yan , Oscar Salvador , Greg Kroah-Hartman , "Rafael J. Wysocki" , Danilo Krummrich , hannes@cmpxchg.or, shakeel.butt@linux.dev, linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, rmikey@meta.com, riel@surriel.com, harry@kernel.org, linux-cxl@vger.kernel.org, driver-core@lists.linux.dev, kernel-team@meta.com Subject: Re: [PATCH v5 7/9] drivers/base/memory: count inherited poisoned frames into the block Message-ID: References: <20260915-hwpoison-kho-v5-7-3bc7a57bd503@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: On Tue, Sep 22, 2026 at 01:33:51PM +0200, David Hildenbrand (Arm) wrote: > On 9/21/26 16:31, Breno Leitao wrote: > > On Fri, Sep 18, 2026 at 10:16:25PM +0200, David Hildenbrand (Arm) wrote: > >> On 9/18/26 17:22, Breno Leitao wrote: > >>> > >>> Right, we have two source for poisoned page information, today. > >>> > >>> 1) LINUX_EFI_POISONED_MEMORY: Used to track memory block that got > >>> poisioned, and will be passed around during kexec. > >>> 2) PG_hwpoison on struct page: Used by the memory subsystem to avoid > >>> touching it. > >> > >> How are both kept in sync? See below. > > > > The EFI table is only written when there is a memory failure. That is > > the only thing that writes to it: > > > > action_result() -> efi_hwpoison_record_pfn() -> set_bit() > > > > You can see it on patch "mm/memory-failure: efi: record > > hardware-poisoned frames into the poisoned-memory table" > > > > Then, when the kernel kexecs into a second kernel, the EFI config table > > is queried and the pages are poisoned from it at boot, as they are > > getting into the buddy allocator, in __free_pages_core(). > > I am not sure that is really the right place. That means we only poison free > memory. Shouldn't we poison as soon as we initialize the memmap, and check > whether any memblock allocations ended up on that poisoned memory and bail out? __free_pages_core() is how we hand over pages from memblock to page allocator initially -- from memblock_free_pages(), deferred_free_pages() and hotplug. It is the right place to never allow them on free lists. -- Kiryl Shutsemau / Kirill A. Shutemov