)]}'
{
  "commit": "a8be5e9478be08f09a720f7013ec30d6e2bd9fcc",
  "tree": "ec25b77714dc1492dbdb87a92ebadd183c6a5167",
  "parents": [
    "914aeddaf16d91d39112056c5dd2b013b757a424"
  ],
  "author": {
    "name": "Bo Gan",
    "email": "ganboing@gmail.com",
    "time": "Mon Jun 08 23:00:24 2026 -0700"
  },
  "committer": {
    "name": "Anup Patel",
    "email": "anup@brainfault.org",
    "time": "Wed Jun 17 11:43:38 2026 +0530"
  },
  "message": "lib: sbi: Rework misaligned vector load/store\n\nFix the following issues with misaligned vector load/store:\n\na. Stack overflow: the mask[VLEN_MAX / 8] variable consumes 8K stack\nspace, given VLEN_MAX\u003d65536, overflowing the default-sized stack.\nThere\u0027s no need to fetch the whole mask in one go, instead, make it\non-demand. Use a 128-byte mask as local buffer to hold the sliding\nwindow of mask. For rvv load, this is allowed -- from the spec:\n\n  \"The destination vector register group for a masked vector\n   instruction cannot overlap the source mask register (v0),\n   unless the destination vector register is being written with\n   a mask value (e.g., compares) or the scalar result of a reduction\"\n\nWe don\u0027t need to worry about the mask getting overwritten.\n\nb. Maintain the value of vstart upon abort (uptrap) to avoid duplicate\nwork. After fault resolution, the instruction can restart from the\nfaulting vstart. For Fault-Only-First loads, reset vstart to 0, as\npreviously done so, to conform to spec.\n\nc. Explicitly set VS dirty in VSSTATUS with SET_VS_DIRTY() if faulting\nfrom V\u003d1, and if any vector register, including vstart/vl/vtype, gets\nchanged in the handler. It can add 1 unnecessary op to set VS dirty\nin M/SSTATUS (not VSSTATUS), where the HW already did, but for code\nsimplicity, do it anyway. The overhead should be negligible.\n\nSigned-off-by: Bo Gan \u003cganboing@gmail.com\u003e\nTested-by: Anirudh Srinivasan \u003casrinivasan@oss.tenstorrent.com\u003e\nReviewed-by: Anup Patel \u003canup@brainfault.org\u003e\nLink: https://lore.kernel.org/r/20260609060024.706-5-ganboing@gmail.com\nSigned-off-by: Anup Patel \u003canup@brainfault.org\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "f00184f0914c7ce35b429711ec05c6d255b1d148",
      "old_mode": 33188,
      "old_path": "include/sbi/sbi_vector.h",
      "new_id": "c14f3174f01ebab681dac2f56ff83a700a06b54b",
      "new_mode": 33188,
      "new_path": "include/sbi/sbi_vector.h"
    },
    {
      "type": "modify",
      "old_id": "38c28caf0d6fe580e214c5dd95309d8a784be086",
      "old_mode": 33188,
      "old_path": "lib/sbi/sbi_trap_v_ldst.c",
      "new_id": "540f655ff2e2669e7def06514c7f0668c958d05d",
      "new_mode": 33188,
      "new_path": "lib/sbi/sbi_trap_v_ldst.c"
    }
  ]
}
