All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick Steinhardt <ps@pks.im>
To: The development of GNU GRUB <grub-devel@gnu.org>
Cc: Leif Lindholm <leif@nuviainc.com>, Daniel Kiper <dkiper@net-space.pl>
Subject: [RFC PATCH 0/3] Runtime allocation of memory regions
Date: Mon, 1 Jun 2020 21:34:33 +0200	[thread overview]
Message-ID: <cover.1591040037.git.ps@pks.im> (raw)

[-- Attachment #1: Type: text/plain, Size: 1620 bytes --]

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(-)

-- 
2.26.2


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

             reply	other threads:[~2020-06-01 19:33 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-01 19:34 Patrick Steinhardt [this message]
2020-06-01 19:34 ` [RFC PATCH 1/3] mm: allow dynamically requesting additional memory regions Patrick Steinhardt
2020-06-01 19:34 ` [RFC PATCH 2/3] efi: mm: extract function to add " Patrick Steinhardt
2020-06-01 19:34 ` [RFC PATCH 3/3] efi: mm: implement runtime addition of pages Patrick Steinhardt
2020-06-02 12:57   ` Vladimir 'phcoder' Serbinenko
2021-08-08 13:31 ` [PATCH v2 0/4] Runtime allocation of memory regions Patrick Steinhardt
2021-08-08 13:31   ` [PATCH v2 1/4] mm: Allow dynamically requesting additional " Patrick Steinhardt
2021-08-09 15:52     ` Daniel Kiper
2021-08-08 13:31   ` [PATCH v2 2/4] efi: mm: Extract function to add " Patrick Steinhardt
2021-08-09 16:02     ` Daniel Kiper
2021-08-08 13:31   ` [PATCH v2 3/4] efi: mm: Pass up errors from `add_memory_regions ()` Patrick Steinhardt
2021-08-09 16:10     ` Daniel Kiper
2021-08-15 10:20       ` Patrick Steinhardt
2021-08-08 13:31   ` [PATCH v2 4/4] efi: mm: Implement runtime addition of pages Patrick Steinhardt
2021-08-09 16:24     ` Daniel Kiper

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-all 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=cover.1591040037.git.ps@pks.im \
    --to=ps@pks.im \
    --cc=dkiper@net-space.pl \
    --cc=grub-devel@gnu.org \
    --cc=leif@nuviainc.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.