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.web11.334.1675795815842841122 for ; Tue, 07 Feb 2023 10:50:16 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@posteo.de header.s=2017 header.b=animrKYd; 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 C87BD240461 for ; Tue, 7 Feb 2023 19:50:13 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1675795813; bh=4z50Utc208eVSwqr+s87LCWahqaTqXLJtz1LsTbtgcI=; h=From:Subject:Date:Cc:To:From; b=animrKYdp9TBc8zHWS8EbK9QUfZajVJLSXEC8W0TnE1biqXf6eHQALPl95+BDJDgS 742kTv3Agh8gQRLQeNcx1E2Eyp59NLp9KXallG/2+ayGI7zjYXk2mlUgux6waDL6DP sCjr7UXaWiR6R8jRGwb0TXBz9uSVTjmn4360kAHcvLMjW9MtCHCwTGM2UdQ4bZgXoO He3pcnwYHvN5H5R8FnLNQwItf09YUX63WD5PGwgEqjb6jtOV/zlwIE5Vmux1PXdZ5Z RZ46N9djWRNJBmF/ujXRNlYu+alCsd38aV9oZWRXNsyO+hHo7f525iuQaq3z9US+2c rtuaIVyS6jdHQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4PBByX4PQSz9rxG; Tue, 7 Feb 2023 19:50:12 +0100 (CET) From: =?UTF-8?B?TWFydmluIEjDpHVzZXI=?= Mime-Version: 1.0 (1.0) Subject: Re: [edk2-devel] [PATCH 4/4] ArmPkg/CpuDxe: Implement EFI memory attributes protocol Date: Tue, 7 Feb 2023 18:50:11 +0000 Message-Id: <0ECC42ED-FC70-4E08-B471-58C769521021@posteo.de> References: Cc: devel@edk2.groups.io, ardb@kernel.org In-Reply-To: To: Taylor Beebe Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable > On 7. Feb 2023, at 19:19, Taylor Beebe wrote: >=20 > If I understand Marvin correctly, he means that there either needs to be a= requirement that if you change the attributes of an allocated buffer you mu= st change them back before freeing, or the memory management logic should ha= ndle the possibility that the memory attributes may have changed since alloc= ation. Yes. More explicitly, I fear the former is what is happening and the latter i= s what the protocol and DXE service descriptions suggest. Best regards, Marvin > In my opinion introducing the Memory Attribute Protocol requires more attr= ibute accounting when allocating and freeing. I believe the two changes link= ed below ensure that attributes are properly set. >=20 > 1. https://github.com/microsoft/mu_basecore/blob/788c17f750323efc206cdb042= a2c14a587dcf27a/MdeModulePkg/Core/Dxe/Mem/Page.c#L1570 > 2. https://github.com/microsoft/mu_basecore/blob/788c17f750323efc206cdb042= a2c14a587dcf27a/MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c#L1562