History log of /llvm-project/bolt/lib/Rewrite/LinuxKernelRewriter.cpp (Results 26 – 34 of 34)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 5a82daaf 16-Feb-2024 Maksim Panchenko <maks@fb.com>

[BOLT][NFC] Remove redundant assertion (#82056)

processLKSections() used to be a member of RewriteInstance. Since now it
is part of the LinuxKernelRewriter, the assertion is no longer needed.


# 5a298871 16-Feb-2024 Maksim Panchenko <maks@fb.com>

[BOLT] Add writing support for Linux kernel ORC (#80950)

Update ORC information based on the new code layout and emit
corresponding ORC sections for the Linux kernel.

We rewrite ORC sections in

[BOLT] Add writing support for Linux kernel ORC (#80950)

Update ORC information based on the new code layout and emit
corresponding ORC sections for the Linux kernel.

We rewrite ORC sections in place, which puts a limit on the size of new
section contents. Since ORC info changes for the new code layout and the
number of ORC entries can become larger, we free up space in the tables
by removing redundant ORC terminators. As a result, we effectively emit
fewer entries and have to add duplicate terminators at the end to match
the original section sizes. Ideally, we need to update ORC boundaries to
reflect the reduced size and optimize runtime lookup, but we will need
relocations for this, and the benefits will be marginal, if any.

show more ...


Revision tags: llvmorg-18.1.0-rc2
# 2abcbbd9 31-Jan-2024 Maksim Panchenko <maks@fb.com>

[BOLT] Detect Linux kernel based on ELF program headers (#80086)

Check if program header addresses fall into the kernel space to detect a
Linux kernel binary on x86-64.

Delete opts::LinuxKernelM

[BOLT] Detect Linux kernel based on ELF program headers (#80086)

Check if program header addresses fall into the kernel space to detect a
Linux kernel binary on x86-64.

Delete opts::LinuxKernelMode and use BinaryContext::IsLinuxKernel
instead.

show more ...


# 0fc791cd 30-Jan-2024 Maksim Panchenko <maks@fb.com>

[BOLT] Fix comparison function for Linux ORC entries (#79921)

Fix ORC entry comparison function to cover a case with multiple
terminator entries matching at the same IP.


# aa1968c2 30-Jan-2024 Maksim Panchenko <maks@fb.com>

[BOLT] Add metadata pre-emit finalization interface (#79925)

Some metadata needs to be updated/finalized before the binary context is
emitted into the binary. Add the interface and use it for Linux

[BOLT] Add metadata pre-emit finalization interface (#79925)

Some metadata needs to be updated/finalized before the binary context is
emitted into the binary. Add the interface and use it for Linux ORC
update invocation.

show more ...


Revision tags: llvmorg-18.1.0-rc1, llvmorg-19-init, llvmorg-17.0.6, llvmorg-17.0.5, llvmorg-17.0.4, llvmorg-17.0.3, llvmorg-17.0.2, llvmorg-17.0.1, llvmorg-17.0.0, llvmorg-17.0.0-rc4, llvmorg-17.0.0-rc3, llvmorg-17.0.0-rc2, llvmorg-17.0.0-rc1, llvmorg-18-init
# ec4ddc28 19-Jul-2023 Maksim Panchenko <maks@fb.com>

[BOLT] Improve Linux Kernel ORC reader

* Sort ORC entries in the internal table. Older Linux kernels did not
sort them in the file (only during boot time).
* Add an option to dump sorted ORC

[BOLT] Improve Linux Kernel ORC reader

* Sort ORC entries in the internal table. Older Linux kernels did not
sort them in the file (only during boot time).
* Add an option to dump sorted ORC tables (--dump-orc).
* Associate entries in the internal ORC table with a BinaryFunction
even when we are not changing the function.
* If the function doesn't have ORC entry at the start, propagate ORC
state from a previous entry.

Reviewed By: Amir

Differential Revision: https://reviews.llvm.org/D155767

show more ...


# 138e2abf 13-Jul-2023 Maksim Panchenko <maks@fb.com>

[BOLT] Attach ORC info to instructions in CFG

Propagate Linux Kernel ORC information read from the file to the whole
function CFG once the graph has been built. We have a choice to either
attach ORC

[BOLT] Attach ORC info to instructions in CFG

Propagate Linux Kernel ORC information read from the file to the whole
function CFG once the graph has been built. We have a choice to either
attach ORC state annotation to every instruction, or to the first
instruction in the basic block to conserve processing memory. I chose to
attach to every instruction under --print-orc option which is currently
on by default.

Depends on D155153, D154815

Reviewed By: Amir

Differential Revision: https://reviews.llvm.org/D155156

show more ...


# e6724cbd 10-Jul-2023 Maksim Panchenko <maks@fb.com>

[BOLT] Add reading support for Linux ORC sections

Read ORC (oops rewind capability) info used for unwinding the stack by
Linux Kernel. The info is stored in .orc_unwind and .orc_unwind_ip
sections.

[BOLT] Add reading support for Linux ORC sections

Read ORC (oops rewind capability) info used for unwinding the stack by
Linux Kernel. The info is stored in .orc_unwind and .orc_unwind_ip
sections. There is also a related .orc_lookup section that is being
populated by the kernel during runtime. Contents of the sections are
sorted for quicker lookup by a post-link objtool.

Unless we modify stack access instructions, we don't have to change ORC
info attributed to instructions in the binary. However, we need to
update instruction addresses and sort both sections based on the new
layout.

For pretty printing, we add "--print-orc" option that prints ORC info
next to instructions in code dumps.

Reviewed By: Amir

Differential Revision: https://reviews.llvm.org/D154815

show more ...


# 38639a81 28-Jun-2023 Maksim Panchenko <maks@fb.com>

[BOLT][NFCI] Migrate Linux Kernel handling code to MetadataRewriter

Create LinuxKernelRewriter and move kernel-specific code to this class.

Depends on D154023

Reviewed By: Amir

Differential Revis

[BOLT][NFCI] Migrate Linux Kernel handling code to MetadataRewriter

Create LinuxKernelRewriter and move kernel-specific code to this class.

Depends on D154023

Reviewed By: Amir

Differential Revision: https://reviews.llvm.org/D154024

show more ...


12