]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - arch/x86/kernel/setup.c
Merge branches 'pm-core', 'pm-qos', 'pm-domains' and 'pm-opp'
[linux.git] / arch / x86 / kernel / setup.c
index 9c337b0e8ba7c4ac5b82a3e4ad979c7d4011b4bf..69780edf0dde90c8c5b04211525dcd1137d73e73 100644 (file)
@@ -985,6 +985,30 @@ void __init setup_arch(char **cmdline_p)
 
        parse_early_param();
 
+#ifdef CONFIG_MEMORY_HOTPLUG
+       /*
+        * Memory used by the kernel cannot be hot-removed because Linux
+        * cannot migrate the kernel pages. When memory hotplug is
+        * enabled, we should prevent memblock from allocating memory
+        * for the kernel.
+        *
+        * ACPI SRAT records all hotpluggable memory ranges. But before
+        * SRAT is parsed, we don't know about it.
+        *
+        * The kernel image is loaded into memory at very early time. We
+        * cannot prevent this anyway. So on NUMA system, we set any
+        * node the kernel resides in as un-hotpluggable.
+        *
+        * Since on modern servers, one node could have double-digit
+        * gigabytes memory, we can assume the memory around the kernel
+        * image is also un-hotpluggable. So before SRAT is parsed, just
+        * allocate memory near the kernel image to try the best to keep
+        * the kernel away from hotpluggable memory.
+        */
+       if (movable_node_is_enabled())
+               memblock_set_bottom_up(true);
+#endif
+
        x86_report_nx();
 
        /* after early param, so could get panic from serial */
@@ -1152,6 +1176,20 @@ void __init setup_arch(char **cmdline_p)
        /* Allocate bigger log buffer */
        setup_log_buf(1);
 
+       if (efi_enabled(EFI_BOOT)) {
+               switch (boot_params.secure_boot) {
+               case efi_secureboot_mode_disabled:
+                       pr_info("Secure boot disabled\n");
+                       break;
+               case efi_secureboot_mode_enabled:
+                       pr_info("Secure boot enabled\n");
+                       break;
+               default:
+                       pr_info("Secure boot could not be determined\n");
+                       break;
+               }
+       }
+
        reserve_initrd();
 
        acpi_table_upgrade();