[all-commits] [llvm/llvm-project] d16b21: [BOLT][Linux] Support ORC for alternative instruct...

Maksim Panchenko via All-commits all-commits at lists.llvm.org
Thu Jun 27 19:26:32 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d16b21b17d13ecd88a068bb803df43e53d3b04ba
      https://github.com/llvm/llvm-project/commit/d16b21b17d13ecd88a068bb803df43e53d3b04ba
  Author: Maksim Panchenko <maks at fb.com>
  Date:   2024-06-27 (Thu, 27 Jun 2024)

  Changed paths:
    M bolt/include/bolt/Core/BinaryFunction.h
    M bolt/lib/Core/BinaryFunction.cpp
    M bolt/lib/Rewrite/LinuxKernelRewriter.cpp
    M bolt/test/X86/linux-alt-instruction.s

  Log Message:
  -----------
  [BOLT][Linux] Support ORC for alternative instructions (#96709)

Alternative instruction sequences in the Linux kernel can modify the
stack and thus they need their own ORC unwind entries. Since there's
only one ORC table, it has to be "shared" among multiple instruction
sequences. The kernel achieves this by putting a restriction on
instruction boundaries. If ORC state changes at a given IP, only one of
the alternative sequences can have an instruction starting/ending at
this IP. Then, developers can insert NOPs to guarantee the above
requirement is met.

The most common use of ORC with alternatives is "pushf; pop %rax"
sequence used for paravirtualization. Note that newer kernel versions
no longer use .parainstructions; instead, they utilize alternatives for
the same purpose.

Before we implement a better support for alternatives, we can safely
skip ORC entries associated with them.

Fixes #87052.



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