]> www.infradead.org Git - users/jedix/linux-maple.git/commit
Drivers: hv: vmbus: prefer 'die' notification chain to 'panic'
authorVitaly Kuznetsov <vkuznets@redhat.com>
Sat, 1 Aug 2015 23:08:10 +0000 (16:08 -0700)
committerChuck Anderson <chuck.anderson@oracle.com>
Fri, 26 Feb 2016 02:29:01 +0000 (18:29 -0800)
commit34049f6213216eb70c3711d21b2a50d3a9325daa
tree6ebd2d9d6958489e7e5ce2284c5d994eb76ca4fa
parent38dd563183eb198a223a7091a6f70edd362713e5
Drivers: hv: vmbus: prefer 'die' notification chain to 'panic'

current_pt_regs() sometimes returns regs of the userspace process and in
case of a kernel crash this is not what we need to report. E.g. when we
trigger crash with sysrq we see the following:
...
 RIP: 0010:[<ffffffff815b8696>]  [<ffffffff815b8696>] sysrq_handle_crash+0x16/0x20
 RSP: 0018:ffff8800db0a7d88  EFLAGS: 00010246
 RAX: 000000000000000f RBX: ffffffff820a0660 RCX: 0000000000000000
...
at the same time current_pt_regs() give us:
ip=7f899ea7e9e0, ax=ffffffffffffffda, bx=26c81a0, cx=7f899ea7e9e0, ...
These registers come from the userspace process triggered the crash. As we
don't even know which process it was this information is rather useless.

When kernel crash happens through 'die' proper regs are being passed to
all receivers on the die_chain (and panic_notifier_list is being notified
with the string passed to panic() only). If panic() is called manually
(e.g. on BUG()) we won't get 'die' notification so keep the 'panic'
notification reporter as well but guard against double reporting.

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 510f7aef65bb7ed22cf9c7f94f955727f963ede4)

Orabug: 21886720
Signed-off-by: Jason Luo <zhangqing.luo@oracle.com>
drivers/hv/vmbus_drv.c