[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 0/8] ppc64: Restrict memory allocations for kernel and initrd
From: |
Stefan Berger |
Subject: |
[PATCH 0/8] ppc64: Restrict memory allocations for kernel and initrd |
Date: |
Fri, 27 Oct 2023 10:14:03 -0400 |
This series of patches converts the memory allocator for kernel and initrd
to use the ppc64 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 upper address in case
an fadump is present. Otherwise those two could be loaded into those
forbidden 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. I am not aware of which other platforms besides
PowerVM and PowerKVM, if any, may be using this code and so I did not
touch the functions loading 32 bit kernels, which the targeted platform does
not typically use.
The last patch is for viewing where the memory allocations are going and
is not to be applied, of course.
Regards,
Stefan
Stefan Berger (8):
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 and len using
context
kern/ieee1275/init: ppc64: Check early for sufficiently large chunk
kern/ieee1275/init: ppc64: Add support for alignment requirements
kern/ieee1275/init: ppc64: Implement alloc_mem_restricted
loader/powerpc/ieee1275: Use new allocation function for kernel and
initrd
debug: Display successful memory claims
grub-core/Makefile.am | 1 +
grub-core/kern/ieee1275/ieee1275.c | 1 +
grub-core/kern/ieee1275/init.c | 72 +++++++++++++++++++----
grub-core/loader/powerpc/ieee1275/linux.c | 24 ++++++--
include/grub/powerpc/ieee1275/alloc.h | 20 +++++++
5 files changed, 102 insertions(+), 16 deletions(-)
create mode 100644 include/grub/powerpc/ieee1275/alloc.h
--
2.25.1
- [PATCH 0/8] ppc64: Restrict memory allocations for kernel and initrd,
Stefan Berger <=
- [PATCH 6/8] kern/ieee1275/init: ppc64: Implement alloc_mem_restricted, Stefan Berger, 2023/10/27
- [PATCH 8/8] debug: Display successful memory claims, Stefan Berger, 2023/10/27
- [PATCH 7/8] loader/powerpc/ieee1275: Use new allocation function for kernel and initrd, Stefan Berger, 2023/10/27
- [PATCH 2/8] kern/ieee1275/init: ppc64: Decide by request whether to initialize region, Stefan Berger, 2023/10/27
- [PATCH 1/8] kern/ieee1275/init: ppc64: Introduce a request for regions_claim, Stefan Berger, 2023/10/27
- [PATCH 3/8] kern/ieee1275/init: ppc64: Return allocated address and len using context, Stefan Berger, 2023/10/27
- [PATCH 4/8] kern/ieee1275/init: ppc64: Check early for sufficiently large chunk, Stefan Berger, 2023/10/27
- [PATCH 5/8] kern/ieee1275/init: ppc64: Add support for alignment requirements, Stefan Berger, 2023/10/27