diff options
author | Geoff Levand <geoff@infradead.org> | 2016-06-23 13:54:48 -0400 |
---|---|---|
committer | Catalin Marinas <catalin.marinas@arm.com> | 2016-06-27 11:31:25 -0400 |
commit | f9076ecfb1216a478312b1c078d04792df6d4477 (patch) | |
tree | 824d82ef044ea476fe23416b2d17e6481d6d060c /arch/arm64/kernel/cpu-reset.h | |
parent | b69e0dc14ce3c4abbd11725ff98a885d4616f9fe (diff) |
arm64: Add back cpu reset routines
Commit 68234df4ea79 ("arm64: kill flush_cache_all()") removed the global
arm64 routines cpu_reset() and cpu_soft_restart() needed by the arm64
kexec and kdump support. Add back a simplified version of
cpu_soft_restart() with some changes needed for kexec in the new files
cpu_reset.S, and cpu_reset.h.
When a CPU is reset it needs to be put into the exception level it had when
it entered the kernel. Update cpu_soft_restart() to accept an argument
which signals if the reset address should be entered at EL1 or EL2, and
add a new hypercall HVC_SOFT_RESTART which is used for the EL2 switch.
Signed-off-by: Geoff Levand <geoff@infradead.org>
Reviewed-by: James Morse <james.morse@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'arch/arm64/kernel/cpu-reset.h')
-rw-r--r-- | arch/arm64/kernel/cpu-reset.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/arch/arm64/kernel/cpu-reset.h b/arch/arm64/kernel/cpu-reset.h new file mode 100644 index 000000000000..d4e9ecb264f0 --- /dev/null +++ b/arch/arm64/kernel/cpu-reset.h | |||
@@ -0,0 +1,34 @@ | |||
1 | /* | ||
2 | * CPU reset routines | ||
3 | * | ||
4 | * Copyright (C) 2015 Huawei Futurewei Technologies. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | */ | ||
10 | |||
11 | #ifndef _ARM64_CPU_RESET_H | ||
12 | #define _ARM64_CPU_RESET_H | ||
13 | |||
14 | #include <asm/virt.h> | ||
15 | |||
16 | void __cpu_soft_restart(unsigned long el2_switch, unsigned long entry, | ||
17 | unsigned long arg0, unsigned long arg1, unsigned long arg2); | ||
18 | |||
19 | static inline void __noreturn cpu_soft_restart(unsigned long el2_switch, | ||
20 | unsigned long entry, unsigned long arg0, unsigned long arg1, | ||
21 | unsigned long arg2) | ||
22 | { | ||
23 | typeof(__cpu_soft_restart) *restart; | ||
24 | |||
25 | el2_switch = el2_switch && !is_kernel_in_hyp_mode() && | ||
26 | is_hyp_mode_available(); | ||
27 | restart = (void *)virt_to_phys(__cpu_soft_restart); | ||
28 | |||
29 | cpu_install_idmap(); | ||
30 | restart(el2_switch, entry, arg0, arg1, arg2); | ||
31 | unreachable(); | ||
32 | } | ||
33 | |||
34 | #endif | ||