linux-snapdragon/arch/s390
Vasily Gorbik e0f8639c87 s390/unwind: use current_frame_address() to unwind current task
[ Upstream commit 88b604263f3d6eedae0b1c2c3bbd602d1e2e8775 ]

current_stack_pointer() simply returns current value of %r15. If
current_stack_pointer() caller allocates stack (which is the case in
unwind code) %r15 points to a stack frame allocated for callees, meaning
current_stack_pointer() caller (e.g. stack_trace_save) will end up in
the stacktrace. This is not expected by stack_trace_save*() callers and
causes problems.

current_frame_address() on the other hand returns function stack frame
address, which matches %r15 upon function invocation. Using it in
get_stack_pointer() makes it more aligned with x86 implementation
(according to BACKTRACE_SELF_TEST output) and meets stack_trace_save*()
caller's expectations, notably KCSAN.

Also make sure unwind_start is always inlined.

Reported-by: Nathan Chancellor <nathan@kernel.org>
Suggested-by: Marco Elver <elver@google.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Tested-by: Marco Elver <elver@google.com>
Tested-by: Nathan Chancellor <nathan@kernel.org>
Link: https://lore.kernel.org/r/patch.git-04dd26be3043.your-ad-here.call-01630504868-ext-6188@work.hours
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-09-26 14:10:22 +02:00
..
appldata s390/appldata: use struct_size() helper 2020-06-29 16:32:34 +02:00
boot s390/boot: fix zstd build for -march=z900 2021-07-30 17:08:22 +02:00
configs s390: update defconfigs 2021-08-03 14:31:24 +02:00
crypto s390/archrandom: add parameter check for s390_arch_random_generate 2021-04-21 12:32:12 +02:00
hypfs s390/hypfs: use register pair instead of register asm 2021-06-28 11:18:28 +02:00
include s390/unwind: use current_frame_address() to unwind current task 2021-09-26 14:10:22 +02:00
kernel s390: add kmemleak annotation in stack_alloc() 2021-09-26 14:10:21 +02:00
kvm KVM: s390: index kvm->arch.idle_mask by vcpu_idx 2021-09-15 10:02:34 +02:00
lib s390/lib: use call_on_stack() macro 2021-07-08 22:12:18 +02:00
mm s390/pv: fix the forcing of the swiotlb 2021-09-18 13:44:01 +02:00
net s390/bpf: Fix branch shortening during codegen pass 2021-09-22 12:39:33 +02:00
pci s390/pci_mmio: fully validate the VMA before calling follow_pte() 2021-09-22 12:39:22 +02:00
purgatory s390: disable SSP when needed 2021-06-07 17:07:00 +02:00
tools KVM: s390: gen_facilities: allow facilities 165, 193, 194 and 196 2021-06-23 09:35:03 +02:00
Kbuild s390/numa: move code to arch/s390/kernel 2020-08-11 18:16:55 +02:00
Kconfig s390/vdso: add minimal compat vdso 2021-07-08 15:37:28 +02:00
Kconfig.debug s390/cio: add CRW inject functionality 2021-03-22 11:36:04 +01:00
Makefile Kbuild updates for v5.14 2021-07-10 11:01:38 -07:00