[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v5 26/26] xen/riscv: do a 4th linking pass if necessary


  • To: Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 7 Jul 2026 10:37:26 +0200
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
  • Autocrypt: addr=jbeulich@xxxxxxxx; keydata= xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A nAuWpQkjM1ASeQwSHEeAWPgskBQL
  • Cc: Romain Caritey <Romain.Caritey@xxxxxxxxxxxxx>, Baptiste Le Duc <baptiste.le-duc@xxxxxxxxxx>, Alistair Francis <alistair.francis@xxxxxxx>, Connor Davis <connojdavis@xxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Julien Grall <julien@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Tue, 07 Jul 2026 08:37:33 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 07.07.2026 10:19, Oleksii Kurochko wrote:
> On 7/6/26 6:13 PM, Jan Beulich wrote:
>> On 06.07.2026 17:58, Oleksii Kurochko wrote:
>>> Embedding the symbol table can shift sections and flip relaxation
>>> decisions, changing code size and thus the set of emitted symbols
>>> (e.g. gap end markers).
>>
>> What difference in symbols is there? (And: Do you mean the ELF symbol
>> table or what tools/symbols emits?) On ...
> 
> The ELF symbol tables of .xen-syms.0 and .xen-syms.1 are identical
> (same names, types, and count; only addresses past a certain point
> differ). The difference is in what tools/symbols emits: the
> address-only "end of symbol" entry produced when want_symbol_end()
> is true, i.e. when a sized text symbol's end doesn't reach the next
> symbol's address:
> 
>      static bool want_symbol_end(unsigned int idx)
>      {
>          return table[idx].size &&
>                 (idx + 1 == table_cnt ||
>                  table[idx].addr + table[idx].size < table[idx + 1].addr);
>      }
> 
> In pass 1 (generated from .xen-syms.0): simple_strtoull is at
> 0xffffffffc00c0444 with size 0x16c, ending at 0xffffffffc00c05b0,
> while turn_on_mmu (alignment-pinned) starts at 0xffffffffc00c05c0.
> 16-byte gap -> the end marker at ...c05b0 is emitted.
> 
> In pass 2 (generated from .xen-syms.1): simple_strtoull moved to
> 0xffffffffc00c0454 (same size), ending at exactly 0xffffffffc00c05c0
> == turn_on_mmu. No gap -> no end marker. Hence symbols_addresses
> shrinks by 8 and symbols_names by 1 (the marker's empty name).
> 
>>
>>>   Re-link with a regenerated table when its
>>> size differs from the previous pass.
>>>
>>> This mirrors commit 35de7285d508 ("Arm: do a 4th linking pass if
>>> necessary"), which riscv didn't receive when the underlying
>>> pass-2-vs-pass-3 check was extended to it in commit aa786d6e3467
>>> ("non-x86/symbols: check table sizes don't change between linking
>>> passes 2 and 3").
>>
>> ... Arm the problem was with a symbol (dis)appearing from/in the ELF
>> symbol table. The situation looks to be different here. Sadly ...
> 
> I will rephrase then this paragraph to:
> 
> This takes the same remedy as commit 35de7285d508 ("Arm: do a 4th
> linking pass if necessary"), though the underlying cause differs:
> here no symbol (dis)appears from the ELF symbol table; instead the
> set of end markers emitted by tools/symbols legitimately changes,
> because want_symbol_end() depends on code layout, and layout differs
> between passes due to linker relaxation.
> 
> Or it could be just dropped.

Please don't drop it.

Jan



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.