diff options
| author | Jakub Kicinski <kuba@kernel.org> | 2021-12-09 12:04:19 -0800 |
|---|---|---|
| committer | Jakub Kicinski <kuba@kernel.org> | 2021-12-09 13:23:02 -0800 |
| commit | 3150a73366b64e3109f0facbc98bcacbc14e81ba (patch) | |
| tree | 2b94b32c5fe97a4e76058a6f65e8c5717b53ee16 /arch/x86/realmode/init.c | |
| parent | 1a2fb220edca98d18f90e3ef5bd6853a6b22b1b8 (diff) | |
| parent | ded746bfc94398d2ee9de315a187677b207b2004 (diff) | |
| download | linux-3150a73366b64e3109f0facbc98bcacbc14e81ba.tar.gz linux-3150a73366b64e3109f0facbc98bcacbc14e81ba.tar.bz2 linux-3150a73366b64e3109f0facbc98bcacbc14e81ba.zip | |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
No conflicts.
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'arch/x86/realmode/init.c')
| -rw-r--r-- | arch/x86/realmode/init.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/arch/x86/realmode/init.c b/arch/x86/realmode/init.c index 4a3da7592b99..38d24d2ab38b 100644 --- a/arch/x86/realmode/init.c +++ b/arch/x86/realmode/init.c @@ -72,6 +72,7 @@ static void __init setup_real_mode(void) #ifdef CONFIG_X86_64 u64 *trampoline_pgd; u64 efer; + int i; #endif base = (unsigned char *)real_mode_header; @@ -128,8 +129,17 @@ static void __init setup_real_mode(void) trampoline_header->flags = 0; trampoline_pgd = (u64 *) __va(real_mode_header->trampoline_pgd); + + /* Map the real mode stub as virtual == physical */ trampoline_pgd[0] = trampoline_pgd_entry.pgd; - trampoline_pgd[511] = init_top_pgt[511].pgd; + + /* + * Include the entirety of the kernel mapping into the trampoline + * PGD. This way, all mappings present in the normal kernel page + * tables are usable while running on trampoline_pgd. + */ + for (i = pgd_index(__PAGE_OFFSET); i < PTRS_PER_PGD; i++) + trampoline_pgd[i] = init_top_pgt[i].pgd; #endif sme_sev_setup_real_mode(trampoline_header); |
