]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
ARM: 8784/1: NOMMU: Allow enter in Hyp mode
authorVladimir Murzin <vladimir.murzin@arm.com>
Mon, 23 Jul 2018 08:37:09 +0000 (09:37 +0100)
committerRussell King <rmk+kernel@armlinux.org.uk>
Mon, 30 Jul 2018 10:45:52 +0000 (11:45 +0100)
ARMv8R adds support for virtualisation extension (with some deviation
from v8A). With this patch hyp-unaware boot code can offload to kernel
setting up HYP stuff in a sane state.

Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
arch/arm/kernel/head-nommu.S
arch/arm/mm/Kconfig

index dd546d65a3830d819a48fc1463d55d1cc2110c18..724734039492c753f61cf9430065ae18fd5b2b18 100644 (file)
@@ -53,7 +53,11 @@ ENTRY(stext)
  THUMB(1:                      )
 #endif
 
-       setmode PSR_F_BIT | PSR_I_BIT | SVC_MODE, r9 @ ensure svc mode
+#ifdef CONFIG_ARM_VIRT_EXT
+       bl      __hyp_stub_install
+#endif
+       @ ensure svc mode and all interrupts masked
+       safe_svcmode_maskall r9
                                                @ and irqs disabled
 #if defined(CONFIG_CPU_CP15)
        mrc     p15, 0, r9, c0, c0              @ get processor id
@@ -89,7 +93,11 @@ ENTRY(secondary_startup)
         * the processor type - there is no need to check the machine type
         * as it has already been validated by the primary processor.
         */
-       setmode PSR_F_BIT | PSR_I_BIT | SVC_MODE, r9
+#ifdef CONFIG_ARM_VIRT_EXT
+       bl      __hyp_stub_install_secondary
+#endif
+       safe_svcmode_maskall r9
+
 #ifndef CONFIG_CPU_CP15
        ldr     r9, =CONFIG_PROCESSOR_ID
 #else
index 96a7b6cf459bafa658528c9900434ef71a644bd3..b169e580bf8298026c8ae5791193adef3bbef342 100644 (file)
@@ -702,7 +702,6 @@ config ARM_THUMBEE
 
 config ARM_VIRT_EXT
        bool
-       depends on MMU
        default y if CPU_V7
        help
          Enable the kernel to make use of the ARM Virtualization