Operating Systems that get hibernated expect all non-boot-time allocations to be identical before and after hibernation.
In edk2, we create pools and allocate pages starting from the highest allowed address for the allocation, usually 0xFFFFFFFF. Typically, that means we allocate a few pages of boot time data, then a few pages of runtime data, then another few pages of boot time data and again runtime data. Every allocation has direct impact on the following allocations. The problem with this scheme is that small code changes in boot time code already can have significant impact on runtime allocations, which then break hibernation. This patch set adds a mechanism to set an upper bound to dynamic memory allocations for different allocation types. This allows us to move data that has to stay at the same place across firmware changes at the same place. The patch set also enables this on OVMF by default. Alex Alexander Graf (2): MdeModulePkg/Core/Dxe: Allow to force runtime allocations at separate range OvmfPkg: Make hibernation critical allocations at own ranges MdeModulePkg/Core/Dxe/DxeMain.inf | 4 +++ MdeModulePkg/Core/Dxe/Mem/Page.c | 70 +++++++++++++++++++++++++++++++++++++++ MdeModulePkg/MdeModulePkg.dec | 16 +++++++++ MdeModulePkg/MdeModulePkg.uni | 12 +++++++ OvmfPkg/OvmfPkgIa32.dsc | 6 ++++ OvmfPkg/OvmfPkgIa32X64.dsc | 6 ++++ OvmfPkg/OvmfPkgX64.dsc | 6 ++++ 7 files changed, 120 insertions(+) -- 2.16.4 Amazon Development Center Germany GmbH Krausenstr. 38 10117 Berlin Geschaeftsfuehrung: Christian Schlaeger, Jonathan Weiss Eingetragen am Amtsgericht Charlottenburg unter HRB 149173 B Sitz: Berlin Ust-ID: DE 289 237 879 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#71790): https://edk2.groups.io/g/devel/message/71790 Mute This Topic: https://groups.io/mt/80739500/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-