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

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 's390-5.5-4' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux

Pull s390 fixes from Vasily Gorbik:

- Fix unwinding from irq context of interrupted user process.

- Add purgatory build missing symbols check. That helped to uncover and
fix missing symbols when built with kasan support enabled.

- Couple of ftrace fixes. Avoid broken stack trace and fix recursion
loop in function_graph tracer.

* tag 's390-5.5-4' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
s390/ftrace: save traced function caller
s390/unwind: stop gracefully at user mode pt_regs in irq stack
s390/purgatory: do not build purgatory with kcov, kasan and friends
s390/purgatory: Make sure we fail the build if purgatory has missing symbols
s390/ftrace: fix endless recursion in function_graph tracer

+32 -11
+2 -2
arch/s390/include/asm/timex.h
··· 194 194 { 195 195 unsigned long long tod; 196 196 197 - preempt_disable(); 197 + preempt_disable_notrace(); 198 198 tod = get_tod_clock() - *(unsigned long long *) &tod_clock_base[1]; 199 - preempt_enable(); 199 + preempt_enable_notrace(); 200 200 return tod; 201 201 } 202 202
+1
arch/s390/kernel/mcount.S
··· 35 35 ENTRY(ftrace_caller) 36 36 .globl ftrace_regs_caller 37 37 .set ftrace_regs_caller,ftrace_caller 38 + stg %r14,(__SF_GPRS+8*8)(%r15) # save traced function caller 38 39 lgr %r1,%r15 39 40 #if !(defined(CC_USING_HOTPATCH) || defined(CC_USING_NOP_MCOUNT)) 40 41 aghi %r0,MCOUNT_RETURN_FIXUP
+11 -4
arch/s390/kernel/unwind_bc.c
··· 36 36 return true; 37 37 } 38 38 39 - static inline bool is_task_pt_regs(struct unwind_state *state, 40 - struct pt_regs *regs) 39 + static inline bool is_final_pt_regs(struct unwind_state *state, 40 + struct pt_regs *regs) 41 41 { 42 - return task_pt_regs(state->task) == regs; 42 + /* user mode or kernel thread pt_regs at the bottom of task stack */ 43 + if (task_pt_regs(state->task) == regs) 44 + return true; 45 + 46 + /* user mode pt_regs at the bottom of irq stack */ 47 + return state->stack_info.type == STACK_TYPE_IRQ && 48 + state->stack_info.end - sizeof(struct pt_regs) == (unsigned long)regs && 49 + READ_ONCE_NOCHECK(regs->psw.mask) & PSW_MASK_PSTATE; 43 50 } 44 51 45 52 bool unwind_next_frame(struct unwind_state *state) ··· 87 80 if (!on_stack(info, sp, sizeof(struct pt_regs))) 88 81 goto out_err; 89 82 regs = (struct pt_regs *) sp; 90 - if (is_task_pt_regs(state, regs)) 83 + if (is_final_pt_regs(state, regs)) 91 84 goto out_stop; 92 85 ip = READ_ONCE_NOCHECK(regs->psw.addr); 93 86 sp = READ_ONCE_NOCHECK(regs->gprs[15]);
+1
arch/s390/purgatory/.gitignore
··· 1 1 purgatory 2 + purgatory.chk 2 3 purgatory.lds 3 4 purgatory.ro
+14 -5
arch/s390/purgatory/Makefile
··· 4 4 5 5 purgatory-y := head.o purgatory.o string.o sha256.o mem.o 6 6 7 - targets += $(purgatory-y) purgatory.lds purgatory purgatory.ro 7 + targets += $(purgatory-y) purgatory.lds purgatory purgatory.chk purgatory.ro 8 8 PURGATORY_OBJS = $(addprefix $(obj)/,$(purgatory-y)) 9 9 10 10 $(obj)/sha256.o: $(srctree)/lib/crypto/sha256.c FORCE ··· 15 15 $(obj)/mem.o: $(srctree)/arch/s390/lib/mem.S FORCE 16 16 $(call if_changed_rule,as_o_S) 17 17 18 - $(obj)/string.o: $(srctree)/arch/s390/lib/string.c FORCE 19 - $(call if_changed_rule,cc_o_c) 18 + KCOV_INSTRUMENT := n 19 + GCOV_PROFILE := n 20 + UBSAN_SANITIZE := n 21 + KASAN_SANITIZE := n 20 22 21 23 KBUILD_CFLAGS := -fno-strict-aliasing -Wall -Wstrict-prototypes 22 24 KBUILD_CFLAGS += -Wno-pointer-sign -Wno-sign-compare ··· 28 26 KBUILD_CFLAGS += $(call cc-option,-fno-PIE) 29 27 KBUILD_AFLAGS := $(filter-out -DCC_USING_EXPOLINE,$(KBUILD_AFLAGS)) 30 28 31 - LDFLAGS_purgatory := -r --no-undefined -nostdlib -z nodefaultlib -T 29 + # Since we link purgatory with -r unresolved symbols are not checked, so we 30 + # also link a purgatory.chk binary without -r to check for unresolved symbols. 31 + PURGATORY_LDFLAGS := -nostdlib -z nodefaultlib 32 + LDFLAGS_purgatory := -r $(PURGATORY_LDFLAGS) -T 33 + LDFLAGS_purgatory.chk := -e purgatory_start $(PURGATORY_LDFLAGS) 32 34 $(obj)/purgatory: $(obj)/purgatory.lds $(PURGATORY_OBJS) FORCE 35 + $(call if_changed,ld) 36 + 37 + $(obj)/purgatory.chk: $(obj)/purgatory FORCE 33 38 $(call if_changed,ld) 34 39 35 40 OBJCOPYFLAGS_purgatory.ro := -O elf64-s390 36 41 OBJCOPYFLAGS_purgatory.ro += --remove-section='*debug*' 37 42 OBJCOPYFLAGS_purgatory.ro += --remove-section='.comment' 38 43 OBJCOPYFLAGS_purgatory.ro += --remove-section='.note.*' 39 - $(obj)/purgatory.ro: $(obj)/purgatory FORCE 44 + $(obj)/purgatory.ro: $(obj)/purgatory $(obj)/purgatory.chk FORCE 40 45 $(call if_changed,objcopy) 41 46 42 47 $(obj)/kexec-purgatory.o: $(obj)/kexec-purgatory.S $(obj)/purgatory.ro FORCE
+3
arch/s390/purgatory/string.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + #define __HAVE_ARCH_MEMCMP /* arch function */ 3 + #include "../lib/string.c"