]> Pileus Git - ~andy/linux/blobdiff - arch/arm/kernel/setup.c
Merge branch 'fixes' into for-linus
[~andy/linux] / arch / arm / kernel / setup.c
index febafa0f552d6a75e2bc51755054a8b6e68cf5a8..da1d1aa20ad957ccd7021815014d12530de4f3a1 100644 (file)
@@ -53,6 +53,7 @@
 #include <asm/traps.h>
 #include <asm/unwind.h>
 #include <asm/memblock.h>
+#include <asm/virt.h>
 
 #include "atags.h"
 #include "tcm.h"
@@ -703,6 +704,21 @@ static int __init meminfo_cmp(const void *_a, const void *_b)
        return cmp < 0 ? -1 : cmp > 0 ? 1 : 0;
 }
 
+void __init hyp_mode_check(void)
+{
+#ifdef CONFIG_ARM_VIRT_EXT
+       if (is_hyp_mode_available()) {
+               pr_info("CPU: All CPU(s) started in HYP mode.\n");
+               pr_info("CPU: Virtualization extensions available.\n");
+       } else if (is_hyp_mode_mismatched()) {
+               pr_warn("CPU: WARNING: CPU(s) started in wrong/inconsistent modes (primary CPU mode 0x%x)\n",
+                       __boot_cpu_mode & MODE_MASK);
+               pr_warn("CPU: This may indicate a broken bootloader or firmware.\n");
+       } else
+               pr_info("CPU: All CPU(s) started in SVC mode.\n");
+#endif
+}
+
 void __init setup_arch(char **cmdline_p)
 {
        struct machine_desc *mdesc;
@@ -748,6 +764,10 @@ void __init setup_arch(char **cmdline_p)
                smp_init_cpus();
        }
 #endif
+
+       if (!is_smp())
+               hyp_mode_check();
+
        reserve_crashkernel();
 
        tcm_init();