-mindirect-branch-cs-prefix adds a CS segment-override prefix (0x2e) to each call or jmp to a retpoline thunk. The CPU ignores the prefix, but it extends the instruction to six bytes instead of five. This leaves enough room for a future kernel change to patch all of the call sites at boot time to disable retpoline if not required. Support for this option arrived in GCC 12 and Clang/LLVM 16.
Details
Details
- Reviewers
kib - Group Reviewers
secteam - Commits
- rGcb1627e40d5c: kernel: Add -mindirect-branch-cs-prefix for WITH_KERNEL_RETPOLINE
Diff Detail
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable