Revert "Revert "Revert "Revert "x86/mm: Identify the end of the kernel area to be reserved""""

This reverts commit e78f95acac.

This adds back the original
commit c603a309cc ("x86/mm: Identify the end of the kernel area to be reserved")

Bug: 138463564
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
Change-Id: Ia01a9b914beebf392a670f8b8238ebceeb361a1d
This commit is contained in:
Nick Desaulniers
2019-08-07 15:27:33 -07:00
committed by Alistair Delva
parent 7a5e47a1a8
commit 9d6c0b6fbb
3 changed files with 17 additions and 2 deletions
+2
View File
@@ -13,4 +13,6 @@ extern char __end_rodata_aligned[];
extern char __end_rodata_hpage_align[];
#endif
extern char __end_of_kernel_reserve[];
#endif /* _ASM_X86_SECTIONS_H */
+7 -1
View File
@@ -836,8 +836,14 @@ dump_kernel_offset(struct notifier_block *self, unsigned long v, void *p)
void __init setup_arch(char **cmdline_p)
{
/*
* Reserve the memory occupied by the kernel between _text and
* __end_of_kernel_reserve symbols. Any kernel sections after the
* __end_of_kernel_reserve symbol must be explicitly reserved with a
* separate memblock_reserve() or they will be discarded.
*/
memblock_reserve(__pa_symbol(_text),
(unsigned long)__bss_stop - (unsigned long)_text);
(unsigned long)__end_of_kernel_reserve - (unsigned long)_text);
/*
* Make sure page 0 is always reserved because on systems with
+8 -1
View File
@@ -368,6 +368,14 @@ SECTIONS
__bss_stop = .;
}
/*
* The memory occupied from _text to here, __end_of_kernel_reserve, is
* automatically reserved in setup_arch(). Anything after here must be
* explicitly reserved using memblock_reserve() or it will be discarded
* and treated as available memory.
*/
__end_of_kernel_reserve = .;
. = ALIGN(PAGE_SIZE);
.brk : AT(ADDR(.brk) - LOAD_OFFSET) {
__brk_base = .;
@@ -407,7 +415,6 @@ SECTIONS
STABS_DEBUG
DWARF_DEBUG
/* Sections to be discarded */
DISCARDS
/DISCARD/ : {
*(.eh_frame)