diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-07-26 15:43:59 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-07-26 15:43:59 -0400 |
| commit | a9b5f023947a67d430a4db61a1e2bc7fc258aa72 (patch) | |
| tree | f5d4bb9599257dded11e951da33abea8d39ca056 | |
| parent | fef36a7a31c122270038122752373bd38977dd7f (diff) | |
| parent | 845ad05ec31e0f3872a321e10dbeaf872022632c (diff) | |
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
| -rw-r--r-- | arch/arm64/include/asm/thread_info.h | 4 | ||||
| -rw-r--r-- | arch/arm64/include/asm/virt.h | 13 | ||||
| -rw-r--r-- | arch/arm64/kernel/entry.S | 2 | ||||
| -rw-r--r-- | arch/arm64/kernel/process.c | 2 |
4 files changed, 17 insertions, 4 deletions
diff --git a/arch/arm64/include/asm/thread_info.h b/arch/arm64/include/asm/thread_info.h index 3659e460071d..23a3c4791d86 100644 --- a/arch/arm64/include/asm/thread_info.h +++ b/arch/arm64/include/asm/thread_info.h | |||
| @@ -24,10 +24,10 @@ | |||
| 24 | #include <linux/compiler.h> | 24 | #include <linux/compiler.h> |
| 25 | 25 | ||
| 26 | #ifndef CONFIG_ARM64_64K_PAGES | 26 | #ifndef CONFIG_ARM64_64K_PAGES |
| 27 | #define THREAD_SIZE_ORDER 1 | 27 | #define THREAD_SIZE_ORDER 2 |
| 28 | #endif | 28 | #endif |
| 29 | 29 | ||
| 30 | #define THREAD_SIZE 8192 | 30 | #define THREAD_SIZE 16384 |
| 31 | #define THREAD_START_SP (THREAD_SIZE - 16) | 31 | #define THREAD_START_SP (THREAD_SIZE - 16) |
| 32 | 32 | ||
| 33 | #ifndef __ASSEMBLY__ | 33 | #ifndef __ASSEMBLY__ |
diff --git a/arch/arm64/include/asm/virt.h b/arch/arm64/include/asm/virt.h index 439827271e3d..26e310c54344 100644 --- a/arch/arm64/include/asm/virt.h +++ b/arch/arm64/include/asm/virt.h | |||
| @@ -21,6 +21,7 @@ | |||
| 21 | #define BOOT_CPU_MODE_EL2 (0x0e12b007) | 21 | #define BOOT_CPU_MODE_EL2 (0x0e12b007) |
| 22 | 22 | ||
| 23 | #ifndef __ASSEMBLY__ | 23 | #ifndef __ASSEMBLY__ |
| 24 | #include <asm/cacheflush.h> | ||
| 24 | 25 | ||
| 25 | /* | 26 | /* |
| 26 | * __boot_cpu_mode records what mode CPUs were booted in. | 27 | * __boot_cpu_mode records what mode CPUs were booted in. |
| @@ -36,9 +37,20 @@ extern u32 __boot_cpu_mode[2]; | |||
| 36 | void __hyp_set_vectors(phys_addr_t phys_vector_base); | 37 | void __hyp_set_vectors(phys_addr_t phys_vector_base); |
| 37 | phys_addr_t __hyp_get_vectors(void); | 38 | phys_addr_t __hyp_get_vectors(void); |
| 38 | 39 | ||
| 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 | |||
| 39 | /* Reports the availability of HYP mode */ | 50 | /* Reports the availability of HYP mode */ |
| 40 | static inline bool is_hyp_mode_available(void) | 51 | static inline bool is_hyp_mode_available(void) |
| 41 | { | 52 | { |
| 53 | sync_boot_mode(); | ||
| 42 | return (__boot_cpu_mode[0] == BOOT_CPU_MODE_EL2 && | 54 | return (__boot_cpu_mode[0] == BOOT_CPU_MODE_EL2 && |
| 43 | __boot_cpu_mode[1] == BOOT_CPU_MODE_EL2); | 55 | __boot_cpu_mode[1] == BOOT_CPU_MODE_EL2); |
| 44 | } | 56 | } |
| @@ -46,6 +58,7 @@ static inline bool is_hyp_mode_available(void) | |||
| 46 | /* Check if the bootloader has booted CPUs in different modes */ | 58 | /* Check if the bootloader has booted CPUs in different modes */ |
| 47 | static inline bool is_hyp_mode_mismatched(void) | 59 | static inline bool is_hyp_mode_mismatched(void) |
| 48 | { | 60 | { |
| 61 | sync_boot_mode(); | ||
| 49 | return __boot_cpu_mode[0] != __boot_cpu_mode[1]; | 62 | return __boot_cpu_mode[0] != __boot_cpu_mode[1]; |
| 50 | } | 63 | } |
| 51 | 64 | ||
diff --git a/arch/arm64/kernel/entry.S b/arch/arm64/kernel/entry.S index 1d1314280a03..6ad781b21c08 100644 --- a/arch/arm64/kernel/entry.S +++ b/arch/arm64/kernel/entry.S | |||
| @@ -121,7 +121,7 @@ | |||
| 121 | 121 | ||
| 122 | .macro get_thread_info, rd | 122 | .macro get_thread_info, rd |
| 123 | mov \rd, sp | 123 | mov \rd, sp |
| 124 | and \rd, \rd, #~((1 << 13) - 1) // top of 8K stack | 124 | and \rd, \rd, #~(THREAD_SIZE - 1) // top of stack |
| 125 | .endm | 125 | .endm |
| 126 | 126 | ||
| 127 | /* | 127 | /* |
diff --git a/arch/arm64/kernel/process.c b/arch/arm64/kernel/process.c index 1788bf6b471f..57fb55c44c90 100644 --- a/arch/arm64/kernel/process.c +++ b/arch/arm64/kernel/process.c | |||
| @@ -81,7 +81,7 @@ void soft_restart(unsigned long addr) | |||
| 81 | void (*pm_power_off)(void); | 81 | void (*pm_power_off)(void); |
| 82 | EXPORT_SYMBOL_GPL(pm_power_off); | 82 | EXPORT_SYMBOL_GPL(pm_power_off); |
| 83 | 83 | ||
| 84 | void (*arm_pm_restart)(char str, const char *cmd); | 84 | void (*arm_pm_restart)(enum reboot_mode reboot_mode, const char *cmd); |
| 85 | EXPORT_SYMBOL_GPL(arm_pm_restart); | 85 | EXPORT_SYMBOL_GPL(arm_pm_restart); |
| 86 | 86 | ||
| 87 | void arch_cpu_idle_prepare(void) | 87 | void arch_cpu_idle_prepare(void) |
