File tree Expand file tree Collapse file tree 3 files changed +19
-1
lines changed Expand file tree Collapse file tree 3 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -729,6 +729,18 @@ extern int direct_gbpages;
729
729
void init_mem_mapping (void );
730
730
void early_alloc_pgt_buf (void );
731
731
732
+ #ifdef CONFIG_X86_64
733
+ /* Realmode trampoline initialization. */
734
+ extern pgd_t trampoline_pgd_entry ;
735
+ static inline void __meminit init_trampoline (void )
736
+ {
737
+ /* Default trampoline pgd value */
738
+ trampoline_pgd_entry = init_level4_pgt [pgd_index (__PAGE_OFFSET )];
739
+ }
740
+ #else
741
+ static inline void init_trampoline (void ) { }
742
+ #endif
743
+
732
744
/* local pte updates need not use xchg for locking */
733
745
static inline pte_t native_local_ptep_get_and_clear (pte_t * ptep )
734
746
{
Original file line number Diff line number Diff line change @@ -590,6 +590,9 @@ void __init init_mem_mapping(void)
590
590
/* the ISA range is always mapped regardless of memory holes */
591
591
init_memory_mapping (0 , ISA_END_ADDRESS );
592
592
593
+ /* Init the trampoline, possibly with KASLR memory offset */
594
+ init_trampoline ();
595
+
593
596
/*
594
597
* If the allocation is in bottom-up direction, we setup direct mapping
595
598
* in bottom-up, otherwise we setup direct mapping in top-down.
Original file line number Diff line number Diff line change 8
8
struct real_mode_header * real_mode_header ;
9
9
u32 * trampoline_cr4_features ;
10
10
11
+ /* Hold the pgd entry used on booting additional CPUs */
12
+ pgd_t trampoline_pgd_entry ;
13
+
11
14
void __init reserve_real_mode (void )
12
15
{
13
16
phys_addr_t mem ;
@@ -84,7 +87,7 @@ void __init setup_real_mode(void)
84
87
* trampoline_cr4_features = __read_cr4 ();
85
88
86
89
trampoline_pgd = (u64 * ) __va (real_mode_header -> trampoline_pgd );
87
- trampoline_pgd [0 ] = init_level4_pgt [ pgd_index ( __PAGE_OFFSET )] .pgd ;
90
+ trampoline_pgd [0 ] = trampoline_pgd_entry .pgd ;
88
91
trampoline_pgd [511 ] = init_level4_pgt [511 ].pgd ;
89
92
#endif
90
93
}
You can’t perform that action at this time.
0 commit comments