]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - arch/x86/mm/pti.c
x86/mm/pti: Introduce pti_finalize()
[mirror_ubuntu-bionic-kernel.git] / arch / x86 / mm / pti.c
index 3b2995c4662c6a8b6a6cd2c0f2a16be0e2db0206..dfc545ced03333eba3b654615ddbc609463426ab 100644 (file)
@@ -463,7 +463,7 @@ static inline bool pti_kernel_image_global_ok(void)
  * For some configurations, map all of kernel text into the user page
  * tables.  This reduces TLB misses, especially on non-PCID systems.
  */
-void pti_clone_kernel_text(void)
+static void pti_clone_kernel_text(void)
 {
        /*
         * rodata is part of the kernel image and is normally
@@ -527,3 +527,15 @@ void __init pti_init(void)
        pti_setup_espfix64();
        pti_setup_vsyscall();
 }
+
+/*
+ * Finalize the kernel mappings in the userspace page-table.
+ */
+void pti_finalize(void)
+{
+       /*
+        * Do this after all of the manipulation of the
+        * kernel text page tables are complete.
+        */
+       pti_clone_kernel_text();
+}