<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/87052>87052</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [BOLT] Error when reading .orc_unwind_ip with CONFIG_PARAVIRT=y
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            BOLT
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          romanovj
      </td>
    </tr>
</table>

<pre>
    With CONFIG_PARAVIRT=y
```
llvm-bolt -o p.b vmlinux
BOLT-INFO: Target architecture: x86_64
BOLT-INFO: BOLT version: de0abc0983d355bbd971c5c571ba4c209a0c63ea
BOLT-INFO: Linux kernel binary detected
BOLT-INFO: first alloc address is 0x0
BOLT-WARNING: debug info will be stripped from the binary. Use -update-debug-sections to keep it.
BOLT-INFO: static input executable detected
BOLT-INFO: disabling -align-macro-fusion in non-relocation mode
BOLT-INFO: enabling lite mode
BOLT-ERROR: symbol seen in the middle of the function srso_untrain_ret/1(*2). Skipping.
BOLT-ERROR: symbol seen in the middle of the function retbleed_untrain_ret/1(*2). Skipping.
BOLT-WARNING: unable to disassemble instruction at offset 0x50 (address 0xffffffff81000050) in function pvh_start_xen/1
BOLT-WARNING: unable to disassemble instruction at offset 0x4 (address 0xffffffff81054a94) in function native_lkgs/1(*2)
BOLT-WARNING: unable to disassemble instruction at offset 0xe (address 0xffffffff81095cce) in function native_load_gs_index/1(*2)
BOLT-WARNING: function module_init_section has an object detected in a padding region at address 0xffffffff811a0e8f
BOLT-WARNING: function pcpu_fc_alloc/1(*2) has an object detected in a padding region at address 0xffffffff8351072a
BOLT-WARNING: reference in the middle of instruction detected in function xen_read_msr/1(*2) at offset 0x33
BOLT-ERROR: while running linux-kernel-rewriter in pre-CFG state: no instruction at address 0xffffffff81003187 in .orc_unwind_ip
```

Without CONFIG_PARAVIRT
```
llvm-bolt -o p.b vmlinux
BOLT-INFO: Target architecture: x86_64
BOLT-INFO: BOLT version: de0abc0983d355bbd971c5c571ba4c209a0c63ea
BOLT-INFO: Linux kernel binary detected
BOLT-INFO: first alloc address is 0x0
BOLT-WARNING: debug info will be stripped from the binary. Use -update-debug-sections to keep it.
BOLT-INFO: static input executable detected
BOLT-INFO: disabling -align-macro-fusion in non-relocation mode
BOLT-INFO: enabling lite mode
BOLT-ERROR: symbol seen in the middle of the function srso_untrain_ret/1(*2). Skipping.
BOLT-ERROR: symbol seen in the middle of the function retbleed_untrain_ret/1(*2). Skipping.
BOLT-WARNING: unable to disassemble instruction at offset 0x50 (address 0xffffffff81000050) in function pvh_start_xen/1
BOLT-WARNING: unable to disassemble instruction at offset 0x65 (address 0xffffffff81021d65) in function start_thread_common/1(*2)
BOLT-WARNING: unable to disassemble instruction at offset 0x3da (address 0xffffffff8102226a) in function __switch_to
BOLT-WARNING: unable to disassemble instruction at offset 0x3c1 (address 0xffffffff81022911) in function do_arch_prctl_64
BOLT-WARNING: unable to disassemble instruction at offset 0x2c (address 0xffffffff81022c0c) in function load_gs_index/1(*2)
BOLT-WARNING: unable to disassemble instruction at offset 0x158 (address 0xffffffff8102db28) in function ia32_restore_sigcontext/1(*2)
BOLT-WARNING: unable to disassemble instruction at offset 0x2c (address 0xffffffff8103eafc) in function load_gs_index/2(*2)
BOLT-WARNING: unable to disassemble instruction at offset 0x39 (address 0xffffffff810ad6e9) in function mm_release/1(*2)
BOLT-WARNING: unable to disassemble instruction at offset 0x1d2 (address 0xffffffff81e494d2) in function restore_processor_state
BOLT-WARNING: function module_init_section has an object detected in a padding region at address 0xffffffff8118f1df
BOLT-WARNING: function pcpu_fc_alloc/1(*2) has an object detected in a padding region at address 0xffffffff834e87d7
BOLT-INFO: parsed 428244 ORC entries
BOLT-INFO: parsed 4595 static call entries
BOLT-INFO: parsed 1543 exception table entries
BOLT-INFO: parsed 10201 bug table entries
BOLT-WARNING: alternative instruction sequence found in function .altinstr_replacement/1
BOLT-ERROR: while running linux-kernel-rewriter in pre-CFG state: error reading .altinstructions
```

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzsmN9u2zYUxp9GviFkUJRkSxe-cJu6CFAkg9etl8IReWSxoUiNpGLn7QfKbhq7drKuGbqLBkEC2iS_3-Gf8x0JnJMbjbiI8jdRfjWBwbfGLqzpQJv7z5PaiIfFJ-lb8vb2ZnX9vvptuV7-eb3-GKVXDxG9iugymtHD79hU6r6La6M8iQ3ppzW575TUw27_7ZvbDx_j65vVbZQuyUewG_QELG-lR-4Hi-HjXTGrZtmZ_qFB7tE6aXRoC6RQc1oWqUjzvK5FOU94zvN5UkPGGS2B8lmKcGaqDwGJ3KHVqEgtNdgHIjBAoDjTvZHWeQJKGU5ACIvOEekI3dEnnT8t1zfXN-_3ZPWwIVI3hmylUqRG4ryVfY-CNNZ0xLd4kJ2SPxySeOgFeIzHgbFD7qXRjnhD7hB7Iv30DJXz4CUnUveDJ7hDPnioFT4XiJAOaiX1hsSg5EbHHXBr4mYIa0qkJtro2KIyHAIB6YzAM9OgPsyipMfTTu_W69v1yPfQ1UYRhzhOHWLupBAKiWnGVjPoMVDirDPVoL0FqSuLPmKrJGJFxJYsYuWU_H4n-17qzfTHZCz6WiGK75V6srODHpfYm3EpncMuNKV23g57EfDENI1DT-gupyRixZcTQ3fN4adIKKU0pxErA_IjYH_fVs6D9dUO9Uj2ChDZRYY8gzI7ZdDg5T1W6m7jjtfmNVjwIkuZc46XWAyIauMqqQXu_gnU4wSdEYPCSmrpq8OtIi04ApqY-jNy_3hZgi6QHoQI59ri5oB-DjYBikXzgnTP-6FqeDVmjWPoH0dI84TOGZxHsNigRc3x2-vwdF-eyj5S7zDcChBV5-wJ9NN9TNNzN3HbSoXEDlrvc4MedvE-x8YWt1Z6tEGstxi_Xb0f89eY8bU5PTDnr0yaFPMwwdRYXg16K7WoZH_WhvZ_g3OZwX9jXr-M65dx_TKu_7txzfKLECwRs_wUYg_g2zF_cdN1Rr--g6UCLlM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