From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mout02.posteo.de (mout02.posteo.de [185.67.36.66]) by mx.groups.io with SMTP id smtpd.web10.7121.1675882538889870314 for ; Wed, 08 Feb 2023 10:55:39 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@posteo.de header.s=2017 header.b=QxNPd4yh; spf=pass (domain: posteo.de, ip: 185.67.36.66, mailfrom: mhaeuser@posteo.de) Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 29A7A240699 for ; Wed, 8 Feb 2023 19:55:36 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1675882537; bh=iq1vt/jV7w6WzeFKwsFwK7kfAR8YI84gIoZLG4ExbVE=; h=Subject:From:Date:Cc:To:From; b=QxNPd4yhSc219OXx/HjGXPVIB6n4yT2S8zYv+2iiBHU6mIu7nG/geJMqtGqw4wz+w OZA/XjnJA/7T6Inl2Vs1ENlyoMD3N8i7I6LSevDJOjpjy6L9OB7w67uS419at1ufRw GF0INnGqtAr4j8SXRry5T9/54sxPw1gpq+QhNJvSXK5XVre3cxJFrDlvnkyeIKSCaO Nvl2+G9w756vPlTO9RYfAijVPNG5Bo3F2YfwpN/6qdKRoA52LYuCWJB+sRZl2m2YAc +49vftBHGa+jsRMXogtOhJyhwkA0ufonExTSIRN+t3sUd9slI3mRwBwW3ptLMkCOT2 RSTMY3qgiNOxQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4PBq2G1rz2z6trT; Wed, 8 Feb 2023 19:55:34 +0100 (CET) Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.400.51.1.1\)) Subject: Re: [PATCH 3/3] MdeModulePkg/DxeCore: Unconditionally set memory protections From: =?UTF-8?B?TWFydmluIEjDpHVzZXI=?= In-Reply-To: Date: Wed, 8 Feb 2023 18:55:23 +0000 Cc: edk2-devel-groups-io , Michael Kinney , Liming Gao , Jiewen Yao , Michael Kubacki , Sean Brogan , Rebecca Cran , Leif Lindholm , Sami Mujawar , Taylor Beebe Message-Id: <76A536C6-42EE-48DB-BF53-810A34E43AE1@posteo.de> References: <20230208175812.700129-1-ardb@kernel.org> <20230208175812.700129-4-ardb@kernel.org> To: Ard Biesheuvel Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable > On 8. Feb 2023, at 19:49, Ard Biesheuvel wrote: >=20 > This is all copy-pasted from = MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c :( >=20 > The ordering here is a bit tricky. As soon as the CPU arch protocol is > exposed, every allocation will be remapped individually, resulting in > page table splits and therefore recursion. So the issue is the order of event handlers or allocations within the = event dispatcher? :( Oh lord... Can we maybe clarify the comment with something like "While = DxeCore/InitializeDxeNxMemoryProtectionPolicy() would in theory perform = this task, allocations between the protocol installation and the = invocation of its event handler may trigger the issue."?=