summaryrefslogtreecommitdiff
path: root/arch/arm/include
diff options
context:
space:
mode:
authorAndre Przywara <andre.przywara@linaro.org>2013-09-19 18:06:45 +0200
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>2013-10-03 21:28:55 +0200
commitd4296887544ddf95808bfb62f312008f519efb7b (patch)
treee06b4b3f187ae101f6c4aa4d6ac8695518d40ab1 /arch/arm/include
parentba6a1698116da272f14c53a3ae41467cb7fc4372 (diff)
downloadu-boot-imx-d4296887544ddf95808bfb62f312008f519efb7b.zip
u-boot-imx-d4296887544ddf95808bfb62f312008f519efb7b.tar.gz
u-boot-imx-d4296887544ddf95808bfb62f312008f519efb7b.tar.bz2
ARM: extend non-secure switch to also go into HYP mode
For the KVM and XEN hypervisors to be usable, we need to enter the kernel in HYP mode. Now that we already are in non-secure state, HYP mode switching is within short reach. While doing the non-secure switch, we have to enable the HVC instruction and setup the HYP mode HVBAR (while still secure). The actual switch is done by dropping back from a HYP mode handler without actually leaving HYP mode, so we introduce a new handler routine in our new secure exception vector table. In the assembly switching routine we save and restore the banked LR and SP registers around the hypercall to do the actual HYP mode switch. The C routine first checks whether we are in HYP mode already and also whether the virtualization extensions are available. It also checks whether the HYP mode switch was finally successful. The bootm command part only calls the new function after the non-secure switch. Signed-off-by: Andre Przywara <andre.przywara@linaro.org>
Diffstat (limited to 'arch/arm/include')
-rw-r--r--arch/arm/include/asm/armv7.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/arm/include/asm/armv7.h b/arch/arm/include/asm/armv7.h
index 2efd4bc..395444e 100644
--- a/arch/arm/include/asm/armv7.h
+++ b/arch/arm/include/asm/armv7.h
@@ -76,14 +76,16 @@ void v7_outer_cache_inval_all(void);
void v7_outer_cache_flush_range(u32 start, u32 end);
void v7_outer_cache_inval_range(u32 start, u32 end);
-#ifdef CONFIG_ARMV7_NONSEC
+#if defined(CONFIG_ARMV7_NONSEC) || defined(CONFIG_ARMV7_VIRT)
int armv7_switch_nonsec(void);
+int armv7_switch_hyp(void);
/* defined in assembly file */
unsigned int _nonsec_init(void);
void _smp_pen(void);
-#endif /* CONFIG_ARMV7_NONSEC */
+void _switch_to_hyp(void);
+#endif /* CONFIG_ARMV7_NONSEC || CONFIG_ARMV7_VIRT */
#endif /* ! __ASSEMBLY__ */