[all-commits] [llvm/llvm-project] b068ae: [LFI][X86] Add X86 LFI target and system instructi...
Zachary Yedidia via All-commits
all-commits at lists.llvm.org
Mon Jul 6 20:56:22 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: b068ae9e376b1e3d721064e140e638cad076d0bc
https://github.com/llvm/llvm-project/commit/b068ae9e376b1e3d721064e140e638cad076d0bc
Author: Zachary Yedidia <zyedidia at gmail.com>
Date: 2026-07-06 (Mon, 06 Jul 2026)
Changed paths:
M clang/lib/Basic/Targets/X86.cpp
M llvm/docs/LFI.rst
M llvm/include/llvm/TargetParser/Triple.h
M llvm/lib/MC/MCLFI.cpp
M llvm/lib/Target/X86/MCTargetDesc/CMakeLists.txt
A llvm/lib/Target/X86/MCTargetDesc/X86MCLFIRewriter.cpp
A llvm/lib/Target/X86/MCTargetDesc/X86MCLFIRewriter.h
M llvm/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.cpp
M llvm/lib/Target/X86/X86ISelLowering.cpp
M llvm/lib/Target/X86/X86ISelLoweringCall.cpp
M llvm/lib/Target/X86/X86RegisterInfo.cpp
M llvm/lib/Target/X86/X86Subtarget.h
M llvm/lib/TargetParser/Triple.cpp
A llvm/test/CodeGen/X86/lfi-sibcall.ll
A llvm/test/MC/X86/LFI/abi-note.s
A llvm/test/MC/X86/LFI/syscall.s
A llvm/test/MC/X86/LFI/thread-pointer-errors.s
A llvm/test/MC/X86/LFI/thread-pointer.s
Log Message:
-----------
[LFI][X86] Add X86 LFI target and system instruction rewrites (#189569)
This PR introduces an x86-64 backend for Lightweight Fault Isolation
(LFI), similar to the one being developed for AArch64. LFI is a
compiler-based mechanism that enables efficient in-process sandboxing.
See the RFC from last fall for details.
This PR adds the `x86_64_lfi` target (similar to `aarch64_lfi`), sets up
reserved registers, and implements some initial rewrites for system
instructions (system calls and TLS accesses). The rewrites are done at
the MC level, using the `MCLFIRewriter` infrastructure. I have updated
the documentation to describe the x86-64 sandboxing scheme and to list
rewrites that will be implemented in future PRs (to keep each individual
PR small).
For performance and compatibility reasons, the plan is currently to use
bundling for maintaining control-flow integrity in the sandbox, which
is not yet supported. For now we are setting up the rewrites without using
bundling, but we can also use a CFI mechanism based on shadow
stack+endbr in order to have something usable while bundling is
in progress.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list