mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-25 13:11:53 +07:00
a7f8de168a
This relaxes the kernel Image placement requirements, so that it may be placed at any 2 MB aligned offset in physical memory. This is accomplished by ignoring PHYS_OFFSET when installing memblocks, and accounting for the apparent virtual offset of the kernel Image. As a result, virtual address references below PAGE_OFFSET are correctly mapped onto physical references into the kernel Image regardless of where it sits in memory. Special care needs to be taken for dealing with memory limits passed via mem=, since the generic implementation clips memory top down, which may clip the kernel image itself if it is loaded high up in memory. To deal with this case, we simply add back the memory covering the kernel image, which may result in more memory to be retained than was passed as a mem= parameter. Since mem= should not be considered a production feature, a panic notifier handler is installed that dumps the memory limit at panic time if one was set. Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
21 lines
345 B
C
21 lines
345 B
C
|
|
#ifndef __ASM_BOOT_H
|
|
#define __ASM_BOOT_H
|
|
|
|
#include <asm/sizes.h>
|
|
|
|
/*
|
|
* arm64 requires the DTB to be 8 byte aligned and
|
|
* not exceed 2MB in size.
|
|
*/
|
|
#define MIN_FDT_ALIGN 8
|
|
#define MAX_FDT_SIZE SZ_2M
|
|
|
|
/*
|
|
* arm64 requires the kernel image to placed
|
|
* TEXT_OFFSET bytes beyond a 2 MB aligned base
|
|
*/
|
|
#define MIN_KIMG_ALIGN SZ_2M
|
|
|
|
#endif
|