On Tue, May 14, 2024 at 05:17:51AM GMT, Ni, Ray wrote:
> Gerd,
> I agree that the logic might be duplicated in multi places.
>
> But even CPU supports 1G paging, caller can decide whether to use 1G paging
> or 2M paging, or 4K paging.
> Using a single API to encapsulate the entire logic may not seem flexible.
Sure, I don't want take away that flexibility. A caller might also
prepare page tables for a paging mode not matching the current CPU
paging mode (i.e. 32-bit PEI preparing page tables for 64-bit DXE).
> Maybe, a lib API to detect 1G paging capability can be added to CpuLib.
Yep, that is exactly what I think would be useful. Add a
PAGING_MODE PageTableBestMode(VOID);
function with this code to CpuPageTableLib, so callers have the option
to use
PagingMode = PageTableBestMode();
instead of duplicating the code block.
take care,
Gerd
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#118881): https://edk2.groups.io/g/devel/message/118881
Mute This Topic: https://groups.io/mt/106018135/21656
Group Owner: [email protected]
Unsubscribe: https://edk2.groups.io/g/devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-