Commit a9b5f023 authored by Linus Torvalds's avatar Linus Torvalds

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
parents fef36a7a 845ad05e
...@@ -24,10 +24,10 @@ ...@@ -24,10 +24,10 @@
#include <linux/compiler.h> #include <linux/compiler.h>
#ifndef CONFIG_ARM64_64K_PAGES #ifndef CONFIG_ARM64_64K_PAGES
#define THREAD_SIZE_ORDER 1 #define THREAD_SIZE_ORDER 2
#endif #endif
#define THREAD_SIZE 8192 #define THREAD_SIZE 16384
#define THREAD_START_SP (THREAD_SIZE - 16) #define THREAD_START_SP (THREAD_SIZE - 16)
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#define BOOT_CPU_MODE_EL2 (0x0e12b007) #define BOOT_CPU_MODE_EL2 (0x0e12b007)
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
#include <asm/cacheflush.h>
/* /*
* __boot_cpu_mode records what mode CPUs were booted in. * __boot_cpu_mode records what mode CPUs were booted in.
...@@ -36,9 +37,20 @@ extern u32 __boot_cpu_mode[2]; ...@@ -36,9 +37,20 @@ extern u32 __boot_cpu_mode[2];
void __hyp_set_vectors(phys_addr_t phys_vector_base); void __hyp_set_vectors(phys_addr_t phys_vector_base);
phys_addr_t __hyp_get_vectors(void); phys_addr_t __hyp_get_vectors(void);
static inline void sync_boot_mode(void)
{
/*
* As secondaries write to __boot_cpu_mode with caches disabled, we
* must flush the corresponding cache entries to ensure the visibility
* of their writes.
*/
__flush_dcache_area(__boot_cpu_mode, sizeof(__boot_cpu_mode));
}
/* Reports the availability of HYP mode */ /* Reports the availability of HYP mode */
static inline bool is_hyp_mode_available(void) static inline bool is_hyp_mode_available(void)
{ {
sync_boot_mode();
return (__boot_cpu_mode[0] == BOOT_CPU_MODE_EL2 && return (__boot_cpu_mode[0] == BOOT_CPU_MODE_EL2 &&
__boot_cpu_mode[1] == BOOT_CPU_MODE_EL2); __boot_cpu_mode[1] == BOOT_CPU_MODE_EL2);
} }
...@@ -46,6 +58,7 @@ static inline bool is_hyp_mode_available(void) ...@@ -46,6 +58,7 @@ static inline bool is_hyp_mode_available(void)
/* Check if the bootloader has booted CPUs in different modes */ /* Check if the bootloader has booted CPUs in different modes */
static inline bool is_hyp_mode_mismatched(void) static inline bool is_hyp_mode_mismatched(void)
{ {
sync_boot_mode();
return __boot_cpu_mode[0] != __boot_cpu_mode[1]; return __boot_cpu_mode[0] != __boot_cpu_mode[1];
} }
......
...@@ -121,7 +121,7 @@ ...@@ -121,7 +121,7 @@
.macro get_thread_info, rd .macro get_thread_info, rd
mov \rd, sp mov \rd, sp
and \rd, \rd, #~((1 << 13) - 1) // top of 8K stack and \rd, \rd, #~(THREAD_SIZE - 1) // top of stack
.endm .endm
/* /*
......
...@@ -81,7 +81,7 @@ void soft_restart(unsigned long addr) ...@@ -81,7 +81,7 @@ void soft_restart(unsigned long addr)
void (*pm_power_off)(void); void (*pm_power_off)(void);
EXPORT_SYMBOL_GPL(pm_power_off); EXPORT_SYMBOL_GPL(pm_power_off);
void (*arm_pm_restart)(char str, const char *cmd); void (*arm_pm_restart)(enum reboot_mode reboot_mode, const char *cmd);
EXPORT_SYMBOL_GPL(arm_pm_restart); EXPORT_SYMBOL_GPL(arm_pm_restart);
void arch_cpu_idle_prepare(void) void arch_cpu_idle_prepare(void)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment