Skip to content

Dynamic allocation of memory regions and IBM vTPM v2

Daniel Axtens grub-devel 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest15 patches 4 repliesIn review
  2. v215 patches 14 repliesSuperseded

Changes in v3 from the cover letter

- A fix to patch 11 that does IBM CAS, as it turns out my old approach caused some more extreme configurations to fail to boot. Oops.
- Code style fixes (tabs vs spaces).
- Add Daniel's R-Bs.

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/15grub-shell: only pass SeaBIOS fw_opt in for x86 BIOS platformstests/util/grub-shell.in+5 -10 replies
2/15mm: assert that we preserve header vs region alignmentinclude/grub/mm_private.h+14 -00 replies
3/15mm: when adding a region, merge with region after as well as beforegrub-core/kern/mm.c include/grub/mm_private.h+85 -470 replies
4/15mm: debug support for region operationsgrub-core/kern/mm.c+16 -30 replies
5/15mm: Drop unused unloading of modules on OOMgrub-core/kern/dl.c grub-core/kern/mm.c include/grub/dl.h+0 -290 replies
6/15mm: Allow dynamically requesting additional memory regionsgrub-core/kern/mm.c include/grub/mm.h+46 -02 replies
7/15efi: mm: Always request a fixed number of pages on initgrub-core/kern/efi/mm.c+3 -320 replies
8/15efi: mm: Extract function to add memory regionsgrub-core/kern/efi/mm.c+15 -60 replies
9/15efi: mm: Pass up errors from `add_memory_regions ()`grub-core/kern/efi/mm.c+15 -70 replies
10/15efi: mm: Implement runtime addition of pagesgrub-core/kern/efi/mm.c+11 -40 replies
11/15ieee1275: request memory with ibm, client-architecture-supportgrub-core/kern/ieee1275/cmain.c grub-core/kern/ieee1275/init.c include/grub/ieee1275/ieee1275.h+163 -02 replies
12/15ieee1275: drop len -= 1 quirk in heap_initgrub-core/kern/ieee1275/init.c+0 -10 replies
13/15ieee1275: support runtime memory claimingdocs/grub-dev.texi grub-core/kern/ieee1275/init.c+254 -200 replies
14/15Add memtool module with memory allocation stress-testgrub-core/Makefile.core.def grub-core/commands/memtools.c grub-core/kern/mm.c+164 -00 replies
15/15ibmvtpm: Add support for trusted boot using a vTPM 2.0docs/grub.texi grub-core/Makefile.core.def grub-core/commands/ieee1275/ibmvtpm.c +1 more+164 -10 replies

Reviews trailers per patch

10 of 15 patches have a Reviewed-by or Acked-by.

PatchDaniel KiperStefan Berger
1/15R-b
2/15R-b
3/15R-b T-b
4/15R-b
5/15R-b
6/15R-b T-b
7/15R-b
8/15R-b
9/15R-b
10/15R-b
11/15
12/15
13/15T-b
14/15
15/15

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 00/15] Dynamic allocation of memory regions and IBM vTPM v2

Hi,

This is a small update to v2
(https://lists.gnu.org/archive/html/grub-devel/2022-03/msg00242.html)

Changes since v2:

- A fix to patch 11 that does IBM CAS, as it turns out my old approach caused some more extreme configurations to fail to boot. Oops.
- Code style fixes (tabs vs spaces).
- Add Daniel's R-Bs.

This series is also available on github.com/daxtens/grub branch memrework+vtpm-202204

The v2 cover letter:

This is, at long last, an updated version of my series extending Patrick's dynamic memory regions to ieee1275.

Noteworthy changes:

- reworked debug prints as grub_dprintfs. Folded the ieee1275 ones into the ieee1275 patches.

- reworked the ieee1275 runtime memory claiming to be more resilient and better documented.

- fixed comment style and hopefully addressed all other change requests.

- grub will now try asking for contiguous memory and then, if that fails, for discontiguous memory - in case region merging with the discontiguous memory is sufficient to allow the eventual allocation to succeed.

- The ieee1275 code agressively rounds up the size of the region for a dynamic allocation - it will now retry with a more precise size if the larger allocation fails.

The memtool module is included as an RFC only and will require more work, as discussed in the patch.

I've also included Stefan's vTPM patch - Stefan kindly tested that his patch worked with my memory rework series. I have added his tested-by to relevant Power-specific patches only.

Kind regards,
Daniel

Daniel Axtens (8):
grub-shell: only pass SeaBIOS fw_opt in for x86 BIOS platforms
mm: assert that we preserve header vs region alignment
mm: when adding a region, merge with region after as well as before
mm: debug support for region operations
ieee1275: request memory with ibm,client-architecture-support
ieee1275: drop len -= 1 quirk in heap_init
ieee1275: support runtime memory claiming
[RFC] Add memtool module with memory allocation stress-test

Patrick Steinhardt (6):
mm: Drop unused unloading of modules on OOM
mm: Allow dynamically requesting additional memory regions
efi: mm: Always request a fixed number of pages on init
efi: mm: Extract function to add memory regions
efi: mm: Pass up errors from add_memory_regions ()
efi: mm: Implement runtime addition of pages

Stefan Berger (1):
ibmvtpm: Add support for trusted boot using a vTPM 2.0

 docs/grub-dev.texi                    |   7 +-
 docs/grub.texi                        |   3 +-
 grub-core/Makefile.core.def           |  12 +
 grub-core/commands/ieee1275/ibmvtpm.c | 152 ++++++++++
 grub-core/commands/memtools.c         | 155 ++++++++++
 grub-core/kern/dl.c                   |  20 --
 grub-core/kern/efi/mm.c               |  83 +++---
 grub-core/kern/ieee1275/cmain.c       |   3 +
 grub-core/kern/ieee1275/init.c        | 410 +++++++++++++++++++++++++-
 grub-core/kern/mm.c                   | 178 +++++++----
 include/grub/dl.h                     |   1 -
 include/grub/ieee1275/ieee1275.h      |  11 +
 include/grub/mm.h                     |  16 +
 include/grub/mm_private.h             |  23 ++
 tests/util/grub-shell.in              |   6 +-
 15 files changed, 942 insertions(+), 138 deletions(-)
 create mode 100644 grub-core/commands/ieee1275/ibmvtpm.c
 create mode 100644 grub-core/commands/memtools.c
Signature · 1 line
2.32.0