]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - arch/x86/include/asm/pgtable_64_types.h
x86/pgtable: Move two more functions from pgtable_64.h to pgtable.h
[mirror_ubuntu-bionic-kernel.git] / arch / x86 / include / asm / pgtable_64_types.h
index b97a539bcdeee8ca47e39e7353b3e9d1757da24b..e57003a3f58a637760d8eb2bf262190a52d2cd50 100644 (file)
@@ -75,7 +75,13 @@ typedef struct { pteval_t pte; } pte_t;
 #define PGDIR_SIZE     (_AC(1, UL) << PGDIR_SHIFT)
 #define PGDIR_MASK     (~(PGDIR_SIZE - 1))
 
-/* See Documentation/x86/x86_64/mm.txt for a description of the memory map. */
+/*
+ * See Documentation/x86/x86_64/mm.txt for a description of the memory map.
+ *
+ * Be very careful vs. KASLR when changing anything here. The KASLR address
+ * range must not overlap with anything except the KASAN shadow area, which
+ * is correct as KASAN disables KASLR.
+ */
 #define MAXMEM                 _AC(__AC(1, UL) << MAX_PHYSMEM_BITS, UL)
 
 #ifdef CONFIG_X86_5LEVEL
@@ -88,7 +94,7 @@ typedef struct { pteval_t pte; } pte_t;
 # define VMALLOC_SIZE_TB       _AC(32, UL)
 # define __VMALLOC_BASE                _AC(0xffffc90000000000, UL)
 # define __VMEMMAP_BASE                _AC(0xffffea0000000000, UL)
-# define LDT_PGD_ENTRY         _AC(-4, UL)
+# define LDT_PGD_ENTRY         _AC(-3, UL)
 # define LDT_BASE_ADDR         (LDT_PGD_ENTRY << PGDIR_SHIFT)
 #endif
 
@@ -104,13 +110,13 @@ typedef struct { pteval_t pte; } pte_t;
 
 #define MODULES_VADDR          (__START_KERNEL_map + KERNEL_IMAGE_SIZE)
 /* The module sections ends with the start of the fixmap */
-#define MODULES_END            __fix_to_virt(__end_of_fixed_addresses + 1)
+#define MODULES_END            _AC(0xffffffffff000000, UL)
 #define MODULES_LEN            (MODULES_END - MODULES_VADDR)
 
 #define ESPFIX_PGD_ENTRY       _AC(-2, UL)
 #define ESPFIX_BASE_ADDR       (ESPFIX_PGD_ENTRY << P4D_SHIFT)
 
-#define CPU_ENTRY_AREA_PGD     _AC(-3, UL)
+#define CPU_ENTRY_AREA_PGD     _AC(-4, UL)
 #define CPU_ENTRY_AREA_BASE    (CPU_ENTRY_AREA_PGD << P4D_SHIFT)
 
 #define EFI_VA_START           ( -4 * (_AC(1, UL) << 30))
@@ -118,4 +124,6 @@ typedef struct { pteval_t pte; } pte_t;
 
 #define EARLY_DYNAMIC_PAGE_TABLES      64
 
+#define PGD_KERNEL_START       ((PAGE_SIZE / 2) / sizeof(pgd_t))
+
 #endif /* _ASM_X86_PGTABLE_64_DEFS_H */