Skip to content

Commit

Permalink
Merge tag 'arm64-stable' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/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
  • Loading branch information
torvalds committed Jul 26, 2013
2 parents fef36a7 + 845ad05 commit a9b5f02
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 4 deletions.
4 changes: 2 additions & 2 deletions arch/arm64/include/asm/thread_info.h
Expand Up @@ -24,10 +24,10 @@
#include <linux/compiler.h>

#ifndef CONFIG_ARM64_64K_PAGES
#define THREAD_SIZE_ORDER 1
#define THREAD_SIZE_ORDER 2
#endif

#define THREAD_SIZE 8192
#define THREAD_SIZE 16384
#define THREAD_START_SP (THREAD_SIZE - 16)

#ifndef __ASSEMBLY__
Expand Down
13 changes: 13 additions & 0 deletions arch/arm64/include/asm/virt.h
Expand Up @@ -21,6 +21,7 @@
#define BOOT_CPU_MODE_EL2 (0x0e12b007)

#ifndef __ASSEMBLY__
#include <asm/cacheflush.h>

/*
* __boot_cpu_mode records what mode CPUs were booted in.
Expand All @@ -36,16 +37,28 @@ extern u32 __boot_cpu_mode[2];
void __hyp_set_vectors(phys_addr_t phys_vector_base);
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 */
static inline bool is_hyp_mode_available(void)
{
sync_boot_mode();
return (__boot_cpu_mode[0] == BOOT_CPU_MODE_EL2 &&
__boot_cpu_mode[1] == BOOT_CPU_MODE_EL2);
}

/* Check if the bootloader has booted CPUs in different modes */
static inline bool is_hyp_mode_mismatched(void)
{
sync_boot_mode();
return __boot_cpu_mode[0] != __boot_cpu_mode[1];
}

Expand Down
2 changes: 1 addition & 1 deletion arch/arm64/kernel/entry.S
Expand Up @@ -121,7 +121,7 @@

.macro get_thread_info, rd
mov \rd, sp
and \rd, \rd, #~((1 << 13) - 1) // top of 8K stack
and \rd, \rd, #~(THREAD_SIZE - 1) // top of stack
.endm

/*
Expand Down
2 changes: 1 addition & 1 deletion arch/arm64/kernel/process.c
Expand Up @@ -81,7 +81,7 @@ void soft_restart(unsigned long addr)
void (*pm_power_off)(void);
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);

void arch_cpu_idle_prepare(void)
Expand Down

0 comments on commit a9b5f02

Please sign in to comment.