grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v2 0/4] Runtime allocation of memory regions


From: Patrick Steinhardt
Subject: [PATCH v2 0/4] Runtime allocation of memory regions
Date: Sun, 8 Aug 2021 15:31:37 +0200

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: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]