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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 982A1C61DCB for ; Fri, 28 Aug 2026 13:59:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=GMsq4s9H5sslOOoHpaDnzK693uMuIdL+zLKvHUgSCOw=; b=l6JHClpkRdknvY9r/ns/BFuDUL gsAGOsoKAzU/h3SE/7udRHRng0aAmK/Io+lbpiSFXcWBkV7CvApA8t7KYW4w3AEVNQ0muo48HOor6 aJz1lwuEvRlrOFxOtSP4BfdFbbsLeo9mIoZtoTyUaGrvSibk1NkMUQFsnmiTXZatn+nAbQdCOMi30 iLTVlGIblcKnHkoNf4+yzO8Ydvl1y5rViFWqkSRDAwrCMZsMMYvTQ9XtomM+6x/GClOm5eDxnt99n MqzGEy8JXFCOs5sByxNQKedZ3gkjA8V7QC5lg5aPxd/RwckHEAqtoDVRAxv4vteWv9z5yvT99tXXq wxtIrxEA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1wzx7Y-00000005vf8-0ks6; Fri, 28 Aug 2026 13:59:52 +0000 Received: from sea.source.kernel.org ([2600:3c0a:e001:78e:0:1991:8:25]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1wzx7X-00000005vew-1QMX for kexec@lists.infradead.org; Fri, 28 Aug 2026 13:59:51 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id 1E58743C21; Fri, 28 Aug 2026 13:59:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 14F231F00A3D; Fri, 28 Aug 2026 13:59:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1787925591; bh=GMsq4s9H5sslOOoHpaDnzK693uMuIdL+zLKvHUgSCOw=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=lDLgEYHxqyMExx7XGHQ1jMOssFVfuXXHoEzbBFpy5flN3Ib4Bd3XgGWIWJMp6arLJ uQVbfv7J5ZyA4dhS8/bZdYE+uBBMnrDV8e0fo5PloBITeSUDghfkfYw1D9c5wdWYwu XZQit9lHQy1bSrPTtaQxgXbGCzJ7ybYZKFJ2vKJmyZ3gfcQ9S9Zux7MV4EHTe8WKIF cQvwZk10zsIwVNSeF02O73cQgZkIW8VKvcKbmR4S3FO1bWytcWw/EKysYqo2DV0DeN 8tK1MPeAD1ya67qILgrYnKWGC/cyVNaPzFTPrj302CK1H26FHwBHo62CzeDmiZRHiZ FnDhPRSM8Ictw== Received: from phl-compute-09.internal (phl-compute-09.internal [10.202.2.49]) by mailfauth.ams.internal (Postfix) with ESMTP id 8F1C61980045; Fri, 28 Aug 2026 09:59:45 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-09.internal (MEProxy); Fri, 28 Aug 2026 09:59:48 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTFllgFcBPPxWyh7H7Ya97cPF2z+CaYPZAeFHJRUEOI7iP7NbK/RD+h7m0XG7mWy16 fIZCnkd80l4AcUG6PCl7E90y1FlqRmxxmociQ31S8wZQTE+r/ShOn2X3FGZoq2J0Vdf97p nuFw4AqeM/WomfxoyRgLOaOyXPCImUEPhxoNz4O6fJf9J9swOyN5utIVT2r0XabJbA4HxF oILQMURKy3DfTYUUGeeYdtTqPn4upMBcTfKSGqNc5c6xt9AM949lwP1kFNdph86l+6pYNc RLrozyUVEmo7eSsWX5/dVPnhXM37BJYxN8ROLEVvUcuC0Xxxx2BGLKc00OiMUuXhlN+6X0 1vEX6V9DH/wtIWZy7pT2JUHc34pYq9bNE1mhzx6gPcCLaoh6ZOIx6UPo5fsw2jPVelT/oM +RkCwxR1y6cCiBY7aJLTWgDUQPbYSswR7CrwcwhuhPYs7IJmoS7+ghC4sDkXaU/AkAnIJc Gu0NQkXGvpCFrPL0K1sJJ0/HBEE6GTdYLrk1kEZpfjVXn0h1VASbWIyC8kJ92dmWrjl1FK b/EgQHbOIgf+5hE5GMQ3LfKop5IEUj8L2oPdH4UNTLw/ZUAu52OAWj7ERMa3mq8u4Fpfvf n43K7EzhAX+ZsBpBswrS7KKCqwtaiiqzNVHDXonWeXfntyQUnXrftzSFTLNg X-ME-Proxy: Feedback-ID: i10464835:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 28 Aug 2026 09:59:44 -0400 (EDT) Date: Fri, 28 Aug 2026 14:59:43 +0100 From: Kiryl Shutsemau To: Breno Leitao Cc: Ard Biesheuvel , Ilias Apalodimas , Miaohe Lin , Naoya Horiguchi , Andrew Morton , kexec@lists.infradead.org, David Hildenbrand , Lorenzo Stoakes , "Liam R. Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, rmikey@meta.com, riel@surriel.com, kernel-team@meta.com Subject: Re: [PATCH v3 2/5] mm/memory-failure: libstub: install the poisoned-memory EFI table Message-ID: References: <20260826-hwpoison-kho-v3-0-6f79c4b605bc@debian.org> <20260826-hwpoison-kho-v3-2-6f79c4b605bc@debian.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260826-hwpoison-kho-v3-2-6f79c4b605bc@debian.org> X-BeenThere: kexec@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "kexec" Errors-To: kexec-bounces+kexec=archiver.kernel.org@lists.infradead.org On Wed, Aug 26, 2026 at 05:03:53AM -0700, Breno Leitao wrote: > A EFI config table can only be installed while boot services are still > up, so the stub has to create it; the running kernel can only flip bits > in a table that already exists. > > Size the bitmap from the top of usable RAM, which efi_get_ram_top() > works out by walking the UEFI memory map, since the stub has no max_pfn. > Bit N covers unit N counting from address 0, so the table tracks > max_pfn. Memory the firmware hot-adds later sits above it and is not > carried across a kexec. > > One table has to serve every architecture, so efi_get_ram_top() takes > the union of the memory types they turn into RAM: what setup_e820() maps > to E820_TYPE_RAM on x86, plus the EFI_ACPI_RECLAIM_MEMORY and > EFI_PERSISTENT_MEMORY that is_usable_memory() accepts on arm64. Sizing > wide only costs bitmap bytes; sizing narrow silently drops the records > for every frame above the top. x86 and ARM doesn't seem to agree what RAM is. On x86 it is by ->type and on ARM it is by ->attribute (anything WB/WC/WT). is_usable_memory() only decides nomap. Everything is_memory() lets in lands in memblock.memory, and max_pfn is PFN_DOWN(memblock_end_of_DRAM()), so the top of RAM there can be a type that is not on your list. -- Kiryl Shutsemau / Kirill A. Shutemov