aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm64/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm64/kernel')
-rw-r--r--arch/arm64/kernel/cpuinfo.c10
-rw-r--r--arch/arm64/kernel/efi-stub.c14
-rw-r--r--arch/arm64/kernel/efi.c2
-rw-r--r--arch/arm64/kernel/module.c1
-rw-r--r--arch/arm64/kernel/perf_regs.c8
-rw-r--r--arch/arm64/kernel/setup.c1
-rw-r--r--arch/arm64/kernel/smp_spin_table.c1
-rw-r--r--arch/arm64/kernel/suspend.c14
8 files changed, 42 insertions, 9 deletions
diff --git a/arch/arm64/kernel/cpuinfo.c b/arch/arm64/kernel/cpuinfo.c
index 57b641747534..07d435cf2eea 100644
--- a/arch/arm64/kernel/cpuinfo.c
+++ b/arch/arm64/kernel/cpuinfo.c
@@ -147,6 +147,7 @@ static void cpuinfo_sanity_check(struct cpuinfo_arm64 *cur)
147 * If we have AArch32, we care about 32-bit features for compat. These 147 * If we have AArch32, we care about 32-bit features for compat. These
148 * registers should be RES0 otherwise. 148 * registers should be RES0 otherwise.
149 */ 149 */
150 diff |= CHECK(id_dfr0, boot, cur, cpu);
150 diff |= CHECK(id_isar0, boot, cur, cpu); 151 diff |= CHECK(id_isar0, boot, cur, cpu);
151 diff |= CHECK(id_isar1, boot, cur, cpu); 152 diff |= CHECK(id_isar1, boot, cur, cpu);
152 diff |= CHECK(id_isar2, boot, cur, cpu); 153 diff |= CHECK(id_isar2, boot, cur, cpu);
@@ -165,6 +166,10 @@ static void cpuinfo_sanity_check(struct cpuinfo_arm64 *cur)
165 diff |= CHECK(id_pfr0, boot, cur, cpu); 166 diff |= CHECK(id_pfr0, boot, cur, cpu);
166 diff |= CHECK(id_pfr1, boot, cur, cpu); 167 diff |= CHECK(id_pfr1, boot, cur, cpu);
167 168
169 diff |= CHECK(mvfr0, boot, cur, cpu);
170 diff |= CHECK(mvfr1, boot, cur, cpu);
171 diff |= CHECK(mvfr2, boot, cur, cpu);
172
168 /* 173 /*
169 * Mismatched CPU features are a recipe for disaster. Don't even 174 * Mismatched CPU features are a recipe for disaster. Don't even
170 * pretend to support them. 175 * pretend to support them.
@@ -189,6 +194,7 @@ static void __cpuinfo_store_cpu(struct cpuinfo_arm64 *info)
189 info->reg_id_aa64pfr0 = read_cpuid(ID_AA64PFR0_EL1); 194 info->reg_id_aa64pfr0 = read_cpuid(ID_AA64PFR0_EL1);
190 info->reg_id_aa64pfr1 = read_cpuid(ID_AA64PFR1_EL1); 195 info->reg_id_aa64pfr1 = read_cpuid(ID_AA64PFR1_EL1);
191 196
197 info->reg_id_dfr0 = read_cpuid(ID_DFR0_EL1);
192 info->reg_id_isar0 = read_cpuid(ID_ISAR0_EL1); 198 info->reg_id_isar0 = read_cpuid(ID_ISAR0_EL1);
193 info->reg_id_isar1 = read_cpuid(ID_ISAR1_EL1); 199 info->reg_id_isar1 = read_cpuid(ID_ISAR1_EL1);
194 info->reg_id_isar2 = read_cpuid(ID_ISAR2_EL1); 200 info->reg_id_isar2 = read_cpuid(ID_ISAR2_EL1);
@@ -202,6 +208,10 @@ static void __cpuinfo_store_cpu(struct cpuinfo_arm64 *info)
202 info->reg_id_pfr0 = read_cpuid(ID_PFR0_EL1); 208 info->reg_id_pfr0 = read_cpuid(ID_PFR0_EL1);
203 info->reg_id_pfr1 = read_cpuid(ID_PFR1_EL1); 209 info->reg_id_pfr1 = read_cpuid(ID_PFR1_EL1);
204 210
211 info->reg_mvfr0 = read_cpuid(MVFR0_EL1);
212 info->reg_mvfr1 = read_cpuid(MVFR1_EL1);
213 info->reg_mvfr2 = read_cpuid(MVFR2_EL1);
214
205 cpuinfo_detect_icache_policy(info); 215 cpuinfo_detect_icache_policy(info);
206 216
207 check_local_cpu_errata(); 217 check_local_cpu_errata();
diff --git a/arch/arm64/kernel/efi-stub.c b/arch/arm64/kernel/efi-stub.c
index d27dd982ff26..f5374065ad53 100644
--- a/arch/arm64/kernel/efi-stub.c
+++ b/arch/arm64/kernel/efi-stub.c
@@ -13,13 +13,13 @@
13#include <asm/efi.h> 13#include <asm/efi.h>
14#include <asm/sections.h> 14#include <asm/sections.h>
15 15
16efi_status_t handle_kernel_image(efi_system_table_t *sys_table, 16efi_status_t __init handle_kernel_image(efi_system_table_t *sys_table,
17 unsigned long *image_addr, 17 unsigned long *image_addr,
18 unsigned long *image_size, 18 unsigned long *image_size,
19 unsigned long *reserve_addr, 19 unsigned long *reserve_addr,
20 unsigned long *reserve_size, 20 unsigned long *reserve_size,
21 unsigned long dram_base, 21 unsigned long dram_base,
22 efi_loaded_image_t *image) 22 efi_loaded_image_t *image)
23{ 23{
24 efi_status_t status; 24 efi_status_t status;
25 unsigned long kernel_size, kernel_memsize = 0; 25 unsigned long kernel_size, kernel_memsize = 0;
diff --git a/arch/arm64/kernel/efi.c b/arch/arm64/kernel/efi.c
index 6fac253bc783..2bb4347d0edf 100644
--- a/arch/arm64/kernel/efi.c
+++ b/arch/arm64/kernel/efi.c
@@ -326,6 +326,7 @@ void __init efi_idmap_init(void)
326 326
327 /* boot time idmap_pg_dir is incomplete, so fill in missing parts */ 327 /* boot time idmap_pg_dir is incomplete, so fill in missing parts */
328 efi_setup_idmap(); 328 efi_setup_idmap();
329 early_memunmap(memmap.map, memmap.map_end - memmap.map);
329} 330}
330 331
331static int __init remap_region(efi_memory_desc_t *md, void **new) 332static int __init remap_region(efi_memory_desc_t *md, void **new)
@@ -380,7 +381,6 @@ static int __init arm64_enter_virtual_mode(void)
380 } 381 }
381 382
382 mapsize = memmap.map_end - memmap.map; 383 mapsize = memmap.map_end - memmap.map;
383 early_memunmap(memmap.map, mapsize);
384 384
385 if (efi_runtime_disabled()) { 385 if (efi_runtime_disabled()) {
386 pr_info("EFI runtime services will be disabled.\n"); 386 pr_info("EFI runtime services will be disabled.\n");
diff --git a/arch/arm64/kernel/module.c b/arch/arm64/kernel/module.c
index fd027b101de5..9b6f71db2709 100644
--- a/arch/arm64/kernel/module.c
+++ b/arch/arm64/kernel/module.c
@@ -25,6 +25,7 @@
25#include <linux/mm.h> 25#include <linux/mm.h>
26#include <linux/moduleloader.h> 26#include <linux/moduleloader.h>
27#include <linux/vmalloc.h> 27#include <linux/vmalloc.h>
28#include <asm/alternative.h>
28#include <asm/insn.h> 29#include <asm/insn.h>
29#include <asm/sections.h> 30#include <asm/sections.h>
30 31
diff --git a/arch/arm64/kernel/perf_regs.c b/arch/arm64/kernel/perf_regs.c
index 6762ad705587..3f62b35fb6f1 100644
--- a/arch/arm64/kernel/perf_regs.c
+++ b/arch/arm64/kernel/perf_regs.c
@@ -50,3 +50,11 @@ u64 perf_reg_abi(struct task_struct *task)
50 else 50 else
51 return PERF_SAMPLE_REGS_ABI_64; 51 return PERF_SAMPLE_REGS_ABI_64;
52} 52}
53
54void perf_get_regs_user(struct perf_regs *regs_user,
55 struct pt_regs *regs,
56 struct pt_regs *regs_user_copy)
57{
58 regs_user->regs = task_pt_regs(current);
59 regs_user->abi = perf_reg_abi(current);
60}
diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c
index b80991166754..20fe2932ad0c 100644
--- a/arch/arm64/kernel/setup.c
+++ b/arch/arm64/kernel/setup.c
@@ -402,6 +402,7 @@ void __init setup_arch(char **cmdline_p)
402 request_standard_resources(); 402 request_standard_resources();
403 403
404 efi_idmap_init(); 404 efi_idmap_init();
405 early_ioremap_reset();
405 406
406 unflatten_device_tree(); 407 unflatten_device_tree();
407 408
diff --git a/arch/arm64/kernel/smp_spin_table.c b/arch/arm64/kernel/smp_spin_table.c
index 4f93c67e63de..14944e5b28da 100644
--- a/arch/arm64/kernel/smp_spin_table.c
+++ b/arch/arm64/kernel/smp_spin_table.c
@@ -25,6 +25,7 @@
25#include <asm/cacheflush.h> 25#include <asm/cacheflush.h>
26#include <asm/cpu_ops.h> 26#include <asm/cpu_ops.h>
27#include <asm/cputype.h> 27#include <asm/cputype.h>
28#include <asm/io.h>
28#include <asm/smp_plat.h> 29#include <asm/smp_plat.h>
29 30
30extern void secondary_holding_pen(void); 31extern void secondary_holding_pen(void);
diff --git a/arch/arm64/kernel/suspend.c b/arch/arm64/kernel/suspend.c
index 3771b72b6569..2d6b6065fe7f 100644
--- a/arch/arm64/kernel/suspend.c
+++ b/arch/arm64/kernel/suspend.c
@@ -5,6 +5,7 @@
5#include <asm/debug-monitors.h> 5#include <asm/debug-monitors.h>
6#include <asm/pgtable.h> 6#include <asm/pgtable.h>
7#include <asm/memory.h> 7#include <asm/memory.h>
8#include <asm/mmu_context.h>
8#include <asm/smp_plat.h> 9#include <asm/smp_plat.h>
9#include <asm/suspend.h> 10#include <asm/suspend.h>
10#include <asm/tlbflush.h> 11#include <asm/tlbflush.h>
@@ -98,7 +99,18 @@ int __cpu_suspend(unsigned long arg, int (*fn)(unsigned long))
98 */ 99 */
99 ret = __cpu_suspend_enter(arg, fn); 100 ret = __cpu_suspend_enter(arg, fn);
100 if (ret == 0) { 101 if (ret == 0) {
101 cpu_switch_mm(mm->pgd, mm); 102 /*
103 * We are resuming from reset with TTBR0_EL1 set to the
104 * idmap to enable the MMU; restore the active_mm mappings in
105 * TTBR0_EL1 unless the active_mm == &init_mm, in which case
106 * the thread entered __cpu_suspend with TTBR0_EL1 set to
107 * reserved TTBR0 page tables and should be restored as such.
108 */
109 if (mm == &init_mm)
110 cpu_set_reserved_ttbr0();
111 else
112 cpu_switch_mm(mm->pgd, mm);
113
102 flush_tlb_all(); 114 flush_tlb_all();
103 115
104 /* 116 /*