From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1794574565; b=hRmhlaDp7mapc9xFX7iO2EkKYWQkUIAdtW6BXwAUJmZxslt66dYEHzZZx62Fb4zwDmT8 NZiHqFZLEtBbN1LP99/0LCyJZsOcnsZeKbFaEyaGi7MzgSUVGbTZfFzYYUbFiMW5PdtvK CivLwi0cZIJsXsJQg1mKR89PVwJI0OL/FIs+9XzUKtECWaKiCEbHFT4ywiWNr20xZO2bd KEDPs2LuDd6zsuK8X37QNvmLVFbD88RkTm8erftoBMHRUH8b2tqL9KZnsiH7bnj0QQeos aJTgiE6hglz/IX65WIBWDbRl+v2ozvUXzbq10VG6H7z2UBlWjncleETkXbQKA/Ofd0w== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794574565; h=Received:DKIM-Signature:Received:Received:X-ME-Sender:X-ME-Received: X-ME-Proxy-Cause:X-ME-Proxy:Feedback-ID:Received:Date:From:To:Cc: Subject:Message-ID:References:MIME-Version:Content-Type: Content-Disposition:In-Reply-To; bh=4tSzNT5XSWSixiegslDJk3QLG0Zr8jciuO7mZR0zc5I=; b=Si+dgTwp8zhnXev2MLMJC7AAOIu6ol63xQWDZxMAnIIftmVtZ670IeS2Q5OaGx9um1+z W0jcL1jBUoaM2oIp15DyhSYzkHZY3+g4FyPg/DK+gw8rb2Xb60OD4gjjz275TcXPg6F3X H9oZQ5v7g1b1GJZZaPew/YoDab4CDvEAl4PySwV/xxeGJ29VL8k001MrSvvfTEeQ/iRWH 6SdOs+Hz73PxrS0aCI9+3+n62oIJXek5FBHlYt52PabLHKmZq5u0n0apCJJzzh4072BBD WcSCVZMcB6qs0XVvKERwH+9Mg2G6MQh84GCVjy47KHPodXtq9CmCv6XrVIJzuba+Eqg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=lvj4yY1l; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1745D606A331 for ; Fri, 13 Nov 2026 12:56:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=lvj4yY1l Received: by smtp.kernel.org (Postfix) with ESMTPSA id B1F9B1F000C5; Fri, 13 Nov 2026 12:56:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1794574564; bh=4tSzNT5XSWSixiegslDJk3QLG0Zr8jciuO7mZR0zc5I=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=lvj4yY1lMbAfCFEKpUy46MLT7MIRUMSw/9DvQi0lCqCyfEEWLXHLjrYGbcbvlyUgd Ee42FemA5b21zkdvvm2EAcIpaf0CjIEWN/7EUqsJjyBITnPtmVDcsG4MPROXfIcQFH YctRCRfK3yh8tnV6DyDCnIiemj6ANeOP5P89LsEZ75NDg646Bnpu6/VKcK8z8UH3Wj UHidyE1JlCdHLM1Gxtue3BpiaLFJ5AEJKZF3ACXzZxQreCex3EyZXGaYou4/uM0qna q9HmZIM31Sgl9Ew8S87KOh/SHp2hHnSzP38MwKYuY4xgcOd1he+AXwpFMLvfpsL3my TU28frsWTH7IQ== Received: from phl-compute-01.internal (phl-compute-01.internal [10.202.2.41]) by mailfauth.ams.internal (Postfix) with ESMTP id BD18B198003A; Fri, 13 Nov 2026 07:55:59 -0500 (EST) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-01.internal (MEProxy); Fri, 13 Nov 2026 07:56:02 -0500 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTEALCY8BjEB9962J19+FFzaFn7/mDszJU/f0IQoJYE08F9eNi9AROuRlq7pU2+FXD zoNVXqKBs3ph2NtrQiIbObaLyrIngOHx7B+sdK6iQ+jfItZBvkvsFLopEHbvs6okBQgb5T T3FhlyqhoGdVKxR9UvwevmGemWC2pw9RXWPJmT/hEImGxMrfJhZLPtavP/c6QdWQg/A6b8 X5O11D6kkCylwxWMIUDUmx1JRIy29fX8Rzvm50e/adyzuWb9S0hJRhcuwm+lPAtw8FuGn4 rju8p9vVIWIvL96aJgoJcn0XKhXQzZ1uUAuAH7wCb597h85mktgUj4cIXuqKo5YXHCqSYw ObzBzC+xeGRFdSq8OK9Iw179SQq7JXdMgizRPjcfc7bMNY4T6epVxNLGOJxv3xUQSLR/64 Zxw6vhBrfWdMRycJp9of5fwiEuNbYcgfNCpCp0cn3gxt62aAog+aWCJXFmQAiNZCZkWG9B lWC/3udG+aiOLf/DbuEx2ykJWJHQaSgwcHKmqXrBVIxChV1yPNGmyFR+DbWWQVtVmpRQwj NtZPNHIr8/CvIjr/tdwg11qigVVQJPIqaWNhPn6ysx/4QZa61YdCJv4sA2APKR+gfMKL8v obEc1lTb9YEpWYZIrpyfGF/TB6GjA8e8r0Isgz4pTIYFCflmX0V2H1dmabRA X-ME-Proxy: Feedback-ID: i10464835:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 13 Nov 2026 07:55:58 -0500 (EST) Date: Fri, 13 Nov 2026 12:55:57 +0000 From: Kiryl Shutsemau To: Pankaj Gupta Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H . Peter Anvin" , Tom Lendacky , Ard Biesheuvel , Ilias Apalodimas , linux-kernel@vger.kernel.org, Mike Rapoport , linux-mm@kvack.org, linux-efi@vger.kernel.org, Pankaj.gupta.linux@gmail.com, stable@vger.kernel.org Subject: Re: [PATCH v2] x86/unaccepted_memory: Do not accept ranges that are no longer E820 RAM Message-ID: References: <20261113105554.199912-1-pankaj.gupta@amd.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20261113105554.199912-1-pankaj.gupta@amd.com> On Fri, Nov 13, 2026 at 04:55:54AM -0600, Pankaj Gupta wrote: > Accept only whole pages of E820 RAM, and clear the bitmap bits only for the > units in which memory was accepted. A bit in the bitmap covers the whole unit. If the hole doesn't start and end on a unit boundary, the unit at its edge is only partly accepted, but its bit gets cleared. The rest of the unit stays unaccepted and nothing records it. This kernel never touches the hole, but the next one can. memmap= and mem= only edit e820_table. kexec_file_load() hands the next kernel e820_table_kexec, which is copied before the command line is parsed and still has the hole as RAM. The next kernel finds RAM with a clear bit and uses it. memmap=1M$0x1fff00000, then kexec into a kernel without it. On TDX this is new. tdx_accept_memory() works on physical addresses, so today the hole is accepted together with the rest of the unit and the bitmap stays correct. Only SNP needs the direct mapping. A unit cannot be half accepted. Given that, should we go with what Ard suggested and refuse memmap= holes in unaccepted memory instead? -- Kiryl Shutsemau / Kirill A. Shutemov