)]}'
{
  "commit": "cce5ff15107be5b439936ca12c02fccc78a6954d",
  "tree": "0c6b8854ee9f3e45c8a95aa817dead547209d15a",
  "parents": [
    "a980762f70d7048825e6ce9e42ceb6b5f87a5e44"
  ],
  "author": {
    "name": "Andy Ross",
    "email": "andrew.j.ross@intel.com",
    "time": "Wed Feb 03 12:56:51 2021 -0800"
  },
  "committer": {
    "name": "Anas Nashif",
    "email": "anas.nashif@intel.com",
    "time": "Wed Feb 03 18:45:48 2021 -0500"
  },
  "message": "arch/x86: Fix stack alignment for user threads\n\nThe x86_64 SysV ABI requires 16 byte alignment for the stack pointer\nduring execution of normal code.  That means that on entry to an\nABI-compatible C function (which is reached via a CALL instruction\nthat pushes the return address) the RSP register must be MISaligned by\nexactly 8 bytes.  The kernel mode thread setup got this right, but we\nmissed the equivalent condition in userspace entry.\n\nThe end result was a misaligned stack, which is surprisingly robust\nfor most use.  But recent toolchains have starting doing some more\nelaborate vectorization, and the resulting SSE instructions started\nfailing in userspace on the misaliged loads.\n\nNote that there\u0027s a comment about optimization: we\u0027re doing the stack\nalignment in the \"wrong place\" and are needlessly wasting bytes in\nsome cases.  We should see the raw stack boundaries where we are\nsetting up RSP values.  Add a FIXME to this effect, but don\u0027t touch\nanything as this patch is a targeted bugfix.\n\nAlso fix a somewhat embarassing 32-bit-ism that would have truncated\nthe address of a userspace stack that we tried to put above 4G.\n\nFixes #31018\n\nSigned-off-by: Andy Ross \u003candrew.j.ross@intel.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "451f34b50caef58394df5281ecf1486ae18ff49e",
      "old_mode": 33188,
      "old_path": "arch/x86/core/intel64/thread.c",
      "new_id": "d0e44503948a71592e67d0075b17effb01ceb548",
      "new_mode": 33188,
      "new_path": "arch/x86/core/intel64/thread.c"
    },
    {
      "type": "modify",
      "old_id": "98027ff50fa1b1b3e7590078ba68ad0248cccb04",
      "old_mode": 33188,
      "old_path": "arch/x86/core/userspace.c",
      "new_id": "43d02af23ec35b3d24dc6d37f00657bec84016ca",
      "new_mode": 33188,
      "new_path": "arch/x86/core/userspace.c"
    }
  ]
}
