Commit d80b34c9163aaeb546dd083f896d948edd585932

Authored by Linus Torvalds

Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux

Pull arm64 fixes from Will Deacon:
 "Here is a handful of minor arm64 fixes discovered and fixed over the
  Christmas break.  The main part is adding some missing #includes that
  we seem to be getting transitively but have started causing problems
  in -next.

   - Fix early mapping fixmap corruption by EFI runtime services
   - Fix __NR_compat_syscalls off-by-one
   - Add missing sanity checks for some 32-bit registers
   - Add some missing #includes which we get transitively
   - Remove unused prepare_to_copy() macro"

* tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
  arm64/efi: add missing call to early_ioremap_reset()
  arm64: fix missing asm/io.h include in kernel/smp_spin_table.c
  arm64: fix missing asm/alternative.h include in kernel/module.c
  arm64: fix missing linux/bug.h include in asm/arch_timer.h
  arm64: fix missing asm/pgtable-hwdef.h include in asm/processor.h
  arm64: sanity checks: add missing AArch32 registers
  arm64: Remove unused prepare_to_copy()
  arm64: Correct __NR_compat_syscalls for bpf

Showing 9 changed files Side-by-side Diff

arch/arm64/include/asm/arch_timer.h
... ... @@ -21,6 +21,7 @@
21 21  
22 22 #include <asm/barrier.h>
23 23  
  24 +#include <linux/bug.h>
24 25 #include <linux/init.h>
25 26 #include <linux/types.h>
26 27  
arch/arm64/include/asm/cpu.h
... ... @@ -39,6 +39,7 @@
39 39 u64 reg_id_aa64pfr0;
40 40 u64 reg_id_aa64pfr1;
41 41  
  42 + u32 reg_id_dfr0;
42 43 u32 reg_id_isar0;
43 44 u32 reg_id_isar1;
44 45 u32 reg_id_isar2;
... ... @@ -51,6 +52,10 @@
51 52 u32 reg_id_mmfr3;
52 53 u32 reg_id_pfr0;
53 54 u32 reg_id_pfr1;
  55 +
  56 + u32 reg_mvfr0;
  57 + u32 reg_mvfr1;
  58 + u32 reg_mvfr2;
54 59 };
55 60  
56 61 DECLARE_PER_CPU(struct cpuinfo_arm64, cpu_data);
arch/arm64/include/asm/processor.h
... ... @@ -31,6 +31,7 @@
31 31  
32 32 #include <asm/fpsimd.h>
33 33 #include <asm/hw_breakpoint.h>
  34 +#include <asm/pgtable-hwdef.h>
34 35 #include <asm/ptrace.h>
35 36 #include <asm/types.h>
36 37  
... ... @@ -122,9 +123,6 @@
122 123  
123 124 /* Free all resources held by a thread. */
124 125 extern void release_thread(struct task_struct *);
125   -
126   -/* Prepare to copy thread state - unlazy all lazy status */
127   -#define prepare_to_copy(tsk) do { } while (0)
128 126  
129 127 unsigned long get_wchan(struct task_struct *p);
130 128  
arch/arm64/include/asm/unistd.h
... ... @@ -44,7 +44,7 @@
44 44 #define __ARM_NR_compat_cacheflush (__ARM_NR_COMPAT_BASE+2)
45 45 #define __ARM_NR_compat_set_tls (__ARM_NR_COMPAT_BASE+5)
46 46  
47   -#define __NR_compat_syscalls 386
  47 +#define __NR_compat_syscalls 387
48 48 #endif
49 49  
50 50 #define __ARCH_WANT_SYS_CLONE
arch/arm64/kernel/cpuinfo.c
... ... @@ -147,6 +147,7 @@
147 147 * If we have AArch32, we care about 32-bit features for compat. These
148 148 * registers should be RES0 otherwise.
149 149 */
  150 + diff |= CHECK(id_dfr0, boot, cur, cpu);
150 151 diff |= CHECK(id_isar0, boot, cur, cpu);
151 152 diff |= CHECK(id_isar1, boot, cur, cpu);
152 153 diff |= CHECK(id_isar2, boot, cur, cpu);
... ... @@ -165,6 +166,10 @@
165 166 diff |= CHECK(id_pfr0, boot, cur, cpu);
166 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 174 * Mismatched CPU features are a recipe for disaster. Don't even
170 175 * pretend to support them.
... ... @@ -189,6 +194,7 @@
189 194 info->reg_id_aa64pfr0 = read_cpuid(ID_AA64PFR0_EL1);
190 195 info->reg_id_aa64pfr1 = read_cpuid(ID_AA64PFR1_EL1);
191 196  
  197 + info->reg_id_dfr0 = read_cpuid(ID_DFR0_EL1);
192 198 info->reg_id_isar0 = read_cpuid(ID_ISAR0_EL1);
193 199 info->reg_id_isar1 = read_cpuid(ID_ISAR1_EL1);
194 200 info->reg_id_isar2 = read_cpuid(ID_ISAR2_EL1);
... ... @@ -201,6 +207,10 @@
201 207 info->reg_id_mmfr3 = read_cpuid(ID_MMFR3_EL1);
202 208 info->reg_id_pfr0 = read_cpuid(ID_PFR0_EL1);
203 209 info->reg_id_pfr1 = read_cpuid(ID_PFR1_EL1);
  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);
204 214  
205 215 cpuinfo_detect_icache_policy(info);
206 216  
arch/arm64/kernel/efi.c
... ... @@ -326,6 +326,7 @@
326 326  
327 327 /* boot time idmap_pg_dir is incomplete, so fill in missing parts */
328 328 efi_setup_idmap();
  329 + early_memunmap(memmap.map, memmap.map_end - memmap.map);
329 330 }
330 331  
331 332 static int __init remap_region(efi_memory_desc_t *md, void **new)
... ... @@ -380,7 +381,6 @@
380 381 }
381 382  
382 383 mapsize = memmap.map_end - memmap.map;
383   - early_memunmap(memmap.map, mapsize);
384 384  
385 385 if (efi_runtime_disabled()) {
386 386 pr_info("EFI runtime services will be disabled.\n");
arch/arm64/kernel/module.c
... ... @@ -25,6 +25,7 @@
25 25 #include <linux/mm.h>
26 26 #include <linux/moduleloader.h>
27 27 #include <linux/vmalloc.h>
  28 +#include <asm/alternative.h>
28 29 #include <asm/insn.h>
29 30 #include <asm/sections.h>
30 31  
arch/arm64/kernel/setup.c
... ... @@ -402,6 +402,7 @@
402 402 request_standard_resources();
403 403  
404 404 efi_idmap_init();
  405 + early_ioremap_reset();
405 406  
406 407 unflatten_device_tree();
407 408  
arch/arm64/kernel/smp_spin_table.c
... ... @@ -25,6 +25,7 @@
25 25 #include <asm/cacheflush.h>
26 26 #include <asm/cpu_ops.h>
27 27 #include <asm/cputype.h>
  28 +#include <asm/io.h>
28 29 #include <asm/smp_plat.h>
29 30  
30 31 extern void secondary_holding_pen(void);