linux-stable/arch/s390
Vasily Gorbik da99331fc6 s390/entry: save the caller of psw_idle
[ Upstream commit a994eddb94 ]

Currently psw_idle does not allocate a stack frame and does not
save its r14 and r15 into the save area. Even though this is valid from
call ABI point of view, because psw_idle does not make any calls
explicitly, in reality psw_idle is an entry point for controlled
transition into serving interrupts. So, in practice, psw_idle stack
frame is analyzed during stack unwinding. Depending on build options
that r14 slot in the save area of psw_idle might either contain a value
saved by previous sibling call or complete garbage.

  [task    0000038000003c28] do_ext_irq+0xd6/0x160
  [task    0000038000003c78] ext_int_handler+0xba/0xe8
  [task   *0000038000003dd8] psw_idle_exit+0x0/0x8 <-- pt_regs
 ([task    0000038000003dd8] 0x0)
  [task    0000038000003e10] default_idle_call+0x42/0x148
  [task    0000038000003e30] do_idle+0xce/0x160
  [task    0000038000003e70] cpu_startup_entry+0x36/0x40
  [task    0000038000003ea0] arch_call_rest_init+0x76/0x80

So, to make a stacktrace nicer and actually point for the real caller of
psw_idle in this frequently occurring case, make psw_idle save its r14.

  [task    0000038000003c28] do_ext_irq+0xd6/0x160
  [task    0000038000003c78] ext_int_handler+0xba/0xe8
  [task   *0000038000003dd8] psw_idle_exit+0x0/0x6 <-- pt_regs
 ([task    0000038000003dd8] arch_cpu_idle+0x3c/0xd0)
  [task    0000038000003e10] default_idle_call+0x42/0x148
  [task    0000038000003e30] do_idle+0xce/0x160
  [task    0000038000003e70] cpu_startup_entry+0x36/0x40
  [task    0000038000003ea0] arch_call_rest_init+0x76/0x80

Reviewed-by: Sven Schnelle <svens@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-04-28 13:40:02 +02:00
..
appldata s390/appldata: use struct_size() helper 2020-06-29 16:32:34 +02:00
boot s390: uv: Fix sysfs max number of VCPUs reporting 2021-02-03 23:28:39 +01:00
configs s390: update defconfigs 2020-11-12 12:10:36 +01:00
crypto mm, treewide: rename kzfree() to kfree_sensitive() 2020-08-07 11:33:22 -07:00
hypfs
include s390/vdso: fix tod_steering_delta type 2021-04-07 15:00:10 +02:00
kernel s390/entry: save the caller of psw_idle 2021-04-28 13:40:02 +02:00
kvm KVM: s390: remove diag318 reset code 2020-11-11 09:31:52 +01:00
lib s390/test_unwind: fix CALL_ON_STACK tests 2020-12-30 11:53:56 +01:00
mm KVM: s390: pv: Mark mm as protected after the set secure parameters and improve cleanup 2020-11-11 09:31:48 +01:00
net s390/bpf: Fix multiple tail calls 2020-09-14 18:21:31 -07:00
oprofile
pci s390/pci: fix leak of PCI device structure 2021-03-25 09:04:05 +01:00
purgatory s390/kexec_file: fix diag308 subcode when loading crash kernel 2020-12-30 11:54:08 +01:00
tools .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
Kbuild s390/numa: move code to arch/s390/kernel 2020-08-11 18:16:55 +02:00
Kconfig vhost,vdpa,virtio: cleanups, fixes 2020-10-23 11:00:57 -07:00
Kconfig.debug s390/mm,ptdump: convert to generic page table dumper 2020-09-14 11:38:34 +02:00
Makefile kbuild: remove cc-option test of -ffreestanding 2020-07-07 11:13:10 +09:00