Skip to content

RFC Runtime allocation of memory regions

Patrick Steinhardt grub-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest3 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3mm: allow dynamically requesting additional memory regionsgrub-core/kern/mm.c include/grub/mm.h+23 -10 replies
2/3efi: mm: extract function to add memory regionsgrub-core/kern/efi/mm.c+19 -380 replies
3/3efi: mm: implement runtime addition of pagesgrub-core/kern/efi/mm.c+11 -41 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC PATCH 0/3] Runtime allocation of memory regions

Hi,

as you may be aware, LUKS2 currently doesn't support the Argon2 key derival function (KDF). While the implementation itself isn't much of a problem in theory, one issue we currently have is that Argon2 is a memory-safe KDF and thus requires huge chunks of memory. The memory management subsystem isn't currently up to task to handle huge allocations on all platforms. So back in March, we decided to improve the MM subsystem first before landing Argon2 support.

This patch series is a first RFC to ask for feedback on my chosen approach. It implements a new callback that may be set up by the platform-MM-implementation. In case currently allocated memory regions don't have sufficient bytes available to satisfy a given memory allocation, the callback will be invoked in order to make an additional memory region available that can satisfy the request.

As such, we avoid all the downsides of pre-allocating a huge heap and can just dynamically handle any huge requests.

I only compile-tested the code, meaning it probably won't work out-of-the-box. My intention is mainly to first get an agreement on whether this seems like a sensible approach to fix the problem.

Patrick

Patrick Steinhardt (3):
mm: allow dynamically requesting additional memory regions
efi: mm: extract function to add memory regions
efi: mm: implement runtime addition of pages

 grub-core/kern/efi/mm.c | 66 +++++++++++++++++------------------------
 grub-core/kern/mm.c     | 11 ++++++-
 include/grub/mm.h       | 13 ++++++++
 3 files changed, 50 insertions(+), 40 deletions(-)
Signature · 1 line
2.26.2