)]}'
{
  "commit": "0bb568ce748783deb682a048664312e71fd30644",
  "tree": "7c576479ffa54519c8e90846e14a8a8f72c46f7b",
  "parents": [
    "b4c87df0d21c564c0af4ff4ca7a6288bc1348fbe"
  ],
  "author": {
    "name": "Michael Ellerman",
    "email": "mpe@ellerman.id.au",
    "time": "Thu May 28 00:58:40 2020 +1000"
  },
  "committer": {
    "name": "Greg Kroah-Hartman",
    "email": "gregkh@linuxfoundation.org",
    "time": "Thu Aug 27 09:30:50 2020 +0200"
  },
  "message": "powerpc/64s: Don\u0027t init FSCR_DSCR in __init_FSCR()\n\ncommit 0828137e8f16721842468e33df0460044a0c588b upstream.\n\n__init_FSCR() was added originally in commit 2468dcf641e4 (\"powerpc:\nAdd support for context switching the TAR register\") (Feb 2013), and\nonly set FSCR_TAR.\n\nAt that point FSCR (Facility Status and Control Register) was not\ncontext switched, so the setting was permanent after boot.\n\nLater we added initialisation of FSCR_DSCR to __init_FSCR(), in commit\n54c9b2253d34 (\"powerpc: Set DSCR bit in FSCR setup\") (Mar 2013), again\nthat was permanent after boot.\n\nThen commit 2517617e0de6 (\"powerpc: Fix context switch DSCR on\nPOWER8\") (Aug 2013) added a limited context switch of FSCR, just the\nFSCR_DSCR bit was context switched based on thread.dscr_inherit. That\ncommit said \"This clears the H/FSCR DSCR bit initially\", but it\ndidn\u0027t, it left the initialisation of FSCR_DSCR in __init_FSCR().\nHowever the initial context switch from init_task to pid 1 would clear\nFSCR_DSCR because thread.dscr_inherit was 0.\n\nThat commit also introduced the requirement that FSCR_DSCR be clear\nfor user processes, so that we can take the facility unavailable\ninterrupt in order to manage dscr_inherit.\n\nThen in commit 152d523e6307 (\"powerpc: Create context switch helpers\nsave_sprs() and restore_sprs()\") (Dec 2015) FSCR was added to\nthread_struct. However it still wasn\u0027t fully context switched, we just\ntook the existing value and set FSCR_DSCR if the new thread had\ndscr_inherit set. FSCR was still initialised at boot to FSCR_DSCR |\nFSCR_TAR, but that value was not propagated into the thread_struct, so\nthe initial context switch set FSCR_DSCR back to 0.\n\nFinally commit b57bd2de8c6c (\"powerpc: Improve FSCR init and context\nswitching\") (Jun 2016) added a full context switch of the FSCR, and\nadded an initialisation of init_task.thread.fscr to FSCR_TAR |\nFSCR_EBB, but omitted FSCR_DSCR.\n\nThe end result is that swapper runs with FSCR_DSCR set because of the\ninitialisation in __init_FSCR(), but no other processes do, they use\nthe value from init_task.thread.fscr.\n\nHaving FSCR_DSCR set for swapper allows it to access SPR 3 from\nuserspace, but swapper never runs userspace, so it has no useful\neffect. It\u0027s also confusing to have the value initialised in two\nplaces to two different values.\n\nSo remove FSCR_DSCR from __init_FSCR(), this at least gets us to the\npoint where there\u0027s a single value of FSCR, even if it\u0027s still set in\ntwo places.\n\nSigned-off-by: Michael Ellerman \u003cmpe@ellerman.id.au\u003e\nTested-by: Alistair Popple \u003calistair@popple.id.au\u003e\nLink: https://lore.kernel.org/r/20200527145843.2761782-1-mpe@ellerman.id.au\nCc: Thadeu Lima de Souza Cascardo \u003ccascardo@canonical.com\u003e\nSigned-off-by: Greg Kroah-Hartman \u003cgregkh@linuxfoundation.org\u003e\n\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "a460298c7ddb473b5a7978b64eb6e8a94701fc27",
      "old_mode": 33188,
      "old_path": "arch/powerpc/kernel/cpu_setup_power.S",
      "new_id": "f91ecb10d0ae758604578cc5d97990f9dcf14466",
      "new_mode": 33188,
      "new_path": "arch/powerpc/kernel/cpu_setup_power.S"
    }
  ]
}
