Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

Pull arm64 fixes from Will Deacon:
"There's more here than we usually have at this stage, but that's
mainly down to the stacktrace changes which came in slightly too late
for the merge window.

Summary:

- Big bad batch of MAINTAINERS updates

- Fix handling of SP alignment fault exceptions

- Fix PSTATE.SSBS handling on heterogeneous systems

- Fix fallout from moving to the generic vDSO implementation

- Fix stack unwinding in the face of frame corruption

- Fix off-by-one in IORT code

- Minor SVE cleanups"

* tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
ACPI/IORT: Fix off-by-one check in iort_dev_find_its_id()
arm64: entry: SP Alignment Fault doesn't write to FAR_EL1
arm64: Force SSBS on context switch
MAINTAINERS: Update my email address
MAINTAINERS: Update my email address
MAINTAINERS: Fix spelling mistake in my name
MAINTAINERS: Update my email address to @kernel.org
arm64: mm: Drop pte_huge()
arm64/sve: Fix a couple of magic numbers for the Z-reg count
arm64/sve: Factor out FPSIMD to SVE state conversion
arm64: stacktrace: Better handle corrupted stacks
arm64: stacktrace: Factor out backtrace initialisation
arm64: stacktrace: Constify stacktrace.h functions
arm64: vdso: Cleanup Makefiles
arm64: vdso: fix flip/flop vdso build bug
arm64: vdso: Fix population of AT_SYSINFO_EHDR for compat vdso

