|
33 | 33 | #define __PAGE_OFFSET __PAGE_OFFSET_BASE |
34 | 34 | #include "../../mm/ident_map.c" |
35 | 35 |
|
36 | | -#ifdef CONFIG_X86_5LEVEL |
37 | | -unsigned int __pgtable_l5_enabled; |
38 | | -unsigned int pgdir_shift = 39; |
39 | | -unsigned int ptrs_per_p4d = 1; |
40 | | -#endif |
| 36 | +#define _SETUP |
| 37 | +#include <asm/setup.h> /* For COMMAND_LINE_SIZE */ |
| 38 | +#undef _SETUP |
| 39 | + |
| 40 | +extern unsigned long get_cmd_line_ptr(void); |
41 | 41 |
|
42 | 42 | /* Used by PAGE_KERN* macros: */ |
43 | 43 | pteval_t __default_kernel_pte_mask __read_mostly = ~0; |
@@ -107,8 +107,10 @@ static void add_identity_map(unsigned long start, unsigned long end) |
107 | 107 | } |
108 | 108 |
|
109 | 109 | /* Locates and clears a region for a new top level page table. */ |
110 | | -void initialize_identity_maps(void) |
| 110 | +void initialize_identity_maps(void *rmode) |
111 | 111 | { |
| 112 | + unsigned long cmdline; |
| 113 | + |
112 | 114 | /* Exclude the encryption mask from __PHYSICAL_MASK */ |
113 | 115 | physical_mask &= ~sme_me_mask; |
114 | 116 |
|
@@ -149,10 +151,19 @@ void initialize_identity_maps(void) |
149 | 151 | } |
150 | 152 |
|
151 | 153 | /* |
152 | | - * New page-table is set up - map the kernel image and load it |
153 | | - * into cr3. |
| 154 | + * New page-table is set up - map the kernel image, boot_params and the |
| 155 | + * command line. The uncompressed kernel requires boot_params and the |
| 156 | + * command line to be mapped in the identity mapping. Map them |
| 157 | + * explicitly here in case the compressed kernel does not touch them, |
| 158 | + * or does not touch all the pages covering them. |
154 | 159 | */ |
155 | 160 | add_identity_map((unsigned long)_head, (unsigned long)_end); |
| 161 | + boot_params = rmode; |
| 162 | + add_identity_map((unsigned long)boot_params, (unsigned long)(boot_params + 1)); |
| 163 | + cmdline = get_cmd_line_ptr(); |
| 164 | + add_identity_map(cmdline, cmdline + COMMAND_LINE_SIZE); |
| 165 | + |
| 166 | + /* Load the new page-table. */ |
156 | 167 | write_cr3(top_level_pgt); |
157 | 168 | } |
158 | 169 |
|
|
0 commit comments