x86/realmode: Add comment for Global bit usage in trampoline_pgd
authorJoerg Roedel <jroedel@suse.de>
Thu, 2 Dec 2021 15:32:23 +0000 (16:32 +0100)
committerBorislav Petkov <bp@suse.de>
Sat, 4 Dec 2021 12:50:08 +0000 (13:50 +0100)
Document the fact that using the trampoline_pgd will result in the
creation of global TLB entries in the user range of the address
space.

Signed-off-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Borislav Petkov <bp@suse.de>
Link: https://lkml.kernel.org/r/20211202153226.22946-2-joro@8bytes.org
arch/x86/mm/init.c

index 1895986..4ba024d 100644 (file)
@@ -714,6 +714,11 @@ static void __init memory_map_bottom_up(unsigned long map_start,
 static void __init init_trampoline(void)
 {
 #ifdef CONFIG_X86_64
+       /*
+        * The code below will alias kernel page-tables in the user-range of the
+        * address space, including the Global bit. So global TLB entries will
+        * be created when using the trampoline page-table.
+        */
        if (!kaslr_memory_enabled())
                trampoline_pgd_entry = init_top_pgt[pgd_index(__PAGE_OFFSET)];
        else