History

Merge tag 'arm64-stable' of git://git.kernel.org/pub/scm/linux/kernel/git/cmarinas/linux-aarch64

Pull arm64 fixes from Catalin Marinas: - Stack size increased to 16K (similar to other 64-bit architectures) - Additional cache flushing for secondary CPUs boot mode * tag 'arm64-stable' of git://git.kernel.org/pub/scm/linux/kernel/git/cmarinas/linux-aarch64: arm64: Change kernel stack size to 16K arm64: Fix definition of arm_pm_restart to match the declaration arm64: virt: ensure visibility of __boot_cpu_mode

Linus Torvalds committed 13 years ago

Commit a9b5f022 parents fef36a7 845ad054 files · +17 −4Browse files

Unified · Split

4 files
  1. arch/arm64/include/asm/thread_info.h +2 −2
  2. arch/arm64/include/asm/virt.h +13 −0
  3. arch/arm64/kernel/entry.S +1 −1
  4. arch/arm64/kernel/process.c +1 −1
arch/arm64/include/asm/thread_info.h+2−2
@@ -24,10 +24,10 @@ · 23 unmodified lines
2424 #include <linux/compiler.h>
2525
2626 #ifndef CONFIG_ARM64_64K_PAGES
27−#define THREAD_SIZE_ORDER 1
27+#define THREAD_SIZE_ORDER 2
2828 #endif
2929
30−#define THREAD_SIZE 8192
30+#define THREAD_SIZE 16384
3131 #define THREAD_START_SP (THREAD_SIZE - 16)
3232
3333 #ifndef __ASSEMBLY__
arch/arm64/include/asm/virt.h+13−0
@@ -21,6 +21,7 @@ · 20 unmodified lines
2121 #define BOOT_CPU_MODE_EL2 (0x0e12b007)
2222
2323 #ifndef __ASSEMBLY__
24+#include <asm/cacheflush.h>
2425
2526 /*
2627 * __boot_cpu_mode records what mode CPUs were booted in.
@@ -36,9 +37,20 @@ extern u32 __boot_cpu_mode[2]; · 9 unmodified lines
3637 void __hyp_set_vectors(phys_addr_t phys_vector_base);
3738 phys_addr_t __hyp_get_vectors(void);
3839
40+static inline void sync_boot_mode(void)
41+{
42+ /*
43+ * As secondaries write to __boot_cpu_mode with caches disabled, we
44+ * must flush the corresponding cache entries to ensure the visibility
45+ * of their writes.
46+ */
47+ __flush_dcache_area(__boot_cpu_mode, sizeof(__boot_cpu_mode));
48+}
49+
3950 /* Reports the availability of HYP mode */
4051 static inline bool is_hyp_mode_available(void)
4152 {
53+ sync_boot_mode();
4254 return (__boot_cpu_mode[0] == BOOT_CPU_MODE_EL2 &&
4355 __boot_cpu_mode[1] == BOOT_CPU_MODE_EL2);
4456 }
@@ -46,6 +58,7 @@ static inline bool is_hyp_mode_available(void) · 1 unmodified line
4658 /* Check if the bootloader has booted CPUs in different modes */
4759 static inline bool is_hyp_mode_mismatched(void)
4860 {
61+ sync_boot_mode();
4962 return __boot_cpu_mode[0] != __boot_cpu_mode[1];
5063 }
5164
arch/arm64/kernel/entry.S+1−1
@@ -121,7 +121,7 @@ · 120 unmodified lines
121121
122122 .macro get_thread_info, rd
123123 mov \rd, sp
124− and \rd, \rd, #~((1 << 13) - 1) // top of 8K stack
124+ and \rd, \rd, #~(THREAD_SIZE - 1) // top of stack
125125 .endm
126126
127127 /*
arch/arm64/kernel/process.c+1−1
@@ -81,7 +81,7 @@ void soft_restart(unsigned long addr) · 80 unmodified lines
8181 void (*pm_power_off)(void);
8282 EXPORT_SYMBOL_GPL(pm_power_off);
8383
84−void (*arm_pm_restart)(char str, const char *cmd);
84+void (*arm_pm_restart)(enum reboot_mode reboot_mode, const char *cmd);
8585 EXPORT_SYMBOL_GPL(arm_pm_restart);
8686
8787 void arch_cpu_idle_prepare(void)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t