aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm64
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2013-12-31 11:51:02 -0500
committerJens Axboe <axboe@kernel.dk>2013-12-31 11:51:02 -0500
commitb28bc9b38c52f63f43e3fd875af982f2240a2859 (patch)
tree76cdb7b52b58f5685993cc15ed81d1c903023358 /arch/arm64
parent8d30726912cb39c3a3ebde06214d54861f8fdde2 (diff)
parent802eee95bde72fd0cd0f3a5b2098375a487d1eda (diff)
Merge tag 'v3.13-rc6' into for-3.14/core
Needed to bring blk-mq uptodate, since changes have been going in since for-3.14/core was established. Fixup merge issues related to the immutable biovec changes. Signed-off-by: Jens Axboe <axboe@kernel.dk> Conflicts: block/blk-flush.c fs/btrfs/check-integrity.c fs/btrfs/extent_io.c fs/btrfs/scrub.c fs/logfs/dev_bdev.c
Diffstat (limited to 'arch/arm64')
-rw-r--r--arch/arm64/Kconfig3
-rw-r--r--arch/arm64/boot/dts/foundation-v8.dts2
-rw-r--r--arch/arm64/include/asm/io.h2
-rw-r--r--arch/arm64/include/asm/irqflags.h3
-rw-r--r--arch/arm64/include/asm/pgtable-hwdef.h2
-rw-r--r--arch/arm64/include/asm/pgtable.h33
-rw-r--r--arch/arm64/include/asm/xen/page-coherent.h4
-rw-r--r--arch/arm64/kernel/debug-monitors.c20
-rw-r--r--arch/arm64/kernel/entry.S29
-rw-r--r--arch/arm64/kernel/head.S3
-rw-r--r--arch/arm64/kernel/ptrace.c78
-rw-r--r--arch/arm64/kernel/setup.c5
-rw-r--r--arch/arm64/kernel/smp.c1
-rw-r--r--arch/arm64/mm/proc.S2
14 files changed, 91 insertions, 96 deletions
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index 88c8b6c1341a..6d4dd22ee4b7 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -159,8 +159,7 @@ config NR_CPUS
159 range 2 32 159 range 2 32
160 depends on SMP 160 depends on SMP
161 # These have to remain sorted largest to smallest 161 # These have to remain sorted largest to smallest
162 default "8" if ARCH_XGENE 162 default "8"
163 default "4"
164 163
165config HOTPLUG_CPU 164config HOTPLUG_CPU
166 bool "Support for hot-pluggable CPUs" 165 bool "Support for hot-pluggable CPUs"
diff --git a/arch/arm64/boot/dts/foundation-v8.dts b/arch/arm64/boot/dts/foundation-v8.dts
index 84fcc5018284..519c4b2c0687 100644
--- a/arch/arm64/boot/dts/foundation-v8.dts
+++ b/arch/arm64/boot/dts/foundation-v8.dts
@@ -6,6 +6,8 @@
6 6
7/dts-v1/; 7/dts-v1/;
8 8
9/memreserve/ 0x80000000 0x00010000;
10
9/ { 11/ {
10 model = "Foundation-v8A"; 12 model = "Foundation-v8A";
11 compatible = "arm,foundation-aarch64", "arm,vexpress"; 13 compatible = "arm,foundation-aarch64", "arm,vexpress";
diff --git a/arch/arm64/include/asm/io.h b/arch/arm64/include/asm/io.h
index 4cc813eddacb..572769727227 100644
--- a/arch/arm64/include/asm/io.h
+++ b/arch/arm64/include/asm/io.h
@@ -229,7 +229,7 @@ extern void __iomem *__ioremap(phys_addr_t phys_addr, size_t size, pgprot_t prot
229extern void __iounmap(volatile void __iomem *addr); 229extern void __iounmap(volatile void __iomem *addr);
230extern void __iomem *ioremap_cache(phys_addr_t phys_addr, size_t size); 230extern void __iomem *ioremap_cache(phys_addr_t phys_addr, size_t size);
231 231
232#define PROT_DEFAULT (PTE_TYPE_PAGE | PTE_AF | PTE_DIRTY) 232#define PROT_DEFAULT (pgprot_default | PTE_DIRTY)
233#define PROT_DEVICE_nGnRE (PROT_DEFAULT | PTE_PXN | PTE_UXN | PTE_ATTRINDX(MT_DEVICE_nGnRE)) 233#define PROT_DEVICE_nGnRE (PROT_DEFAULT | PTE_PXN | PTE_UXN | PTE_ATTRINDX(MT_DEVICE_nGnRE))
234#define PROT_NORMAL_NC (PROT_DEFAULT | PTE_ATTRINDX(MT_NORMAL_NC)) 234#define PROT_NORMAL_NC (PROT_DEFAULT | PTE_ATTRINDX(MT_NORMAL_NC))
235#define PROT_NORMAL (PROT_DEFAULT | PTE_ATTRINDX(MT_NORMAL)) 235#define PROT_NORMAL (PROT_DEFAULT | PTE_ATTRINDX(MT_NORMAL))
diff --git a/arch/arm64/include/asm/irqflags.h b/arch/arm64/include/asm/irqflags.h
index aa11943b8502..b2fcfbc51ecc 100644
--- a/arch/arm64/include/asm/irqflags.h
+++ b/arch/arm64/include/asm/irqflags.h
@@ -56,6 +56,9 @@ static inline void arch_local_irq_disable(void)
56#define local_fiq_enable() asm("msr daifclr, #1" : : : "memory") 56#define local_fiq_enable() asm("msr daifclr, #1" : : : "memory")
57#define local_fiq_disable() asm("msr daifset, #1" : : : "memory") 57#define local_fiq_disable() asm("msr daifset, #1" : : : "memory")
58 58
59#define local_async_enable() asm("msr daifclr, #4" : : : "memory")
60#define local_async_disable() asm("msr daifset, #4" : : : "memory")
61
59/* 62/*
60 * Save the current interrupt enable state. 63 * Save the current interrupt enable state.
61 */ 64 */
diff --git a/arch/arm64/include/asm/pgtable-hwdef.h b/arch/arm64/include/asm/pgtable-hwdef.h
index 755f86143320..b1d2e26c3c88 100644
--- a/arch/arm64/include/asm/pgtable-hwdef.h
+++ b/arch/arm64/include/asm/pgtable-hwdef.h
@@ -43,7 +43,7 @@
43 * Section 43 * Section
44 */ 44 */
45#define PMD_SECT_VALID (_AT(pmdval_t, 1) << 0) 45#define PMD_SECT_VALID (_AT(pmdval_t, 1) << 0)
46#define PMD_SECT_PROT_NONE (_AT(pmdval_t, 1) << 2) 46#define PMD_SECT_PROT_NONE (_AT(pmdval_t, 1) << 58)
47#define PMD_SECT_USER (_AT(pmdval_t, 1) << 6) /* AP[1] */ 47#define PMD_SECT_USER (_AT(pmdval_t, 1) << 6) /* AP[1] */
48#define PMD_SECT_RDONLY (_AT(pmdval_t, 1) << 7) /* AP[2] */ 48#define PMD_SECT_RDONLY (_AT(pmdval_t, 1) << 7) /* AP[2] */
49#define PMD_SECT_S (_AT(pmdval_t, 3) << 8) 49#define PMD_SECT_S (_AT(pmdval_t, 3) << 8)
diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h
index 17bd3af0a117..7f2b60affbb4 100644
--- a/arch/arm64/include/asm/pgtable.h
+++ b/arch/arm64/include/asm/pgtable.h
@@ -25,10 +25,11 @@
25 * Software defined PTE bits definition. 25 * Software defined PTE bits definition.
26 */ 26 */
27#define PTE_VALID (_AT(pteval_t, 1) << 0) 27#define PTE_VALID (_AT(pteval_t, 1) << 0)
28#define PTE_PROT_NONE (_AT(pteval_t, 1) << 2) /* only when !PTE_VALID */ 28#define PTE_FILE (_AT(pteval_t, 1) << 2) /* only when !pte_present() */
29#define PTE_FILE (_AT(pteval_t, 1) << 3) /* only when !pte_present() */
30#define PTE_DIRTY (_AT(pteval_t, 1) << 55) 29#define PTE_DIRTY (_AT(pteval_t, 1) << 55)
31#define PTE_SPECIAL (_AT(pteval_t, 1) << 56) 30#define PTE_SPECIAL (_AT(pteval_t, 1) << 56)
31 /* bit 57 for PMD_SECT_SPLITTING */
32#define PTE_PROT_NONE (_AT(pteval_t, 1) << 58) /* only when !PTE_VALID */
32 33
33/* 34/*
34 * VMALLOC and SPARSEMEM_VMEMMAP ranges. 35 * VMALLOC and SPARSEMEM_VMEMMAP ranges.
@@ -254,7 +255,7 @@ static inline int has_transparent_hugepage(void)
254#define pgprot_noncached(prot) \ 255#define pgprot_noncached(prot) \
255 __pgprot_modify(prot, PTE_ATTRINDX_MASK, PTE_ATTRINDX(MT_DEVICE_nGnRnE)) 256 __pgprot_modify(prot, PTE_ATTRINDX_MASK, PTE_ATTRINDX(MT_DEVICE_nGnRnE))
256#define pgprot_writecombine(prot) \ 257#define pgprot_writecombine(prot) \
257 __pgprot_modify(prot, PTE_ATTRINDX_MASK, PTE_ATTRINDX(MT_DEVICE_GRE)) 258 __pgprot_modify(prot, PTE_ATTRINDX_MASK, PTE_ATTRINDX(MT_NORMAL_NC))
258#define pgprot_dmacoherent(prot) \ 259#define pgprot_dmacoherent(prot) \
259 __pgprot_modify(prot, PTE_ATTRINDX_MASK, PTE_ATTRINDX(MT_NORMAL_NC)) 260 __pgprot_modify(prot, PTE_ATTRINDX_MASK, PTE_ATTRINDX(MT_NORMAL_NC))
260#define __HAVE_PHYS_MEM_ACCESS_PROT 261#define __HAVE_PHYS_MEM_ACCESS_PROT
@@ -357,18 +358,20 @@ extern pgd_t idmap_pg_dir[PTRS_PER_PGD];
357 358
358/* 359/*
359 * Encode and decode a swap entry: 360 * Encode and decode a swap entry:
360 * bits 0, 2: present (must both be zero) 361 * bits 0-1: present (must be zero)
361 * bit 3: PTE_FILE 362 * bit 2: PTE_FILE
362 * bits 4-8: swap type 363 * bits 3-8: swap type
363 * bits 9-63: swap offset 364 * bits 9-57: swap offset
364 */ 365 */
365#define __SWP_TYPE_SHIFT 4 366#define __SWP_TYPE_SHIFT 3
366#define __SWP_TYPE_BITS 6 367#define __SWP_TYPE_BITS 6
368#define __SWP_OFFSET_BITS 49
367#define __SWP_TYPE_MASK ((1 << __SWP_TYPE_BITS) - 1) 369#define __SWP_TYPE_MASK ((1 << __SWP_TYPE_BITS) - 1)
368#define __SWP_OFFSET_SHIFT (__SWP_TYPE_BITS + __SWP_TYPE_SHIFT) 370#define __SWP_OFFSET_SHIFT (__SWP_TYPE_BITS + __SWP_TYPE_SHIFT)
371#define __SWP_OFFSET_MASK ((1UL << __SWP_OFFSET_BITS) - 1)
369 372
370#define __swp_type(x) (((x).val >> __SWP_TYPE_SHIFT) & __SWP_TYPE_MASK) 373#define __swp_type(x) (((x).val >> __SWP_TYPE_SHIFT) & __SWP_TYPE_MASK)
371#define __swp_offset(x) ((x).val >> __SWP_OFFSET_SHIFT) 374#define __swp_offset(x) (((x).val >> __SWP_OFFSET_SHIFT) & __SWP_OFFSET_MASK)
372#define __swp_entry(type,offset) ((swp_entry_t) { ((type) << __SWP_TYPE_SHIFT) | ((offset) << __SWP_OFFSET_SHIFT) }) 375#define __swp_entry(type,offset) ((swp_entry_t) { ((type) << __SWP_TYPE_SHIFT) | ((offset) << __SWP_OFFSET_SHIFT) })
373 376
374#define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) }) 377#define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) })
@@ -382,15 +385,15 @@ extern pgd_t idmap_pg_dir[PTRS_PER_PGD];
382 385
383/* 386/*
384 * Encode and decode a file entry: 387 * Encode and decode a file entry:
385 * bits 0, 2: present (must both be zero) 388 * bits 0-1: present (must be zero)
386 * bit 3: PTE_FILE 389 * bit 2: PTE_FILE
387 * bits 4-63: file offset / PAGE_SIZE 390 * bits 3-57: file offset / PAGE_SIZE
388 */ 391 */
389#define pte_file(pte) (pte_val(pte) & PTE_FILE) 392#define pte_file(pte) (pte_val(pte) & PTE_FILE)
390#define pte_to_pgoff(x) (pte_val(x) >> 4) 393#define pte_to_pgoff(x) (pte_val(x) >> 3)
391#define pgoff_to_pte(x) __pte(((x) << 4) | PTE_FILE) 394#define pgoff_to_pte(x) __pte(((x) << 3) | PTE_FILE)
392 395
393#define PTE_FILE_MAX_BITS 60 396#define PTE_FILE_MAX_BITS 55
394 397
395extern int kern_addr_valid(unsigned long addr); 398extern int kern_addr_valid(unsigned long addr);
396 399
diff --git a/arch/arm64/include/asm/xen/page-coherent.h b/arch/arm64/include/asm/xen/page-coherent.h
index 2820f1a6eebe..dde3fc9c49f0 100644
--- a/arch/arm64/include/asm/xen/page-coherent.h
+++ b/arch/arm64/include/asm/xen/page-coherent.h
@@ -23,25 +23,21 @@ static inline void xen_dma_map_page(struct device *hwdev, struct page *page,
23 unsigned long offset, size_t size, enum dma_data_direction dir, 23 unsigned long offset, size_t size, enum dma_data_direction dir,
24 struct dma_attrs *attrs) 24 struct dma_attrs *attrs)
25{ 25{
26 __generic_dma_ops(hwdev)->map_page(hwdev, page, offset, size, dir, attrs);
27} 26}
28 27
29static inline void xen_dma_unmap_page(struct device *hwdev, dma_addr_t handle, 28static inline void xen_dma_unmap_page(struct device *hwdev, dma_addr_t handle,
30 size_t size, enum dma_data_direction dir, 29 size_t size, enum dma_data_direction dir,
31 struct dma_attrs *attrs) 30 struct dma_attrs *attrs)
32{ 31{
33 __generic_dma_ops(hwdev)->unmap_page(hwdev, handle, size, dir, attrs);
34} 32}
35 33
36static inline void xen_dma_sync_single_for_cpu(struct device *hwdev, 34static inline void xen_dma_sync_single_for_cpu(struct device *hwdev,
37 dma_addr_t handle, size_t size, enum dma_data_direction dir) 35 dma_addr_t handle, size_t size, enum dma_data_direction dir)
38{ 36{
39 __generic_dma_ops(hwdev)->sync_single_for_cpu(hwdev, handle, size, dir);
40} 37}
41 38
42static inline void xen_dma_sync_single_for_device(struct device *hwdev, 39static inline void xen_dma_sync_single_for_device(struct device *hwdev,
43 dma_addr_t handle, size_t size, enum dma_data_direction dir) 40 dma_addr_t handle, size_t size, enum dma_data_direction dir)
44{ 41{
45 __generic_dma_ops(hwdev)->sync_single_for_device(hwdev, handle, size, dir);
46} 42}
47#endif /* _ASM_ARM64_XEN_PAGE_COHERENT_H */ 43#endif /* _ASM_ARM64_XEN_PAGE_COHERENT_H */
diff --git a/arch/arm64/kernel/debug-monitors.c b/arch/arm64/kernel/debug-monitors.c
index 6a0a9b132d7a..4ae68579031d 100644
--- a/arch/arm64/kernel/debug-monitors.c
+++ b/arch/arm64/kernel/debug-monitors.c
@@ -248,7 +248,8 @@ static int brk_handler(unsigned long addr, unsigned int esr,
248int aarch32_break_handler(struct pt_regs *regs) 248int aarch32_break_handler(struct pt_regs *regs)
249{ 249{
250 siginfo_t info; 250 siginfo_t info;
251 unsigned int instr; 251 u32 arm_instr;
252 u16 thumb_instr;
252 bool bp = false; 253 bool bp = false;
253 void __user *pc = (void __user *)instruction_pointer(regs); 254 void __user *pc = (void __user *)instruction_pointer(regs);
254 255
@@ -257,18 +258,21 @@ int aarch32_break_handler(struct pt_regs *regs)
257 258
258 if (compat_thumb_mode(regs)) { 259 if (compat_thumb_mode(regs)) {
259 /* get 16-bit Thumb instruction */ 260 /* get 16-bit Thumb instruction */
260 get_user(instr, (u16 __user *)pc); 261 get_user(thumb_instr, (u16 __user *)pc);
261 if (instr == AARCH32_BREAK_THUMB2_LO) { 262 thumb_instr = le16_to_cpu(thumb_instr);
263 if (thumb_instr == AARCH32_BREAK_THUMB2_LO) {
262 /* get second half of 32-bit Thumb-2 instruction */ 264 /* get second half of 32-bit Thumb-2 instruction */
263 get_user(instr, (u16 __user *)(pc + 2)); 265 get_user(thumb_instr, (u16 __user *)(pc + 2));
264 bp = instr == AARCH32_BREAK_THUMB2_HI; 266 thumb_instr = le16_to_cpu(thumb_instr);
267 bp = thumb_instr == AARCH32_BREAK_THUMB2_HI;
265 } else { 268 } else {
266 bp = instr == AARCH32_BREAK_THUMB; 269 bp = thumb_instr == AARCH32_BREAK_THUMB;
267 } 270 }
268 } else { 271 } else {
269 /* 32-bit ARM instruction */ 272 /* 32-bit ARM instruction */
270 get_user(instr, (u32 __user *)pc); 273 get_user(arm_instr, (u32 __user *)pc);
271 bp = (instr & ~0xf0000000) == AARCH32_BREAK_ARM; 274 arm_instr = le32_to_cpu(arm_instr);
275 bp = (arm_instr & ~0xf0000000) == AARCH32_BREAK_ARM;
272 } 276 }
273 277
274 if (!bp) 278 if (!bp)
diff --git a/arch/arm64/kernel/entry.S b/arch/arm64/kernel/entry.S
index e1166145ca29..4d2c6f3f0c41 100644
--- a/arch/arm64/kernel/entry.S
+++ b/arch/arm64/kernel/entry.S
@@ -309,15 +309,12 @@ el1_irq:
309#ifdef CONFIG_TRACE_IRQFLAGS 309#ifdef CONFIG_TRACE_IRQFLAGS
310 bl trace_hardirqs_off 310 bl trace_hardirqs_off
311#endif 311#endif
312#ifdef CONFIG_PREEMPT 312
313 get_thread_info tsk
314 ldr w24, [tsk, #TI_PREEMPT] // get preempt count
315 add w0, w24, #1 // increment it
316 str w0, [tsk, #TI_PREEMPT]
317#endif
318 irq_handler 313 irq_handler
314
319#ifdef CONFIG_PREEMPT 315#ifdef CONFIG_PREEMPT
320 str w24, [tsk, #TI_PREEMPT] // restore preempt count 316 get_thread_info tsk
317 ldr w24, [tsk, #TI_PREEMPT] // restore preempt count
321 cbnz w24, 1f // preempt count != 0 318 cbnz w24, 1f // preempt count != 0
322 ldr x0, [tsk, #TI_FLAGS] // get flags 319 ldr x0, [tsk, #TI_FLAGS] // get flags
323 tbz x0, #TIF_NEED_RESCHED, 1f // needs rescheduling? 320 tbz x0, #TIF_NEED_RESCHED, 1f // needs rescheduling?
@@ -507,22 +504,10 @@ el0_irq_naked:
507#ifdef CONFIG_TRACE_IRQFLAGS 504#ifdef CONFIG_TRACE_IRQFLAGS
508 bl trace_hardirqs_off 505 bl trace_hardirqs_off
509#endif 506#endif
510 get_thread_info tsk 507
511#ifdef CONFIG_PREEMPT
512 ldr w24, [tsk, #TI_PREEMPT] // get preempt count
513 add w23, w24, #1 // increment it
514 str w23, [tsk, #TI_PREEMPT]
515#endif
516 irq_handler 508 irq_handler
517#ifdef CONFIG_PREEMPT 509 get_thread_info tsk
518 ldr w0, [tsk, #TI_PREEMPT] 510
519 str w24, [tsk, #TI_PREEMPT]
520 cmp w0, w23
521 b.eq 1f
522 mov x1, #0
523 str x1, [x1] // BUG
5241:
525#endif
526#ifdef CONFIG_TRACE_IRQFLAGS 511#ifdef CONFIG_TRACE_IRQFLAGS
527 bl trace_hardirqs_on 512 bl trace_hardirqs_on
528#endif 513#endif
diff --git a/arch/arm64/kernel/head.S b/arch/arm64/kernel/head.S
index 7009387348b7..c68cca5c3523 100644
--- a/arch/arm64/kernel/head.S
+++ b/arch/arm64/kernel/head.S
@@ -282,8 +282,9 @@ ENDPROC(secondary_holding_pen)
282 * be used where CPUs are brought online dynamically by the kernel. 282 * be used where CPUs are brought online dynamically by the kernel.
283 */ 283 */
284ENTRY(secondary_entry) 284ENTRY(secondary_entry)
285 bl __calc_phys_offset // x2=phys offset
286 bl el2_setup // Drop to EL1 285 bl el2_setup // Drop to EL1
286 bl __calc_phys_offset // x24=PHYS_OFFSET, x28=PHYS_OFFSET-PAGE_OFFSET
287 bl set_cpu_boot_mode_flag
287 b secondary_startup 288 b secondary_startup
288ENDPROC(secondary_entry) 289ENDPROC(secondary_entry)
289 290
diff --git a/arch/arm64/kernel/ptrace.c b/arch/arm64/kernel/ptrace.c
index fecdbf7de82e..6a8928bba03c 100644
--- a/arch/arm64/kernel/ptrace.c
+++ b/arch/arm64/kernel/ptrace.c
@@ -214,31 +214,29 @@ static int ptrace_hbp_fill_attr_ctrl(unsigned int note_type,
214{ 214{
215 int err, len, type, disabled = !ctrl.enabled; 215 int err, len, type, disabled = !ctrl.enabled;
216 216
217 if (disabled) { 217 attr->disabled = disabled;
218 len = 0; 218 if (disabled)
219 type = HW_BREAKPOINT_EMPTY; 219 return 0;
220 } else { 220
221 err = arch_bp_generic_fields(ctrl, &len, &type); 221 err = arch_bp_generic_fields(ctrl, &len, &type);
222 if (err) 222 if (err)
223 return err; 223 return err;
224 224
225 switch (note_type) { 225 switch (note_type) {
226 case NT_ARM_HW_BREAK: 226 case NT_ARM_HW_BREAK:
227 if ((type & HW_BREAKPOINT_X) != type) 227 if ((type & HW_BREAKPOINT_X) != type)
228 return -EINVAL;
229 break;
230 case NT_ARM_HW_WATCH:
231 if ((type & HW_BREAKPOINT_RW) != type)
232 return -EINVAL;
233 break;
234 default:
235 return -EINVAL; 228 return -EINVAL;
236 } 229 break;
230 case NT_ARM_HW_WATCH:
231 if ((type & HW_BREAKPOINT_RW) != type)
232 return -EINVAL;
233 break;
234 default:
235 return -EINVAL;
237 } 236 }
238 237
239 attr->bp_len = len; 238 attr->bp_len = len;
240 attr->bp_type = type; 239 attr->bp_type = type;
241 attr->disabled = disabled;
242 240
243 return 0; 241 return 0;
244} 242}
@@ -636,28 +634,27 @@ static int compat_gpr_get(struct task_struct *target,
636 634
637 for (i = 0; i < num_regs; ++i) { 635 for (i = 0; i < num_regs; ++i) {
638 unsigned int idx = start + i; 636 unsigned int idx = start + i;
639 void *reg; 637 compat_ulong_t reg;
640 638
641 switch (idx) { 639 switch (idx) {
642 case 15: 640 case 15:
643 reg = (void *)&task_pt_regs(target)->pc; 641 reg = task_pt_regs(target)->pc;
644 break; 642 break;
645 case 16: 643 case 16:
646 reg = (void *)&task_pt_regs(target)->pstate; 644 reg = task_pt_regs(target)->pstate;
647 break; 645 break;
648 case 17: 646 case 17:
649 reg = (void *)&task_pt_regs(target)->orig_x0; 647 reg = task_pt_regs(target)->orig_x0;
650 break; 648 break;
651 default: 649 default:
652 reg = (void *)&task_pt_regs(target)->regs[idx]; 650 reg = task_pt_regs(target)->regs[idx];
653 } 651 }
654 652
655 ret = copy_to_user(ubuf, reg, sizeof(compat_ulong_t)); 653 ret = copy_to_user(ubuf, &reg, sizeof(reg));
656
657 if (ret) 654 if (ret)
658 break; 655 break;
659 else 656
660 ubuf += sizeof(compat_ulong_t); 657 ubuf += sizeof(reg);
661 } 658 }
662 659
663 return ret; 660 return ret;
@@ -685,28 +682,28 @@ static int compat_gpr_set(struct task_struct *target,
685 682
686 for (i = 0; i < num_regs; ++i) { 683 for (i = 0; i < num_regs; ++i) {
687 unsigned int idx = start + i; 684 unsigned int idx = start + i;
688 void *reg; 685 compat_ulong_t reg;
686
687 ret = copy_from_user(&reg, ubuf, sizeof(reg));
688 if (ret)
689 return ret;
690
691 ubuf += sizeof(reg);
689 692
690 switch (idx) { 693 switch (idx) {
691 case 15: 694 case 15:
692 reg = (void *)&newregs.pc; 695 newregs.pc = reg;
693 break; 696 break;
694 case 16: 697 case 16:
695 reg = (void *)&newregs.pstate; 698 newregs.pstate = reg;
696 break; 699 break;
697 case 17: 700 case 17:
698 reg = (void *)&newregs.orig_x0; 701 newregs.orig_x0 = reg;
699 break; 702 break;
700 default: 703 default:
701 reg = (void *)&newregs.regs[idx]; 704 newregs.regs[idx] = reg;
702 } 705 }
703 706
704 ret = copy_from_user(reg, ubuf, sizeof(compat_ulong_t));
705
706 if (ret)
707 goto out;
708 else
709 ubuf += sizeof(compat_ulong_t);
710 } 707 }
711 708
712 if (valid_user_regs(&newregs.user_regs)) 709 if (valid_user_regs(&newregs.user_regs))
@@ -714,7 +711,6 @@ static int compat_gpr_set(struct task_struct *target,
714 else 711 else
715 ret = -EINVAL; 712 ret = -EINVAL;
716 713
717out:
718 return ret; 714 return ret;
719} 715}
720 716
diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c
index 0bc5e4cbc017..bd9bbd0e44ed 100644
--- a/arch/arm64/kernel/setup.c
+++ b/arch/arm64/kernel/setup.c
@@ -205,6 +205,11 @@ u64 __cpu_logical_map[NR_CPUS] = { [0 ... NR_CPUS-1] = INVALID_HWID };
205 205
206void __init setup_arch(char **cmdline_p) 206void __init setup_arch(char **cmdline_p)
207{ 207{
208 /*
209 * Unmask asynchronous aborts early to catch possible system errors.
210 */
211 local_async_enable();
212
208 setup_processor(); 213 setup_processor();
209 214
210 setup_machine_fdt(__fdt_pointer); 215 setup_machine_fdt(__fdt_pointer);
diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c
index a5aeefab03c3..a0c2ca602cf8 100644
--- a/arch/arm64/kernel/smp.c
+++ b/arch/arm64/kernel/smp.c
@@ -160,6 +160,7 @@ asmlinkage void secondary_start_kernel(void)
160 160
161 local_irq_enable(); 161 local_irq_enable();
162 local_fiq_enable(); 162 local_fiq_enable();
163 local_async_enable();
163 164
164 /* 165 /*
165 * OK, it's off to the idle thread for us 166 * OK, it's off to the idle thread for us
diff --git a/arch/arm64/mm/proc.S b/arch/arm64/mm/proc.S
index 421b99fd635d..0f7fec52c7f8 100644
--- a/arch/arm64/mm/proc.S
+++ b/arch/arm64/mm/proc.S
@@ -111,12 +111,12 @@ ENTRY(__cpu_setup)
111 bl __flush_dcache_all 111 bl __flush_dcache_all
112 mov lr, x28 112 mov lr, x28
113 ic iallu // I+BTB cache invalidate 113 ic iallu // I+BTB cache invalidate
114 tlbi vmalle1is // invalidate I + D TLBs
114 dsb sy 115 dsb sy
115 116
116 mov x0, #3 << 20 117 mov x0, #3 << 20
117 msr cpacr_el1, x0 // Enable FP/ASIMD 118 msr cpacr_el1, x0 // Enable FP/ASIMD
118 msr mdscr_el1, xzr // Reset mdscr_el1 119 msr mdscr_el1, xzr // Reset mdscr_el1
119 tlbi vmalle1is // invalidate I + D TLBs
120 /* 120 /*
121 * Memory region attributes for LPAE: 121 * Memory region attributes for LPAE:
122 * 122 *