All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick Steinhardt <ps@pks.im>
To: grub-devel@gnu.org
Cc: Leif Lindholm <leif@nuviainc.com>,
	Daniel Kiper <dkiper@net-space.pl>,
	Stefan Berger <stefanb@linux.ibm.com>
Subject: [PATCH v2 0/4] Runtime allocation of memory regions
Date: Sun, 8 Aug 2021 15:31:37 +0200	[thread overview]
Message-ID: <cover.1628429274.git.ps@pks.im> (raw)
In-Reply-To: <cover.1591040037.git.ps@pks.im>

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

Hi,

this is version two of the patch series which implements allocation of
new memory regions at runtime for EFI-based systems. The goal is to be
able to allocate big chunks of memory, which is currently not possible
given that GRUB only allocates a fixed amount of bytes.

This version has been rebased on top of the current master. The only
change compared to v1 is a the patch 3/4, which changes the signature of
`add_memory_regions ()` to pass up any errors instead of raising a fatal
error.

I've tested this change with my Argon2 support for LUKS2. Due to Argon2
being memory hard, it requires us to allocate a consecutive 1GB chunk in
which the resulting key will be computed.

Patrick

Patrick Steinhardt (4):
  mm: Allow dynamically requesting additional memory regions
  efi: mm: Extract function to add memory regions
  efi: mm: Pass up errors from `add_memory_regions ()`
  efi: mm: Implement runtime addition of pages

 grub-core/kern/efi/mm.c | 83 +++++++++++++++++++----------------------
 grub-core/kern/mm.c     | 11 +++++-
 include/grub/mm.h       | 13 +++++++
 3 files changed, 61 insertions(+), 46 deletions(-)

Range-diff against v1:
1:  ba8127734 = 1:  cf709a8a1 mm: Allow dynamically requesting additional memory regions
2:  b18710852 = 2:  2a9ccee9e efi: mm: Extract function to add memory regions
-:  --------- > 3:  ff7e5be9f efi: mm: Pass up errors from `add_memory_regions ()`
3:  f29c60962 ! 4:  a27f5b047 efi: mm: Implement runtime addition of pages
    @@ Commit message
         Signed-off-by: Patrick Steinhardt <ps@pks.im>
     
      ## grub-core/kern/efi/mm.c ##
    -@@ grub-core/kern/efi/mm.c: static void
    +@@ grub-core/kern/efi/mm.c: static grub_err_t
      add_memory_regions (grub_efi_memory_descriptor_t *memory_map,
      		    grub_efi_uintn_t desc_size,
      		    grub_efi_memory_descriptor_t *memory_map_end,
    @@ grub-core/kern/efi/mm.c: print_memory_map (grub_efi_memory_descriptor_t *memory_
        grub_efi_memory_descriptor_t *memory_map_end;
     @@ grub-core/kern/efi/mm.c: grub_efi_mm_add_regions (grub_efi_uint64_t required_bytes)
        /* Allocate memory regions for GRUB's memory management.  */
    -   add_memory_regions (filtered_memory_map, desc_size,
    - 		      filtered_memory_map_end,
    --		      BYTES_TO_PAGES (required_bytes));
    -+		      BYTES_TO_PAGES (required_bytes),
    -+		      flags & GRUB_MM_REGION_CONSECUTIVE);
    +   err = add_memory_regions (filtered_memory_map, desc_size,
    + 			    filtered_memory_map_end,
    +-			    BYTES_TO_PAGES (required_bytes));
    ++			    BYTES_TO_PAGES (required_bytes),
    ++			    flags & GRUB_MM_REGION_CONSECUTIVE);
    +   if (err != GRUB_ERR_NONE)
    +     return err;
      
    - #if 0
    -   /* For debug.  */
     @@ grub-core/kern/efi/mm.c: grub_efi_mm_add_regions (grub_efi_uint64_t required_bytes)
      void
      grub_efi_mm_init (void)
-- 
2.32.0


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

  parent reply	other threads:[~2021-08-08 13:31 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-01 19:34 [RFC PATCH 0/3] Runtime allocation of memory regions Patrick Steinhardt
2020-06-01 19:34 ` [RFC PATCH 1/3] mm: allow dynamically requesting additional " 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 ` Patrick Steinhardt [this message]
2021-08-08 13:31   ` [PATCH v2 1/4] mm: Allow dynamically requesting additional memory regions 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.1628429274.git.ps@pks.im \
    --to=ps@pks.im \
    --cc=dkiper@net-space.pl \
    --cc=grub-devel@gnu.org \
    --cc=leif@nuviainc.com \
    --cc=stefanb@linux.ibm.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.