From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 476EDC5DF94 for ; Mon, 24 Aug 2026 10:32:47 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 428D86B008C; Mon, 24 Aug 2026 06:32:46 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3B28E6B0092; Mon, 24 Aug 2026 06:32:46 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2F1C26B0095; Mon, 24 Aug 2026 06:32:46 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 0D0F26B008C for ; Mon, 24 Aug 2026 06:32:46 -0400 (EDT) Received: from smtpin08.hostedemail.com (lb01a-stub [10.200.18.249]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 818EC1604B1 for ; Mon, 24 Aug 2026 10:32:45 +0000 (UTC) X-FDA: 85135799490.08.D6CB86B Received: from tor.source.kernel.org (tor.source.kernel.org [172.105.4.254]) by imf08.hostedemail.com (Postfix) with ESMTP id 7FA22160002 for ; Mon, 24 Aug 2026 10:32:43 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20260515 header.b=MWvJClqu; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf08.hostedemail.com: domain of kas@kernel.org designates 172.105.4.254 as permitted sender) smtp.mailfrom=kas@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1787567563; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=Q5frcXO7zyG1Iq+1oYF/eoeXxIiDw2PLXMirPuyU5Ds=; b=ncpNFRxf1+GX8Q9XMOwK3yQ84MEYVwsSs8CJNQjoNT6gy33Dk2aka/T9ux86F8mRO23+kS cfiwa6vY/qAISCJEV2rczkqXGuvUHfnd7SBMe6iFARegL4rn9PqGsdYDMSxumZUTjd0fRT utMyqYXyNQdyLDMBa20ZpUpNDUNlOIU= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20260515 header.b=MWvJClqu; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf08.hostedemail.com: domain of kas@kernel.org designates 172.105.4.254 as permitted sender) smtp.mailfrom=kas@kernel.org ARC-Seal: i=1; a=rsa-sha256; d=hostedemail.com; s=arc-20220608; cv=none; t=1787567563; b=jvftn3RS8hcsPtN61u+VBcjuEw2SB4E1CzVk6bt00Q2YiPAxzSxFOre9FraJwvKYN1ra0m AwrmYrgRvMbmOr4FsKD8sEN/qLVsHzhsU3vfoFl2S2/kAg1LTjL4hqLNYKlZT9f2PgLF+s aBCLEJA7GScSABfT8JZNcfa5quC03oI= Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id 07BCA600C8; Mon, 24 Aug 2026 10:32:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A433B1F00A3D; Mon, 24 Aug 2026 10:32:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1787567562; bh=Q5frcXO7zyG1Iq+1oYF/eoeXxIiDw2PLXMirPuyU5Ds=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=MWvJClqu/WoX2vNp1HHpt69dELCdRP1LmQUOkfPsNqbmy3STXvgyGbQLTVIh4rxQ4 AhCvRa/b0IlPXt2+JpUiWfgOzBmksgA2DcMh9mUGOfMgoE772RS2gv7iqXIiiaGEDa v5w4YC4pweJOnLyT3UOc0Vas+hbShvayjuVUhWuyE05V/ftQXM4tmgQTMteGA+hGk/ 0Cmp9UMN6aXsJZvAKLXUk1d6B3/6wQMUz47lVATKLg9UENmhHNsICKsWZCr5/+KL+z RvA3sNk0YxMmWGwqRFSmku8Hu9aF4SgeIhW3TSuk7QgDGg5zt9EjYfxO4MU5L4b+nx jQZYNPbql0s9Q== Received: from phl-compute-03.internal (phl-compute-03.internal [10.202.2.43]) by mailfauth.ams.internal (Postfix) with ESMTP id 340EB1980045; Mon, 24 Aug 2026 06:32:38 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-03.internal (MEProxy); Mon, 24 Aug 2026 06:32:40 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTEYnC3pImoohK99eGhBRTTR7KcVIkdV/ZQBL04BJxb8LYLYJ2gAtfA/2F8kCqKLMQ k2kZF/VDDj3pfDzPgVoz381cNo+3r3BSgIqYqZLNYbyqfTz/JHigmzZ8oniTQYrhneKQOf EEHdzcTrayFcRlmp5EAZRfT4AYlmPCJfm6md4UjrcbbZ8jHY/3Oc7j8plhP5euwZeuHfUH 0XcDnrUwXLrzmSxfa75UA7uHzeedDIX9sbAlzTFvmKdd2UxrAiXttuU7y/lfP2onlgcWLy /w1CYl5XRSdFYLHkqIo2jI9ebN35arPjMv8Boufoa1sbgloqdErdGlNWkj+ra2OeT2armT tBl9hJZ9vFHo06r7FvUgNcpuCc32sIcvvCRfblb2WBG0fQykN0mA3H0z5SiN3rGl5ClKpb 4oa2g3Z2zarUza7fKkdZgbq0RgGytdm6eufyf/DAf9QH26ndizuw2Z72G9c4d9oW8PXr+M HKnQ5UReYPUBTVtWSdDnoSU4Ud/jjbkyo5CQgy8tbbTLYa9QI0p5JTxgtdZN7B8uOzPIGL ggSC2cVugUf8xTN7KEYpG9kYBGLljA0/Tr0JydL4GAkn4pxf6s9bL5UWag99cUmOiGnrTQ 9VjccRmOhi75HC8vqBM/wAxhlPl4O/tedw/d0EzARF8XI3FdGsyJ9WN2ZAVg X-ME-Proxy: Feedback-ID: i10464835:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 24 Aug 2026 06:32:37 -0400 (EDT) Date: Mon, 24 Aug 2026 11:32:35 +0100 From: Kiryl Shutsemau To: Breno Leitao Cc: Ard Biesheuvel , Ilias Apalodimas , Miaohe Lin , Naoya Horiguchi , Andrew Morton , linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, rmikey@meta.com, riel@surriel.com, kexec@lists.infradead.org, kernel-team@meta.com Subject: Re: [PATCH v2 6/6] efi: respect the poisoned pages coming from previous kernel Message-ID: References: <20260821-hwpoison-kho-v2-0-5743791e48e6@debian.org> <20260821-hwpoison-kho-v2-6-5743791e48e6@debian.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Stat-Signature: eqkkw78kythzfccmfk3oxt9u6med1gjm X-Rspamd-Queue-Id: 7FA22160002 X-Rspamd-Server: rspam03 X-Rspam-User: X-HE-Tag: 1787567563-964136 X-HE-Meta: U2FsdGVkX19hbq91hk6sKox5ZdYZMmNZf6rzDKDnkR8iZEayH6IIN07IsoeZ4kytt74aHcT85/vKUSk7eGBZqpigGN2+3hgRfkjiqb4F6tXQh9c6SWW3y4f4+uE1IGVuWKt1vArA9eEtmogx5HQujwuxuhjvefCot5twC/ieSupdNotIXJFGW2ujnitMS/eN0tqv0NbNsuL2OBwZUuAZT87x6tTZCYUf4SF5K5PnLt3oIQGibycEskqfQ4dW/fO3On8roZcF9NEVn8mwl1Toivs8UxW4aQ4mp+JsoPLFj46e47PxwD+yRp5G2rSt5u7q9s88N3KAKdLYhkS2HmK/UxvyNE9ccTzzloIQ//zJw9uBPXQ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Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Fri, Aug 21, 2026 at 09:43:37AM -0700, Breno Leitao wrote: > On Fri, Aug 21, 2026 at 03:53:32PM +0100, Kiryl Shutsemau wrote: > > On Fri, Aug 21, 2026 at 07:03:06AM -0700, Breno Leitao wrote: > > > On Fri, Aug 21, 2026 at 01:13:55PM +0100, Kiryl Shutsemau wrote: > > > > On Fri, Aug 21, 2026 at 03:06:06AM -0700, Breno Leitao wrote: > > > > > + /* Reserve the table itself so it survives a further kexec. */ > > > > > + memblock_reserve(PAGE_ALIGN_DOWN(ppm), > > > > > + PAGE_ALIGN(ppm + sizeof(*pm) + bitmap_size) - > > > > > + PAGE_ALIGN_DOWN(ppm)); > > > > > > > > Hm. I don't think it is enough. > > > > > > > > On x86, kernel doesn't keep memblock around after boot (see > > > > CONFIG_ARCH_KEEP_MEMBLOCK). Reserving in memblock exclude the memory > > > > from page allocator. But kexec can place the image there. > > > > > > You mean the third kexec? > > > > > > 1) Kernel A hits an ECC error and marks page X poisoned. > > > 2) Kernel A kexecs into kernel B, which won't use that page since > > > it's in EFI_POISONED_PAGE and memblock-reserved. > > > 3) Kernel B kexecs into kernel C, which doesn't respect > > > EFI_POISONED_PAGE. > > > > > > Is this the scenario you mean? > > > > No. I think nothing prevents kernel B from putting kernel C image into > > the reserved space in !CONFIG_ARCH_KEEP_MEMBLOCK case. > > > > Kernel B excludes poisoned memory from buddy allocator, but kexec > > doesn't care about this when look for placement for the next image. > > Right, that is exactly the case I meant above — sorry for not being > clearer. > > Agreed, this is a gap. > > Can we keep it separate for now and address it as a follow-up? I wounder if the fix would be to make page allocator consume the table and not do memblock_reserve() here? So we would allocate struct pages for the memory and poison them on init. And your fix by the link below would do the rest. > Similar > to the one covered the initial issue [1] first. > > Link: https://lore.kernel.org/all/20260812-kexec_posioned-v6-0-e477887086f0@debian.org/ [1] -- Kiryl Shutsemau / Kirill A. Shutemov