Skip to content

ppc64: Restrict memory allocations for kernel and initrd

Stefan Berger grub-devel 7 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v8 Latest10 patches 1 replyIn review
  2. v710 patches 5 repliesSuperseded
  3. v610 patches 5 repliesSuperseded
Earlier versions · 4
VersionPostedPatchesRepliesStatus
v510 patches1 replySuperseded
v410 patches2 repliesSuperseded
v310 patches0 repliesSuperseded
v19 patches16 repliesSuperseded

Changes in v8 from the cover letter

- 8/10: merged Daniel's patch to fix sparc build

Patches in v8 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/10kern/ieee1275/init: ppc64: Introduce a request for regions_claimgrub-core/Makefile.am grub-core/kern/ieee1275/init.c include/grub/ieee1275/alloc.h+66 -100 replies
2/10kern/ieee1275/init: ppc64: Decide by request whether to initialize regiongrub-core/kern/ieee1275/init.c include/grub/ieee1275/alloc.h+7 -10 replies
3/10kern/ieee1275/init: ppc64: Return allocated address using contextgrub-core/kern/ieee1275/init.c include/grub/ieee1275/alloc.h+3 -00 replies
4/10kern/ieee1275/init: ppc64: Add support for alignment requirementsgrub-core/kern/ieee1275/init.c include/grub/ieee1275/alloc.h+15 -00 replies
5/10kern/ieee1275/init: ppc64: Rename regions_claim to grub_regions_claimgrub-core/kern/ieee1275/init.c include/grub/ieee1275/alloc.h+8 -50 replies
6/10kern/ieee1275/cmain: ppc64: Introduce flags to identify KVM and Power VMgrub-core/kern/ieee1275/cmain.c include/grub/ieee1275/ieee1275.h+11 -10 replies
7/10loader/powerpc/ieee1275: Use new allocation function for kernel and initrdgrub-core/loader/powerpc/ieee1275/linux.c+46 -90 replies
8/10kern/ieee1275/ieee1275: debug: Display successful memory claimsgrub-core/kern/ieee1275/ieee1275.c include/grub/powerpc/ieee1275/ieee1275.h include/grub/sparc64/ieee1275/ieee1275.h+9 -00 replies
9/10kern/ieee1275/init: ppc64: Fix a commentgrub-core/kern/ieee1275/init.c+1 -10 replies
10/10kern/ieee1275/init: ppc64: Display upper_mem_limit for debugginggrub-core/kern/ieee1275/init.c+3 -00 replies

Reviews trailers per patch

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

PatchDaniel Kiper
1/10R-b
2/10R-b
3/10R-b
4/10R-b
5/10R-b
6/10R-b
7/10R-b
8/10R-b
9/10
10/10

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

Read the v8 thread

Cover letter [PATCH v8 00/10] ppc64: Restrict memory allocations for kernel and initrd

This series of patches converts the PowerPC ieee1275 memory allocator for kernel and initrd to use the (PowerPC) regions_claim memory allocator that takes into account memory regions that are not allowed to be used, such as the gap between 640MB and 768MB as well as memory regions beyond an address in case an fadump is present. Otherwise those two could be loaded into restricted memory regions and either cause a crash or corruption of the fadump.

I adjusted the kernel and initrd load in loader/powerpc/ieee1275 to use the new memory allocator only on PowerVM and PowerKVM since this code is shared with other platforms, such as old PowerMACs and i386.

Regards,
Stefan

v8:
- 8/10: merged Daniel's patch to fix sparc build

v7:
- 1/10: Move header file to include/grub/ieee1275/alloc.h for ieee1275/i386
- 6/10: Make new #defines available for ieee1275/i386 but set KVM on Power flag only if __powerpc__ is defined

v6:
- 7/10: Report OOM error if initrd could not be loaded

v5:
- Replaced grub with GRUB in commit messages
- Fixed copyright holders in alloc.h

v4:
- Fixed typos in commit messages found by Hari
- Exporting grub_regions_claim() as suggested by Hari

v3:
- Addressed issues raised by Daniel and added his R-B tags
- Added one comment fix patch and one for debugging output
- Removed len return parameter from request struct since unused

Stefan Berger (10):
kern/ieee1275/init: ppc64: Introduce a request for regions_claim kern/ieee1275/init: ppc64: Decide by request whether to initialize
region
kern/ieee1275/init: ppc64: Return allocated address using context kern/ieee1275/init: ppc64: Add support for alignment requirements kern/ieee1275/init: ppc64: Rename regions_claim to grub_regions_claim kern/ieee1275/cmain: ppc64: Introduce flags to identify KVM and Power
VM
loader/powerpc/ieee1275: Use new allocation function for kernel and
initrd
kern/ieee1275/ieee1275: debug: Display successful memory claims kern/ieee1275/init: ppc64: Fix a comment kern/ieee1275/init: ppc64: Display upper_mem_limit for debugging

 grub-core/Makefile.am                     |  2 +
 grub-core/kern/ieee1275/cmain.c           |  8 ++-
 grub-core/kern/ieee1275/ieee1275.c        |  3 +
 grub-core/kern/ieee1275/init.c            | 73 ++++++++++++++++++-----
 grub-core/loader/powerpc/ieee1275/linux.c | 55 ++++++++++++++---
 include/grub/ieee1275/alloc.h             | 39 ++++++++++++
 include/grub/ieee1275/ieee1275.h          |  4 ++
 include/grub/powerpc/ieee1275/ieee1275.h  |  3 +
 include/grub/sparc64/ieee1275/ieee1275.h  |  3 +
 9 files changed, 166 insertions(+), 24 deletions(-)
 create mode 100644 include/grub/ieee1275/alloc.h
Signature · 7 lines
2.43.0


_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel