[llvm] [BOLT] Add reading support for Linux kernel .altinstructions section (PR #84283)

Maksim Panchenko via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 7 11:28:42 PST 2024


================
@@ -1132,6 +1156,123 @@ Error LinuxKernelRewriter::readBugTable() {
   return Error::success();
 }
 
+/// The kernel can replace certain instruction sequences depending on hardware
+/// it is running on and features specified during boot time. The information
+/// about alternative instruction sequences is stored in .altinstructions
+/// section. The format of entries in this section is defined in
+/// arch/x86/include/asm/alternative.h:
+///
+///   struct alt_instr {
+///     s32 instr_offset;
+///     s32 repl_offset;
+///     uXX feature;
----------------
maksfb wrote:

u16 or u32. Perhaps u64 in the future.

https://github.com/llvm/llvm-project/pull/84283


More information about the llvm-commits mailing list