public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Rebecca Cran" <rebecca@bsdio.com>
To: Oliver Smith-Denny <osde@linux.microsoft.com>, devel@edk2.groups.io
Subject: Re: [edk2-devel] EFI_SYSTEM_TABLE allocated by AllocateRuntimeCopyPool isn't aligned to 4KB
Date: Mon, 22 Jan 2024 14:40:27 -0700	[thread overview]
Message-ID: <4f0d4416-b5d6-4987-832c-040efa2a9ebf@bsdio.com> (raw)
In-Reply-To: <14a7ee41-47a8-4a52-ab45-25008a414e69@linux.microsoft.com>

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: 
> https://github.com/tianocore/edk2/blob/master/MdeModulePkg/Core/Dxe/Mem/Pool.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 
of the EFI_SYSTEM_TABLE instead of searching for it!


-- 
Rebecca Cran



-=-=-=-=-=-=-=-=-=-=-=-
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]
-=-=-=-=-=-=-=-=-=-=-=-



  reply	other threads:[~2024-01-22 21:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-22 19:52 [edk2-devel] EFI_SYSTEM_TABLE allocated by AllocateRuntimeCopyPool isn't aligned to 4KB Rebecca Cran
2024-01-22 20:24 ` Oliver Smith-Denny
2024-01-22 21:40   ` Rebecca Cran [this message]
2024-01-22 21:31 ` Michael D Kinney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4f0d4416-b5d6-4987-832c-040efa2a9ebf@bsdio.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox