From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id BE734941E3A for ; Mon, 22 Jan 2024 21:40:35 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=wMxP7k+6CPQt0/ahdTcaojlPNLAKBvZ2hamyy828aqI=; c=relaxed/simple; d=groups.io; h=Feedback-ID:Message-ID:Date:MIME-Version:User-Agent:Subject:To:References:From:In-Reply-To:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1705959634; v=1; b=X17Ucdh5eGViPLmWISTJksQ6gFUFXNqhlG3IzE38u5jWn21h3Dpq+KxA+gftLV1QYKUSu4Us UY3IoX+EXE6kQwn94GCWRJ1n8X2m2dBtQESDb2T3UfZ4HXMocgKMNJQwPGNzq3X+2sKPwZHXAFL F/pMYdINfZY2HgQhh80pE1hA= X-Received: by 127.0.0.2 with SMTP id ogIKYY7687511xnLeQkJ0ov5; Mon, 22 Jan 2024 13:40:34 -0800 X-Received: from wout4-smtp.messagingengine.com (wout4-smtp.messagingengine.com [64.147.123.20]) by mx.groups.io with SMTP id smtpd.web10.5585.1705959633643013905 for ; Mon, 22 Jan 2024 13:40:33 -0800 X-Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.west.internal (Postfix) with ESMTP id B525E32009F8; Mon, 22 Jan 2024 16:40:30 -0500 (EST) X-Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Mon, 22 Jan 2024 16:40:30 -0500 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvdekiedgudehtdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhepkfffgggfuffvfhfhjggtgfesth ejredttddvjeenucfhrhhomheptfgvsggvtggtrgcuvehrrghnuceorhgvsggvtggtrges sghsughiohdrtghomheqnecuggftrfgrthhtvghrnhepjeehtdeuudefjedvuddvueehte dvheevudduhfdtgfejfefggeffkefhffejlefhnecuffhomhgrihhnpehgihhthhhusgdr tghomhenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe hrvggsvggttggrsegsshguihhordgtohhm X-ME-Proxy: Feedback-ID: i5b994698:Fastmail X-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 22 Jan 2024 16:40:29 -0500 (EST) Message-ID: <4f0d4416-b5d6-4987-832c-040efa2a9ebf@bsdio.com> Date: Mon, 22 Jan 2024 14:40:27 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [edk2-devel] EFI_SYSTEM_TABLE allocated by AllocateRuntimeCopyPool isn't aligned to 4KB To: Oliver Smith-Denny , devel@edk2.groups.io References: <49f7e14e-532e-444c-8978-e290d4338386@bsdio.com> <14a7ee41-47a8-4a52-ab45-25008a414e69@linux.microsoft.com> From: "Rebecca Cran" In-Reply-To: <14a7ee41-47a8-4a52-ab45-25008a414e69@linux.microsoft.com> Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,rebecca@bsdio.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: pm4470ZdkpQ4VzdZ7glbeNWzx7686176AA= Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=X17Ucdh5; dmarc=none; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io On 1/22/2024 1:24 PM, Oliver Smith-Denny wrote: > Allocating pool memory will never be 4KB aligned because of the > POOL_HEAD. See:=20 > https://github.com/tianocore/edk2/blob/master/MdeModulePkg/Core/Dxe/Mem/P= ool.c#L463-L537. > > The allocated page is 4KB aligned, of course, but we store the POOL_HEAD > at the beginning of that page and return Head->Data to the caller. > > In addition, this is only in the case where you allocate a new page for > the pool. In the case where the pool has the pages it needs, you don't > have any alignment guarantee, I believe, it is just offset further > into one of the already allocated pages. Thanks. I'll update the script to require users to pass in the address=20 of the EFI_SYSTEM_TABLE instead of searching for it! --=20 Rebecca Cran -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#114149): https://edk2.groups.io/g/devel/message/114149 Mute This Topic: https://groups.io/mt/103894456/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-