)]}'
{
  "commit": "406f992e4a372dafbe3c2cff7efbb2002a5c8ebd",
  "tree": "e56632536cd2de2b13c258a760fa832b653961af",
  "parents": [
    "4c0b6c10fbaf0c82efe2a7ba6c236c633d4f2ed7"
  ],
  "author": {
    "name": "Rafael J. Wysocki",
    "email": "rafael.j.wysocki@intel.com",
    "time": "Thu Jul 14 03:55:23 2016 +0200"
  },
  "committer": {
    "name": "Rafael J. Wysocki",
    "email": "rafael.j.wysocki@intel.com",
    "time": "Fri Jul 15 22:42:48 2016 +0200"
  },
  "message": "x86 / hibernate: Use hlt_play_dead() when resuming from hibernation\n\nOn Intel hardware, native_play_dead() uses mwait_play_dead() by\ndefault and only falls back to the other methods if that fails.\nThat also happens during resume from hibernation, when the restore\n(boot) kernel runs disable_nonboot_cpus() to take all of the CPUs\nexcept for the boot one offline.\n\nHowever, that is problematic, because the address passed to\n__monitor() in mwait_play_dead() is likely to be written to in the\nlast phase of hibernate image restoration and that causes the \"dead\"\nCPU to start executing instructions again.  Unfortunately, the page\ncontaining the address in that CPU\u0027s instruction pointer may not be\nvalid any more at that point.\n\nFirst, that page may have been overwritten with image kernel memory\ncontents already, so the instructions the CPU attempts to execute may\nsimply be invalid.  Second, the page tables previously used by that\nCPU may have been overwritten by image kernel memory contents, so the\naddress in its instruction pointer is impossible to resolve then.\n\nA report from Varun Koyyalagunta and investigation carried out by\nChen Yu show that the latter sometimes happens in practice.\n\nTo prevent it from happening, temporarily change the smp_ops.play_dead\npointer during resume from hibernation so that it points to a special\n\"play dead\" routine which uses hlt_play_dead() and avoids the\ninadvertent \"revivals\" of \"dead\" CPUs this way.\n\nA slightly unpleasant consequence of this change is that if the\nsystem is hibernated with one or more CPUs offline, it will generally\ndraw more power after resume than it did before hibernation, because\nthe physical state entered by CPUs via hlt_play_dead() is higher-power\nthan the mwait_play_dead() one in the majority of cases.  It is\npossible to work around this, but it is unclear how much of a problem\nthat\u0027s going to be in practice, so the workaround will be implemented\nlater if it turns out to be necessary.\n\nLink: https://bugzilla.kernel.org/show_bug.cgi?id\u003d106371\nReported-by: Varun Koyyalagunta \u003ccpudebug@centtech.com\u003e\nOriginal-by: Chen Yu \u003cyu.c.chen@intel.com\u003e\nTested-by: Chen Yu \u003cyu.c.chen@intel.com\u003e\nSigned-off-by: Rafael J. Wysocki \u003crafael.j.wysocki@intel.com\u003e\nAcked-by: Ingo Molnar \u003cmingo@kernel.org\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "66b057306f404718c233c18c5603ec30e9e535ba",
      "old_mode": 33188,
      "old_path": "arch/x86/include/asm/smp.h",
      "new_id": "7427ca895a276204bc14b36f496d8a0a22a0af51",
      "new_mode": 33188,
      "new_path": "arch/x86/include/asm/smp.h"
    },
    {
      "type": "modify",
      "old_id": "fafe8b923cac2d27da4189e6be9a2761bfcd6d01",
      "old_mode": 33188,
      "old_path": "arch/x86/kernel/smpboot.c",
      "new_id": "8264dfad9cf874a982ae4bdab5c51e1d9d87f1f8",
      "new_mode": 33188,
      "new_path": "arch/x86/kernel/smpboot.c"
    },
    {
      "type": "modify",
      "old_id": "d5f64996394a97a293aa90149aee54a9636bc6de",
      "old_mode": 33188,
      "old_path": "arch/x86/power/cpu.c",
      "new_id": "b12c26e2e309541c7afdb587835d48589da5a4fd",
      "new_mode": 33188,
      "new_path": "arch/x86/power/cpu.c"
    },
    {
      "type": "modify",
      "old_id": "51441d87f0b6470804b122e5e369bfad9b21d08a",
      "old_mode": 33188,
      "old_path": "kernel/power/hibernate.c",
      "new_id": "5f3523e18e46ba6e1f6fbbb660ac40ce3bae9c6b",
      "new_mode": 33188,
      "new_path": "kernel/power/hibernate.c"
    },
    {
      "type": "modify",
      "old_id": "064963e8919428cde628b6827ba097747b235925",
      "old_mode": 33188,
      "old_path": "kernel/power/power.h",
      "new_id": "242d8b827dd5f5c6724481bb96b50a7e04553eab",
      "new_mode": 33188,
      "new_path": "kernel/power/power.h"
    }
  ]
}
