diff options
Diffstat (limited to 'arch/arm64/include/asm/virt.h')
-rw-r--r-- | arch/arm64/include/asm/virt.h | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/arch/arm64/include/asm/virt.h b/arch/arm64/include/asm/virt.h index 130e2be952cf..215ad4649dd7 100644 --- a/arch/arm64/include/asm/virt.h +++ b/arch/arm64/include/asm/virt.h | |||
@@ -22,7 +22,6 @@ | |||
22 | #define BOOT_CPU_MODE_EL2 (0xe12) | 22 | #define BOOT_CPU_MODE_EL2 (0xe12) |
23 | 23 | ||
24 | #ifndef __ASSEMBLY__ | 24 | #ifndef __ASSEMBLY__ |
25 | #include <asm/cacheflush.h> | ||
26 | 25 | ||
27 | /* | 26 | /* |
28 | * __boot_cpu_mode records what mode CPUs were booted in. | 27 | * __boot_cpu_mode records what mode CPUs were booted in. |
@@ -38,20 +37,9 @@ extern u32 __boot_cpu_mode[2]; | |||
38 | void __hyp_set_vectors(phys_addr_t phys_vector_base); | 37 | void __hyp_set_vectors(phys_addr_t phys_vector_base); |
39 | phys_addr_t __hyp_get_vectors(void); | 38 | phys_addr_t __hyp_get_vectors(void); |
40 | 39 | ||
41 | static inline void sync_boot_mode(void) | ||
42 | { | ||
43 | /* | ||
44 | * As secondaries write to __boot_cpu_mode with caches disabled, we | ||
45 | * must flush the corresponding cache entries to ensure the visibility | ||
46 | * of their writes. | ||
47 | */ | ||
48 | __flush_dcache_area(__boot_cpu_mode, sizeof(__boot_cpu_mode)); | ||
49 | } | ||
50 | |||
51 | /* Reports the availability of HYP mode */ | 40 | /* Reports the availability of HYP mode */ |
52 | static inline bool is_hyp_mode_available(void) | 41 | static inline bool is_hyp_mode_available(void) |
53 | { | 42 | { |
54 | sync_boot_mode(); | ||
55 | return (__boot_cpu_mode[0] == BOOT_CPU_MODE_EL2 && | 43 | return (__boot_cpu_mode[0] == BOOT_CPU_MODE_EL2 && |
56 | __boot_cpu_mode[1] == BOOT_CPU_MODE_EL2); | 44 | __boot_cpu_mode[1] == BOOT_CPU_MODE_EL2); |
57 | } | 45 | } |
@@ -59,7 +47,6 @@ static inline bool is_hyp_mode_available(void) | |||
59 | /* Check if the bootloader has booted CPUs in different modes */ | 47 | /* Check if the bootloader has booted CPUs in different modes */ |
60 | static inline bool is_hyp_mode_mismatched(void) | 48 | static inline bool is_hyp_mode_mismatched(void) |
61 | { | 49 | { |
62 | sync_boot_mode(); | ||
63 | return __boot_cpu_mode[0] != __boot_cpu_mode[1]; | 50 | return __boot_cpu_mode[0] != __boot_cpu_mode[1]; |
64 | } | 51 | } |
65 | 52 | ||