summaryrefslogtreecommitdiffstats
path: root/meta-agl-devel/meta-agl-jailhouse/recipes-kernel/linux/linux/0004-arm-Export-__boot_cpu_mode-for-use-in-Jailhouse-driv.patch
blob: 6e4470f0b9341db2104a7f9783e46c03da986dc1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
From 56e5aace5a675af0557b87a137b98e40454d8e22 Mon Sep 17 00:00:00 2001
From: Jan Kiszka <jan.kiszka@siemens.com>
Date: Sun, 3 Jul 2016 10:02:40 +0200
Subject: [PATCH 04/32] arm: Export __boot_cpu_mode for use in Jailhouse driver
 module

Onlining a CPU while Jailhouse was running sets BOOT_CPU_MODE_MISMATCH
because the kernel detect that the CPU will now only come up in SVC
mode. Therefore, we need to fix up the flag after disabling Jailhouse
again.

Moreover, exporting the symbol allows to use is_hyp_mode_available() in
the driver, thus prevents us from crashing during Jailhouse activation
when there is no hyp stub installed.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 arch/arm/kernel/armksyms.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/arm/kernel/armksyms.c b/arch/arm/kernel/armksyms.c
index 98bdea51089d..f2fa635bccf7 100644
--- a/arch/arm/kernel/armksyms.c
+++ b/arch/arm/kernel/armksyms.c
@@ -17,6 +17,7 @@
 
 #include <asm/checksum.h>
 #include <asm/ftrace.h>
+#include <asm/virt.h>
 
 /*
  * libgcc functions - functions that are used internally by the
@@ -176,3 +177,7 @@ EXPORT_SYMBOL(__pv_offset);
 EXPORT_SYMBOL(__arm_smccc_smc);
 EXPORT_SYMBOL(__arm_smccc_hvc);
 #endif
+
+#ifdef CONFIG_ARM_VIRT_EXT
+EXPORT_SYMBOL_GPL(__boot_cpu_mode);
+#endif
-- 
2.11.0