OSDN Git Service

arm64: Use a variable to store non-global mappings decision
[tomoyo/tomoyo-test1.git] / arch / arm64 / kernel / setup.c
index 56f6645..b6f9455 100644 (file)
@@ -285,6 +285,13 @@ void __init setup_arch(char **cmdline_p)
 
        *cmdline_p = boot_command_line;
 
+       /*
+        * If know now we are going to need KPTI then use non-global
+        * mappings from the start, avoiding the cost of rewriting
+        * everything later.
+        */
+       arm64_use_ng_mappings = kaslr_requires_kpti();
+
        early_fixmap_init();
        early_ioremap_init();