+219 -106
+3
.mailmap
··· 98 98 Javi Merino <javi.merino@kernel.org> <javi.merino@arm.com> 99 99 <javier@osg.samsung.com> <javier.martinez@collabora.co.uk> 100 100 Jean Tourrilhes <jt@hpl.hp.com> 101 + <jean-philippe@linaro.org> <jean-philippe.brucker@arm.com> 101 102 Jeff Garzik <jgarzik@pretzel.yyz.us> 102 103 Jeff Layton <jlayton@kernel.org> <jlayton@redhat.com> 103 104 Jeff Layton <jlayton@kernel.org> <jlayton@poochiereds.net> ··· 117 116 Juha Yrjola <at solidboot.com> 118 117 Juha Yrjola <juha.yrjola@nokia.com> 119 118 Juha Yrjola <juha.yrjola@solidboot.com> 119 + Julien Thierry <julien.thierry.kdev@gmail.com> <julien.thierry@arm.com> 120 120 Kay Sievers <kay.sievers@vrfy.org> 121 121 Kenneth W Chen <kenneth.w.chen@intel.com> 122 122 Konstantin Khlebnikov <koct9i@gmail.com> <k.khlebnikov@samsung.com> ··· 134 132 Li Yang <leoyang.li@nxp.com> <leo@zh-kernel.org> 135 133 Li Yang <leoyang.li@nxp.com> <leoli@freescale.com> 136 134 Maciej W. Rozycki <macro@mips.com> <macro@imgtec.com> 135 + Marc Zyngier <maz@kernel.org> <marc.zyngier@arm.com> 137 136 Marcin Nowakowski <marcin.nowakowski@mips.com> <marcin.nowakowski@imgtec.com> 138 137 Mark Brown <broonie@sirena.org.uk> 139 138 Mark Yao <markyao0591@gmail.com> <mark.yao@rock-chips.com>
+7 -7
MAINTAINERS
··· 1194 1194 1195 1195 ARM ARCHITECTED TIMER DRIVER 1196 1196 M: Mark Rutland <mark.rutland@arm.com> 1197 - M: Marc Zyngier <marc.zyngier@arm.com> 1197 + M: Marc Zyngier <maz@kernel.org> 1198 1198 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) 1199 1199 S: Maintained 1200 1200 F: arch/arm/include/asm/arch_timer.h ··· 8490 8490 F: include/uapi/linux/ipx.h 8491 8491 8492 8492 IRQ DOMAINS (IRQ NUMBER MAPPING LIBRARY) 8493 - M: Marc Zyngier <marc.zyngier@arm.com> 8493 + M: Marc Zyngier <maz@kernel.org> 8494 8494 S: Maintained 8495 8495 T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git irq/core 8496 8496 F: Documentation/IRQ-domain.txt ··· 8508 8508 IRQCHIP DRIVERS 8509 8509 M: Thomas Gleixner <tglx@linutronix.de> 8510 8510 M: Jason Cooper <jason@lakedaemon.net> 8511 - M: Marc Zyngier <marc.zyngier@arm.com> 8511 + M: Marc Zyngier <maz@kernel.org> 8512 8512 L: linux-kernel@vger.kernel.org 8513 8513 S: Maintained 8514 8514 T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git irq/core ··· 8828 8828 F: arch/x86/kvm/svm.c 8829 8829 8830 8830 KERNEL VIRTUAL MACHINE FOR ARM/ARM64 (KVM/arm, KVM/arm64) 8831 - M: Marc Zyngier <marc.zyngier@arm.com> 8831 + M: Marc Zyngier <maz@kernel.org> 8832 8832 R: James Morse <james.morse@arm.com> 8833 - R: Julien Thierry <julien.thierry@arm.com> 8834 - R: Suzuki K Pouloze <suzuki.poulose@arm.com> 8833 + R: Julien Thierry <julien.thierry.kdev@gmail.com> 8834 + R: Suzuki K Poulose <suzuki.poulose@arm.com> 8835 8835 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) 8836 8836 L: kvmarm@lists.cs.columbia.edu 8837 8837 T: git git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm.git ··· 17124 17124 F: include/uapi/linux/virtio_input.h 17125 17125 17126 17126 VIRTIO IOMMU DRIVER 17127 - M: Jean-Philippe Brucker <jean-philippe.brucker@arm.com> 17127 + M: Jean-Philippe Brucker <jean-philippe@linaro.org> 17128 17128 L: virtualization@lists.linux-foundation.org 17129 17129 S: Maintained 17130 17130 F: drivers/iommu/virtio-iommu.c
+1 -1
arch/arm64/include/asm/elf.h
··· 202 202 ({ \ 203 203 set_thread_flag(TIF_32BIT); \ 204 204 }) 205 - #ifdef CONFIG_GENERIC_COMPAT_VDSO 205 + #ifdef CONFIG_COMPAT_VDSO 206 206 #define COMPAT_ARCH_DLINFO \ 207 207 do { \ 208 208 /* \
-1
arch/arm64/include/asm/pgtable.h
··· 301 301 /* 302 302 * Huge pte definitions. 303 303 */ 304 - #define pte_huge(pte) (!(pte_val(pte) & PTE_TABLE_BIT)) 305 304 #define pte_mkhuge(pte) (__pte(pte_val(pte) & ~PTE_TABLE_BIT)) 306 305 307 306 /*
+12 -2
arch/arm64/include/asm/processor.h
··· 193 193 regs->pmr_save = GIC_PRIO_IRQON; 194 194 } 195 195 196 + static inline void set_ssbs_bit(struct pt_regs *regs) 197 + { 198 + regs->pstate |= PSR_SSBS_BIT; 199 + } 200 + 201 + static inline void set_compat_ssbs_bit(struct pt_regs *regs) 202 + { 203 + regs->pstate |= PSR_AA32_SSBS_BIT; 204 + } 205 + 196 206 static inline void start_thread(struct pt_regs *regs, unsigned long pc, 197 207 unsigned long sp) 198 208 { ··· 210 200 regs->pstate = PSR_MODE_EL0t; 211 201 212 202 if (arm64_get_ssbd_state() != ARM64_SSBD_FORCE_ENABLE) 213 - regs->pstate |= PSR_SSBS_BIT; 203 + set_ssbs_bit(regs); 214 204 215 205 regs->sp = sp; 216 206 } ··· 229 219 #endif 230 220 231 221 if (arm64_get_ssbd_state() != ARM64_SSBD_FORCE_ENABLE) 232 - regs->pstate |= PSR_AA32_SSBS_BIT; 222 + set_compat_ssbs_bit(regs); 233 223 234 224 regs->compat_sp = sp; 235 225 }
+65 -13
arch/arm64/include/asm/stacktrace.h
··· 8 8 #include <linux/percpu.h> 9 9 #include <linux/sched.h> 10 10 #include <linux/sched/task_stack.h> 11 + #include <linux/types.h> 11 12 12 13 #include <asm/memory.h> 13 14 #include <asm/ptrace.h> 14 15 #include <asm/sdei.h> 15 - 16 - struct stackframe { 17 - unsigned long fp; 18 - unsigned long pc; 19 - #ifdef CONFIG_FUNCTION_GRAPH_TRACER 20 - int graph; 21 - #endif 22 - }; 23 16 24 17 enum stack_type { 25 18 STACK_TYPE_UNKNOWN, ··· 21 28 STACK_TYPE_OVERFLOW, 22 29 STACK_TYPE_SDEI_NORMAL, 23 30 STACK_TYPE_SDEI_CRITICAL, 31 + __NR_STACK_TYPES 24 32 }; 25 33 26 34 struct stack_info { 27 35 unsigned long low; 28 36 unsigned long high; 29 37 enum stack_type type; 38 + }; 39 + 40 + /* 41 + * A snapshot of a frame record or fp/lr register values, along with some 42 + * accounting information necessary for robust unwinding. 43 + * 44 + * @fp: The fp value in the frame record (or the real fp) 45 + * @pc: The fp value in the frame record (or the real lr) 46 + * 47 + * @stacks_done: Stacks which have been entirely unwound, for which it is no 48 + * longer valid to unwind to. 49 + * 50 + * @prev_fp: The fp that pointed to this frame record, or a synthetic value 51 + * of 0. This is used to ensure that within a stack, each 52 + * subsequent frame record is at an increasing address. 53 + * @prev_type: The type of stack this frame record was on, or a synthetic 54 + * value of STACK_TYPE_UNKNOWN. This is used to detect a 55 + * transition from one stack to another. 56 + * 57 + * @graph: When FUNCTION_GRAPH_TRACER is selected, holds the index of a 58 + * replacement lr value in the ftrace graph stack. 59 + */ 60 + struct stackframe { 61 + unsigned long fp; 62 + unsigned long pc; 63 + DECLARE_BITMAP(stacks_done, __NR_STACK_TYPES); 64 + unsigned long prev_fp; 65 + enum stack_type prev_type; 66 + #ifdef CONFIG_FUNCTION_GRAPH_TRACER 67 + int graph; 68 + #endif 30 69 }; 31 70 32 71 extern int unwind_frame(struct task_struct *tsk, struct stackframe *frame); ··· 89 64 return true; 90 65 } 91 66 92 - static inline bool on_task_stack(struct task_struct *tsk, unsigned long sp, 93 - struct stack_info *info) 67 + static inline bool on_task_stack(const struct task_struct *tsk, 68 + unsigned long sp, 69 + struct stack_info *info) 94 70 { 95 71 unsigned long low = (unsigned long)task_stack_page(tsk); 96 72 unsigned long high = low + THREAD_SIZE; ··· 138 112 * We can only safely access per-cpu stacks from current in a non-preemptible 139 113 * context. 140 114 */ 141 - static inline bool on_accessible_stack(struct task_struct *tsk, 142 - unsigned long sp, 143 - struct stack_info *info) 115 + static inline bool on_accessible_stack(const struct task_struct *tsk, 116 + unsigned long sp, 117 + struct stack_info *info) 144 118 { 119 + if (info) 120 + info->type = STACK_TYPE_UNKNOWN; 121 + 145 122 if (on_task_stack(tsk, sp, info)) 146 123 return true; 147 124 if (tsk != current || preemptible()) ··· 157 128 return true; 158 129 159 130 return false; 131 + } 132 + 133 + static inline void start_backtrace(struct stackframe *frame, 134 + unsigned long fp, unsigned long pc) 135 + { 136 + frame->fp = fp; 137 + frame->pc = pc; 138 + #ifdef CONFIG_FUNCTION_GRAPH_TRACER 139 + frame->graph = 0; 140 + #endif 141 + 142 + /* 143 + * Prime the first unwind. 144 + * 145 + * In unwind_frame() we'll check that the FP points to a valid stack, 146 + * which can't be STACK_TYPE_UNKNOWN, and the first unwind will be 147 + * treated as a transition to whichever stack that happens to be. The 148 + * prev_fp value won't be used, but we set it to 0 such that it is 149 + * definitely not an accessible stack address. 150 + */ 151 + bitmap_zero(frame->stacks_done, __NR_STACK_TYPES); 152 + frame->prev_fp = 0; 153 + frame->prev_type = STACK_TYPE_UNKNOWN; 160 154 } 161 155 162 156 #endif /* __ASM_STACKTRACE_H */
+13 -9
arch/arm64/kernel/entry.S
··· 586 586 b.eq el1_ia 587 587 cmp x24, #ESR_ELx_EC_SYS64 // configurable trap 588 588 b.eq el1_undef 589 - cmp x24, #ESR_ELx_EC_SP_ALIGN // stack alignment exception 590 - b.eq el1_sp_pc 591 589 cmp x24, #ESR_ELx_EC_PC_ALIGN // pc alignment exception 592 - b.eq el1_sp_pc 590 + b.eq el1_pc 593 591 cmp x24, #ESR_ELx_EC_UNKNOWN // unknown exception in EL1 594 592 b.eq el1_undef 595 593 cmp x24, #ESR_ELx_EC_BREAKPT_CUR // debug exception in EL1 ··· 609 611 bl do_mem_abort 610 612 611 613 kernel_exit 1 612 - el1_sp_pc: 614 + el1_pc: 613 615 /* 614 - * Stack or PC alignment exception handling 616 + * PC alignment exception handling. We don't handle SP alignment faults, 617 + * since we will have hit a recursive exception when trying to push the 618 + * initial pt_regs. 615 619 */ 616 620 mrs x0, far_el1 617 621 inherit_daif pstate=x23, tmp=x2 ··· 732 732 ccmp x24, #ESR_ELx_EC_WFx, #4, ne 733 733 b.eq el0_sys 734 734 cmp x24, #ESR_ELx_EC_SP_ALIGN // stack alignment exception 735 - b.eq el0_sp_pc 735 + b.eq el0_sp 736 736 cmp x24, #ESR_ELx_EC_PC_ALIGN // pc alignment exception 737 - b.eq el0_sp_pc 737 + b.eq el0_pc 738 738 cmp x24, #ESR_ELx_EC_UNKNOWN // unknown exception in EL0 739 739 b.eq el0_undef 740 740 cmp x24, #ESR_ELx_EC_BREAKPT_LOW // debug exception in EL0 ··· 758 758 cmp x24, #ESR_ELx_EC_FP_EXC32 // FP/ASIMD exception 759 759 b.eq el0_fpsimd_exc 760 760 cmp x24, #ESR_ELx_EC_PC_ALIGN // pc alignment exception 761 - b.eq el0_sp_pc 761 + b.eq el0_pc 762 762 cmp x24, #ESR_ELx_EC_UNKNOWN // unknown exception in EL0 763 763 b.eq el0_undef 764 764 cmp x24, #ESR_ELx_EC_CP15_32 // CP15 MRC/MCR trap ··· 858 858 mov x1, sp 859 859 bl do_fpsimd_exc 860 860 b ret_to_user 861 + el0_sp: 862 + ldr x26, [sp, #S_SP] 863 + b el0_sp_pc 864 + el0_pc: 865 + mrs x26, far_el1 861 866 el0_sp_pc: 862 867 /* 863 868 * Stack or PC alignment exception handling 864 869 */ 865 - mrs x26, far_el1 866 870 gic_prio_kentry_setup tmp=x0 867 871 enable_da_f 868 872 #ifdef CONFIG_TRACE_IRQFLAGS
+15 -14
arch/arm64/kernel/fpsimd.c
··· 406 406 407 407 #define arm64_le128_to_cpu(x) arm64_cpu_to_le128(x) 408 408 409 + static void __fpsimd_to_sve(void *sst, struct user_fpsimd_state const *fst, 410 + unsigned int vq) 411 + { 412 + unsigned int i; 413 + __uint128_t *p; 414 + 415 + for (i = 0; i < SVE_NUM_ZREGS; ++i) { 416 + p = (__uint128_t *)ZREG(sst, vq, i); 417 + *p = arm64_cpu_to_le128(fst->vregs[i]); 418 + } 419 + } 420 + 409 421 /* 410 422 * Transfer the FPSIMD state in task->thread.uw.fpsimd_state to 411 423 * task->thread.sve_state. ··· 435 423 unsigned int vq; 436 424 void *sst = task->thread.sve_state; 437 425 struct user_fpsimd_state const *fst = &task->thread.uw.fpsimd_state; 438 - unsigned int i; 439 - __uint128_t *p; 440 426 441 427 if (!system_supports_sve()) 442 428 return; 443 429 444 430 vq = sve_vq_from_vl(task->thread.sve_vl); 445 - for (i = 0; i < 32; ++i) { 446 - p = (__uint128_t *)ZREG(sst, vq, i); 447 - *p = arm64_cpu_to_le128(fst->vregs[i]); 448 - } 431 + __fpsimd_to_sve(sst, fst, vq); 449 432 } 450 433 451 434 /* ··· 466 459 return; 467 460 468 461 vq = sve_vq_from_vl(task->thread.sve_vl); 469 - for (i = 0; i < 32; ++i) { 462 + for (i = 0; i < SVE_NUM_ZREGS; ++i) { 470 463 p = (__uint128_t const *)ZREG(sst, vq, i); 471 464 fst->vregs[i] = arm64_le128_to_cpu(*p); 472 465 } ··· 557 550 unsigned int vq; 558 551 void *sst = task->thread.sve_state; 559 552 struct user_fpsimd_state const *fst = &task->thread.uw.fpsimd_state; 560 - unsigned int i; 561 - __uint128_t *p; 562 553 563 554 if (!test_tsk_thread_flag(task, TIF_SVE)) 564 555 return; ··· 564 559 vq = sve_vq_from_vl(task->thread.sve_vl); 565 560 566 561 memset(sst, 0, SVE_SIG_REGS_SIZE(vq)); 567 - 568 - for (i = 0; i < 32; ++i) { 569 - p = (__uint128_t *)ZREG(sst, vq, i); 570 - *p = arm64_cpu_to_le128(fst->vregs[i]); 571 - } 562 + __fpsimd_to_sve(sst, fst, vq); 572 563 } 573 564 574 565 int sve_set_vector_length(struct task_struct *task,
+1 -6
arch/arm64/kernel/perf_callchain.c
··· 154 154 return; 155 155 } 156 156 157 - frame.fp = regs->regs[29]; 158 - frame.pc = regs->pc; 159 - #ifdef CONFIG_FUNCTION_GRAPH_TRACER 160 - frame.graph = 0; 161 - #endif 162 - 157 + start_backtrace(&frame, regs->regs[29], regs->pc); 163 158 walk_stackframe(current, &frame, callchain_trace, entry); 164 159 } 165 160
+30 -6
arch/arm64/kernel/process.c
··· 398 398 childregs->pstate |= PSR_UAO_BIT; 399 399 400 400 if (arm64_get_ssbd_state() == ARM64_SSBD_FORCE_DISABLE) 401 - childregs->pstate |= PSR_SSBS_BIT; 401 + set_ssbs_bit(childregs); 402 402 403 403 if (system_uses_irq_prio_masking()) 404 404 childregs->pmr_save = GIC_PRIO_IRQON; ··· 443 443 } 444 444 445 445 /* 446 + * Force SSBS state on context-switch, since it may be lost after migrating 447 + * from a CPU which treats the bit as RES0 in a heterogeneous system. 448 + */ 449 + static void ssbs_thread_switch(struct task_struct *next) 450 + { 451 + struct pt_regs *regs = task_pt_regs(next); 452 + 453 + /* 454 + * Nothing to do for kernel threads, but 'regs' may be junk 455 + * (e.g. idle task) so check the flags and bail early. 456 + */ 457 + if (unlikely(next->flags & PF_KTHREAD)) 458 + return; 459 + 460 + /* If the mitigation is enabled, then we leave SSBS clear. */ 461 + if ((arm64_get_ssbd_state() == ARM64_SSBD_FORCE_ENABLE) || 462 + test_tsk_thread_flag(next, TIF_SSBD)) 463 + return; 464 + 465 + if (compat_user_mode(regs)) 466 + set_compat_ssbs_bit(regs); 467 + else if (user_mode(regs)) 468 + set_ssbs_bit(regs); 469 + } 470 + 471 + /* 446 472 * We store our current task in sp_el0, which is clobbered by userspace. Keep a 447 473 * shadow copy so that we can restore this upon entry from userspace. 448 474 * ··· 497 471 entry_task_switch(next); 498 472 uao_thread_switch(next); 499 473 ptrauth_thread_switch(next); 474 + ssbs_thread_switch(next); 500 475 501 476 /* 502 477 * Complete any pending TLB or cache maintenance on this CPU in case ··· 525 498 if (!stack_page) 526 499 return 0; 527 500 528 - frame.fp = thread_saved_fp(p); 529 - frame.pc = thread_saved_pc(p); 530 - #ifdef CONFIG_FUNCTION_GRAPH_TRACER 531 - frame.graph = 0; 532 - #endif 501 + start_backtrace(&frame, thread_saved_fp(p), thread_saved_pc(p)); 502 + 533 503 do { 534 504 if (unwind_frame(p, &frame)) 535 505 goto out;
+3 -6
arch/arm64/kernel/return_address.c
··· 38 38 data.level = level + 2; 39 39 data.addr = NULL; 40 40 41 - frame.fp = (unsigned long)__builtin_frame_address(0); 42 - frame.pc = (unsigned long)return_address; /* dummy */ 43 - #ifdef CONFIG_FUNCTION_GRAPH_TRACER 44 - frame.graph = 0; 45 - #endif 46 - 41 + start_backtrace(&frame, 42 + (unsigned long)__builtin_frame_address(0), 43 + (unsigned long)return_address); 47 44 walk_stackframe(current, &frame, save_return_addr, &data); 48 45 49 46 if (!data.level)
+45 -14
arch/arm64/kernel/stacktrace.c
··· 29 29 * ldp x29, x30, [sp] 30 30 * add sp, sp, #0x10 31 31 */ 32 + 33 + /* 34 + * Unwind from one frame record (A) to the next frame record (B). 35 + * 36 + * We terminate early if the location of B indicates a malformed chain of frame 37 + * records (e.g. a cycle), determined based on the location and fp value of A 38 + * and the location (but not the fp value) of B. 39 + */ 32 40 int notrace unwind_frame(struct task_struct *tsk, struct stackframe *frame) 33 41 { 34 42 unsigned long fp = frame->fp; 43 + struct stack_info info; 35 44 36 45 if (fp & 0xf) 37 46 return -EINVAL; ··· 48 39 if (!tsk) 49 40 tsk = current; 50 41 51 - if (!on_accessible_stack(tsk, fp, NULL)) 42 + if (!on_accessible_stack(tsk, fp, &info)) 52 43 return -EINVAL; 53 44 45 + if (test_bit(info.type, frame->stacks_done)) 46 + return -EINVAL; 47 + 48 + /* 49 + * As stacks grow downward, any valid record on the same stack must be 50 + * at a strictly higher address than the prior record. 51 + * 52 + * Stacks can nest in several valid orders, e.g. 53 + * 54 + * TASK -> IRQ -> OVERFLOW -> SDEI_NORMAL 55 + * TASK -> SDEI_NORMAL -> SDEI_CRITICAL -> OVERFLOW 56 + * 57 + * ... but the nesting itself is strict. Once we transition from one 58 + * stack to another, it's never valid to unwind back to that first 59 + * stack. 60 + */ 61 + if (info.type == frame->prev_type) { 62 + if (fp <= frame->prev_fp) 63 + return -EINVAL; 64 + } else { 65 + set_bit(frame->prev_type, frame->stacks_done); 66 + } 67 + 68 + /* 69 + * Record this frame record's values and location. The prev_fp and 70 + * prev_type are only meaningful to the next unwind_frame() invocation. 71 + */ 54 72 frame->fp = READ_ONCE_NOCHECK(*(unsigned long *)(fp)); 55 73 frame->pc = READ_ONCE_NOCHECK(*(unsigned long *)(fp + 8)); 74 + frame->prev_fp = fp; 75 + frame->prev_type = info.type; 56 76 57 77 #ifdef CONFIG_FUNCTION_GRAPH_TRACER 58 78 if (tsk->ret_stack && ··· 160 122 data.skip = trace->skip; 161 123 data.no_sched_functions = 0; 162 124 163 - frame.fp = regs->regs[29]; 164 - frame.pc = regs->pc; 165 - #ifdef CONFIG_FUNCTION_GRAPH_TRACER 166 - frame.graph = 0; 167 - #endif 168 - 125 + start_backtrace(&frame, regs->regs[29], regs->pc); 169 126 walk_stackframe(current, &frame, save_trace, &data); 170 127 } 171 128 EXPORT_SYMBOL_GPL(save_stack_trace_regs); ··· 179 146 data.no_sched_functions = nosched; 180 147 181 148 if (tsk != current) { 182 - frame.fp = thread_saved_fp(tsk); 183 - frame.pc = thread_saved_pc(tsk); 149 + start_backtrace(&frame, thread_saved_fp(tsk), 150 + thread_saved_pc(tsk)); 184 151 } else { 185 152 /* We don't want this function nor the caller */ 186 153 data.skip += 2; 187 - frame.fp = (unsigned long)__builtin_frame_address(0); 188 - frame.pc = (unsigned long)__save_stack_trace; 154 + start_backtrace(&frame, 155 + (unsigned long)__builtin_frame_address(0), 156 + (unsigned long)__save_stack_trace); 189 157 } 190 - #ifdef CONFIG_FUNCTION_GRAPH_TRACER 191 - frame.graph = 0; 192 - #endif 193 158 194 159 walk_stackframe(tsk, &frame, save_trace, &data); 195 160
+2 -5
arch/arm64/kernel/time.c
··· 38 38 if (!in_lock_functions(regs->pc)) 39 39 return regs->pc; 40 40 41 - frame.fp = regs->regs[29]; 42 - frame.pc = regs->pc; 43 - #ifdef CONFIG_FUNCTION_GRAPH_TRACER 44 - frame.graph = 0; 45 - #endif 41 + start_backtrace(&frame, regs->regs[29], regs->pc); 42 + 46 43 do { 47 44 int ret = unwind_frame(NULL, &frame); 48 45 if (ret < 0)
+6 -7
arch/arm64/kernel/traps.c
··· 100 100 return; 101 101 102 102 if (tsk == current) { 103 - frame.fp = (unsigned long)__builtin_frame_address(0); 104 - frame.pc = (unsigned long)dump_backtrace; 103 + start_backtrace(&frame, 104 + (unsigned long)__builtin_frame_address(0), 105 + (unsigned long)dump_backtrace); 105 106 } else { 106 107 /* 107 108 * task blocked in __switch_to 108 109 */ 109 - frame.fp = thread_saved_fp(tsk); 110 - frame.pc = thread_saved_pc(tsk); 110 + start_backtrace(&frame, 111 + thread_saved_fp(tsk), 112 + thread_saved_pc(tsk)); 111 113 } 112 - #ifdef CONFIG_FUNCTION_GRAPH_TRACER 113 - frame.graph = 0; 114 - #endif 115 114 116 115 printk("Call trace:\n"); 117 116 do {
+6 -7
arch/arm64/kernel/vdso/Makefile
··· 32 32 OBJECT_FILES_NON_STANDARD := y 33 33 KCOV_INSTRUMENT := n 34 34 35 - ifeq ($(c-gettimeofday-y),) 36 35 CFLAGS_vgettimeofday.o = -O2 -mcmodel=tiny 37 - else 38 - CFLAGS_vgettimeofday.o = -O2 -mcmodel=tiny -include $(c-gettimeofday-y) 36 + 37 + ifneq ($(c-gettimeofday-y),) 38 + CFLAGS_vgettimeofday.o += -include $(c-gettimeofday-y) 39 39 endif 40 40 41 41 # Clang versions less than 8 do not support -mcmodel=tiny ··· 57 57 58 58 # Link rule for the .so file, .lds has to be first 59 59 $(obj)/vdso.so.dbg: $(obj)/vdso.lds $(obj-vdso) FORCE 60 - $(call if_changed,ld) 61 - $(call if_changed,vdso_check) 60 + $(call if_changed,vdsold_and_vdso_check) 62 61 63 62 # Strip rule for the .so file 64 63 $(obj)/%.so: OBJCOPYFLAGS := -S ··· 73 74 $(call if_changed,vdsosym) 74 75 75 76 # Actual build commands 76 - quiet_cmd_vdsocc = VDSOCC $@ 77 - cmd_vdsocc = $(CC) $(a_flags) $(c_flags) -c -o $@ $< 77 + quiet_cmd_vdsold_and_vdso_check = LD $@ 78 + cmd_vdsold_and_vdso_check = $(cmd_ld); $(cmd_vdso_check) 78 79 79 80 # Install commands for the unstripped file 80 81 quiet_cmd_vdso_install = INSTALL $@
+8 -6
arch/arm64/kernel/vdso32/Makefile
··· 144 144 145 145 # Link rule for the .so file, .lds has to be first 146 146 $(obj)/vdso.so.raw: $(src)/vdso.lds $(obj-vdso) FORCE 147 - $(call if_changed,vdsold) 148 - $(call if_changed,vdso_check) 147 + $(call if_changed,vdsold_and_vdso_check) 149 148 150 149 # Compilation rules for the vDSO sources 151 150 $(c-obj-vdso): %.o: %.c FORCE ··· 155 156 $(call if_changed_dep,vdsoas) 156 157 157 158 # Actual build commands 158 - quiet_cmd_vdsold = VDSOL $@ 159 + quiet_cmd_vdsold_and_vdso_check = LD32 $@ 160 + cmd_vdsold_and_vdso_check = $(cmd_vdsold); $(cmd_vdso_check) 161 + 162 + quiet_cmd_vdsold = LD32 $@ 159 163 cmd_vdsold = $(COMPATCC) -Wp,-MD,$(depfile) $(VDSO_LDFLAGS) \ 160 164 -Wl,-T $(filter %.lds,$^) $(filter %.o,$^) -o $@ 161 - quiet_cmd_vdsocc = VDSOC $@ 165 + quiet_cmd_vdsocc = CC32 $@ 162 166 cmd_vdsocc = $(COMPATCC) -Wp,-MD,$(depfile) $(VDSO_CFLAGS) -c -o $@ $< 163 - quiet_cmd_vdsocc_gettimeofday = VDSOC_GTD $@ 167 + quiet_cmd_vdsocc_gettimeofday = CC32 $@ 164 168 cmd_vdsocc_gettimeofday = $(COMPATCC) -Wp,-MD,$(depfile) $(VDSO_CFLAGS) $(VDSO_CFLAGS_gettimeofday_o) -c -o $@ $< 165 - quiet_cmd_vdsoas = VDSOA $@ 169 + quiet_cmd_vdsoas = AS32 $@ 166 170 cmd_vdsoas = $(COMPATCC) -Wp,-MD,$(depfile) $(VDSO_AFLAGS) -c -o $@ $< 167 171 168 172 quiet_cmd_vdsomunge = MUNGE $@
+2 -2
drivers/acpi/arm64/iort.c
··· 611 611 612 612 /* Move to ITS specific data */ 613 613 its = (struct acpi_iort_its_group *)node->node_data; 614 - if (idx > its->its_count) { 615 - dev_err(dev, "requested ITS ID index [%d] is greater than available [%d]\n", 614 + if (idx >= its->its_count) { 615 + dev_err(dev, "requested ITS ID index [%d] overruns ITS entries [%d]\n", 616 616 idx, its->its_count); 617 617 return -ENXIO; 618 618 }