)]}'
{
  "commit": "58c5661f2144c089bbc2e5d87c9ec1dc1d2964fe",
  "tree": "6d466c97de452fc1376dc0bd1fcaf03ff595d1df",
  "parents": [
    "1717f2096b543cede7a380c858c765c41936bc35"
  ],
  "author": {
    "name": "Hidehiro Kawai",
    "email": "hidehiro.kawai.ez@hitachi.com",
    "time": "Mon Dec 14 11:19:10 2015 +0100"
  },
  "committer": {
    "name": "Thomas Gleixner",
    "email": "tglx@linutronix.de",
    "time": "Sat Dec 19 11:07:01 2015 +0100"
  },
  "message": "panic, x86: Allow CPUs to save registers even if looping in NMI context\n\nCurrently, kdump_nmi_shootdown_cpus(), a subroutine of crash_kexec(),\nsends an NMI IPI to CPUs which haven\u0027t called panic() to stop them,\nsave their register information and do some cleanups for crash dumping.\nHowever, if such a CPU is infinitely looping in NMI context, we fail to\nsave its register information into the crash dump.\n\nFor example, this can happen when unknown NMIs are broadcast to all\nCPUs as follows:\n\n  CPU 0                             CPU 1\n  \u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d       \u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\n  receive an unknown NMI\n  unknown_nmi_error()\n    panic()                         receive an unknown NMI\n      spin_trylock(\u0026panic_lock)     unknown_nmi_error()\n      crash_kexec()                   panic()\n                                        spin_trylock(\u0026panic_lock)\n                                        panic_smp_self_stop()\n                                          infinite loop\n        kdump_nmi_shootdown_cpus()\n          issue NMI IPI -----------\u003e blocked until IRET\n                                          infinite loop...\n\nHere, since CPU 1 is in NMI context, the second NMI from CPU 0 is\nblocked until CPU 1 executes IRET. However, CPU 1 never executes IRET,\nso the NMI is not handled and the callback function to save registers is\nnever called.\n\nIn practice, this can happen on some servers which broadcast NMIs to all\nCPUs when the NMI button is pushed.\n\nTo save registers in this case, we need to:\n\n  a) Return from NMI handler instead of looping infinitely\n  or\n  b) Call the callback function directly from the infinite loop\n\nInherently, a) is risky because NMI is also used to prevent corrupted\ndata from being propagated to devices.  So, we chose b).\n\nThis patch does the following:\n\n1. Move the infinite looping of CPUs which haven\u0027t called panic() in NMI\n   context (actually done by panic_smp_self_stop()) outside of panic() to\n   enable us to refer pt_regs. Please note that panic_smp_self_stop() is\n   still used for normal context.\n\n2. Call a callback of kdump_nmi_shootdown_cpus() directly to save\n   registers and do some cleanups after setting waiting_for_crash_ipi which\n   is used for counting down the number of CPUs which handled the callback\n\nSigned-off-by: Hidehiro Kawai \u003chidehiro.kawai.ez@hitachi.com\u003e\nAcked-by: Michal Hocko \u003cmhocko@suse.com\u003e\nCc: Aaron Tomlin \u003catomlin@redhat.com\u003e\nCc: Andrew Morton \u003cakpm@linux-foundation.org\u003e\nCc: Andy Lutomirski \u003cluto@kernel.org\u003e\nCc: Baoquan He \u003cbhe@redhat.com\u003e\nCc: Chris Metcalf \u003ccmetcalf@ezchip.com\u003e\nCc: Dave Young \u003cdyoung@redhat.com\u003e\nCc: David Hildenbrand \u003cdahi@linux.vnet.ibm.com\u003e\nCc: Don Zickus \u003cdzickus@redhat.com\u003e\nCc: Eric Biederman \u003cebiederm@xmission.com\u003e\nCc: Frederic Weisbecker \u003cfweisbec@gmail.com\u003e\nCc: Gobinda Charan Maji \u003cgobinda.cemk07@gmail.com\u003e\nCc: HATAYAMA Daisuke \u003cd.hatayama@jp.fujitsu.com\u003e\nCc: Hidehiro Kawai \u003chidehiro.kawai.ez@hitachi.com\u003e\nCc: \"H. Peter Anvin\" \u003chpa@zytor.com\u003e\nCc: Ingo Molnar \u003cmingo@kernel.org\u003e\nCc: Javi Merino \u003cjavi.merino@arm.com\u003e\nCc: Jiang Liu \u003cjiang.liu@linux.intel.com\u003e\nCc: Jonathan Corbet \u003ccorbet@lwn.net\u003e\nCc: kexec@lists.infradead.org\nCc: linux-doc@vger.kernel.org\nCc: lkml \u003clinux-kernel@vger.kernel.org\u003e\nCc: Masami Hiramatsu \u003cmasami.hiramatsu.pt@hitachi.com\u003e\nCc: Michal Nazarewicz \u003cmina86@mina86.com\u003e\nCc: Nicolas Iooss \u003cnicolas.iooss_linux@m4x.org\u003e\nCc: Oleg Nesterov \u003coleg@redhat.com\u003e\nCc: Peter Zijlstra \u003cpeterz@infradead.org\u003e\nCc: Prarit Bhargava \u003cprarit@redhat.com\u003e\nCc: Rasmus Villemoes \u003clinux@rasmusvillemoes.dk\u003e\nCc: Seth Jennings \u003csjenning@redhat.com\u003e\nCc: Stefan Lippers-Hollmann \u003cs.l-h@gmx.de\u003e\nCc: Steven Rostedt \u003crostedt@goodmis.org\u003e\nCc: Thomas Gleixner \u003ctglx@linutronix.de\u003e\nCc: Ulrich Obergfell \u003cuobergfe@redhat.com\u003e\nCc: Vitaly Kuznetsov \u003cvkuznets@redhat.com\u003e\nCc: Vivek Goyal \u003cvgoyal@redhat.com\u003e\nCc: Yasuaki Ishimatsu \u003cisimatu.yasuaki@jp.fujitsu.com\u003e\nLink: http://lkml.kernel.org/r/20151210014628.25437.75256.stgit@softrs\n[ Cleanup comments, fixup formatting. ]\nSigned-off-by: Borislav Petkov \u003cbp@suse.de\u003e\nSigned-off-by: Thomas Gleixner \u003ctglx@linutronix.de\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "fca87938d739a15e1828e53e6cc706902bad4662",
      "old_mode": 33188,
      "old_path": "arch/x86/kernel/nmi.c",
      "new_id": "424aec4a4c712aa211def505f0df7b448c4bb0ed",
      "new_mode": 33188,
      "new_path": "arch/x86/kernel/nmi.c"
    },
    {
      "type": "modify",
      "old_id": "02693dd9a0790b804a515294714d59ed68688ba8",
      "old_mode": 33188,
      "old_path": "arch/x86/kernel/reboot.c",
      "new_id": "1da13022d544475a67ee6a69565ce7e2d63a82c4",
      "new_mode": 33188,
      "new_path": "arch/x86/kernel/reboot.c"
    },
    {
      "type": "modify",
      "old_id": "750cc5c7c99980e6ea32fc61967ee9f3990f37c2",
      "old_mode": 33188,
      "old_path": "include/linux/kernel.h",
      "new_id": "7311c3294e25f22a610209a63115c3d0778ecd0b",
      "new_mode": 33188,
      "new_path": "include/linux/kernel.h"
    },
    {
      "type": "modify",
      "old_id": "3344524cf6ffd658c901b383af317aa095e4cff0",
      "old_mode": 33188,
      "old_path": "kernel/panic.c",
      "new_id": "06f31b49b3b4775c2d55f3a02435fb858764ce53",
      "new_mode": 33188,
      "new_path": "kernel/panic.c"
    },
    {
      "type": "modify",
      "old_id": "b9be18fae15455f7483c0fba4f9ada15f232ff7d",
      "old_mode": 33188,
      "old_path": "kernel/watchdog.c",
      "new_id": "84b5035cb6a57099362ec9ab6056d6c936f5b706",
      "new_mode": 33188,
      "new_path": "kernel/watchdog.c"
    }
  ]
}
