From: "Arminder Singh via groups.io" <arminders208=outlook.com@groups.io>
To: devel@edk2.groups.io
Subject: [edk2-devel] [Discussion] Want some input on potentially adding support for 16K and 64K page granules and allocations in AARCH64 EDK2 (for systems that do not support 4K paging modes)
Date: Thu, 03 Jul 2025 16:37:54 -0700 [thread overview]
Message-ID: <cYx6.1751585874550884527.yJjh@groups.io> (raw)
[-- Attachment #1: Type: text/plain, Size: 3675 bytes --]
Hello,
Reposting from RFC mailing list since the mailing list for RFCs doesn't seem to be too active these days and my message there is stuck in moderator approval for multiple days.
This has been something that I was contemplating posting an email about for many months at this point but due to the rather large scope nature of the problem, I've been hesitant to bring it up. However, now that I'm further along in firmware bringup for Apple ARM platforms (unofficial Project Mu port to clarify, a hobby thing I'm mainly doing in free time, not associated with Apple at all), I feel it's important I bring this topic up now especially with how the ARM spec allows implementers to support page granules, and the potential for future systems to also have the same characteristics.
In short, EDK2 since the beginning has only ever supported 4K page allocations for all architectures and platforms it's been supported on. However, with the introduction of the M1 and Apple's ARM powered Macs (really since the Apple A9 launched in 2015, but the M1 and the ARM Macs are the first Apple platforms that Apple deliberately lets users run their own boot firmware on so I'm mostly scoping discussion to ARM Macs and such) it's clear that while Apple does support 4K pages (for Rosetta support), it's clear that these systems are 16K page granule systems first and foremost (a number of the IOMMUs on these systems *only* support 16k granule allocations, and XNU basically only uses 16K allocations for non-Rosetta processes) - and with the announcements that Rosetta and such are on the way out in the next year or two it's safe to assume that future Apple SoCs will *only* support 16k (and possibly 64k) page granules. This is already a problem for firmware bringup in my case for Apple ARM Macs because some IOMMUs *rely* on 16K page allocations to even work correctly and I can't properly add support for them at the moment without some ugly hacks. This issue isn't limited to Apple systems and SoCs though, as ARM leaves it implementation defined whether an ARM implementation supports 4k pages or not - and there could very well be systems in the future that do not implement 4K paging.
As a result of all of these factors, I'd like to get some input on what it would take to add proper support for 16k and 64k page granules and allocations in EDK2 for AARCH64 platforms that do not implement 4K paging. Since a lot of EDK2 is basically designed around 4K page granules, I imagine there would be a lot of work that would have to be done across a lot of modules to remove assumptions about 4K pages, but since the ARM spec states that systems can decide not to implement 4K page granules and translation, I don't think it's a topic that should be ignored too much longer. (Especially considering that the Linux kernel also supports full 16K only builds due to the push for ARM Mac support and Android is also going in that direction as well). Happy to write the patch myself as well or even just parts of it, right now I would appreciate some input into how difficult it would be to add support for different page granules without breaking everything in EDK2 since it seems like this would be a VERY breaking change just based on the source code comments in the files that implement page allocations.
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#121455): https://edk2.groups.io/g/devel/message/121455
Mute This Topic: https://groups.io/mt/113976011/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-
[-- Attachment #2: Type: text/html, Size: 4227 bytes --]
next reply other threads:[~2025-07-03 23:37 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-03 23:37 Arminder Singh via groups.io [this message]
2025-07-04 6:29 ` [edk2-devel] [Discussion] Want some input on potentially adding support for 16K and 64K page granules and allocations in AARCH64 EDK2 (for systems that do not support 4K paging modes) Ard Biesheuvel via groups.io
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=cYx6.1751585874550884527.yJjh@groups.io \
--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