)]}'
{
  "commit": "d916dfcfaebb2382a943b4cbbdc81c796e2dc56b",
  "tree": "9eb2f7af3d3d81874c45120fae6578fa6b5ec18f",
  "parents": [
    "f5828201ea95dff75f12d2db03dafc68ed03645a"
  ],
  "author": {
    "name": "Michael Brown",
    "email": "mcb30@ipxe.org",
    "time": "Sun Sep 06 14:39:12 2026 +0100"
  },
  "committer": {
    "name": "Michael Brown",
    "email": "mcb30@ipxe.org",
    "time": "Sun Sep 06 19:43:49 2026 +0100"
  },
  "message": "[librm] Enable the use of SSE instructions if supported by the CPU\n\nClear CR0.EM, clear CR0.TS, and set CR4.OSFXSR in order to allow the\nexecution of SSE instructions such as the AES-NI instructions for AES\nhardware acceleration.\n\nNote that we have to assert CR4.OSFXSR to allow these instructions to\nexecute, but our context switching logic (e.g. the protected-mode and\nlong-mode interrupt handlers) does not actually preserve the\nFPU/MMX/SSE registers.\n\nOur C code therefore cannot in general presume that the FPU/MMX/SSE\nregisters will be preserved across arbitrary context boundaries.\nHowever, since C code executes with interrupts disabled, an individual\nfunction may safely use temporary FPU/MMX/SSE registers provided that\nit does not enable interrupts or otherwise relinquish the context.\n\nFor the same C code to also be usable under the UEFI IA-32 ABI, it\nmust preserve all registers other than %eax, %ecx, and %edx, including\npreserving all MMX and XMM registers.\n\nThe practical upshot is therefore that C code may use SSE instructions\nand may assume that SSE registers will not be changed arbitrarily\nduring execution (either because the ABI guarantees preservation, as\nwith UEFI or Linux, or because the runtime environment guarantees that\ninterrupts are disabled), but the C code must itself restore the\nvalues of any modified FPU/MMX/SSE registers.\n\nThe \"fxsave\"/\"fxrstor\" performed by virt_call() would allow for a\nslightly more relaxed constraint if support for the UEFI IA-32 ABI\nwere ever to be dropped in future.  A real-mode caller that is making\nuse of SSE must have already set OSFXSR, and so its non-64-bit\nregisters %xmm0-%xmm7 would already be saved and restored across\nvirt_call().  The tightest constraint would then become the UEFI X64\nABI, which defines %xmm0-%xmm5 as volatile (i.e. caller-saved): this\nwould allow C code in iPXE to use %xmm0-%xmm5 without needing to\nexplicitly save and restore their values.\n\nSigned-off-by: Michael Brown \u003cmcb30@ipxe.org\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "c08d544a58eb75662a7e35e983fa2e5f4e90770c",
      "old_mode": 33188,
      "old_path": "src/arch/x86/transitions/librm.S",
      "new_id": "a550a277a5b8d322bc3a8ed5b327b7500ed319bd",
      "new_mode": 33188,
      "new_path": "src/arch/x86/transitions/librm.S"
    }
  ]
}
