public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH 0/2] Improve hibernation safety
@ 2021-02-18 20:09 Alexander Graf
  2021-02-18 20:09 ` [PATCH 1/2] MdeModulePkg/Core/Dxe: Allow to force runtime allocations at separate range Alexander Graf
  2021-02-18 20:09 ` [PATCH 2/2] OvmfPkg: Make hibernation critical allocations at own ranges Alexander Graf
  0 siblings, 2 replies; 7+ messages in thread
From: Alexander Graf @ 2021-02-18 20:09 UTC (permalink / raw)
  To: devel
  Cc: Leif Lindholm, Laszlo Ersek, Ard Biesheuvel, Jordan Justen,
	David Woodhouse, Hendrik Borghorst

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




^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-02-19 17:31 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-02-18 20:09 [PATCH 0/2] Improve hibernation safety Alexander Graf
2021-02-18 20:09 ` [PATCH 1/2] MdeModulePkg/Core/Dxe: Allow to force runtime allocations at separate range Alexander Graf
2021-02-18 22:28   ` [edk2-devel] " Michael D Kinney
2021-02-19 14:10     ` Alexander Graf
2021-02-19 16:47       ` Laszlo Ersek
2021-02-19 17:31         ` Alexander Graf
2021-02-18 20:09 ` [PATCH 2/2] OvmfPkg: Make hibernation critical allocations at own ranges Alexander Graf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox