From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DBDD5C43458 for ; Tue, 7 Jul 2026 08:37:40 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.1356076.1610733 (Exim 4.92) (envelope-from ) id 1wh1J5-0003G8-NU; Tue, 07 Jul 2026 08:37:31 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 1356076.1610733; Tue, 07 Jul 2026 08:37:31 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wh1J5-0003G1-Kd; Tue, 07 Jul 2026 08:37:31 +0000 Received: by outflank-mailman (input) for mailman id 1356076; Tue, 07 Jul 2026 08:37:30 +0000 Received: from mx.expurgate.net ([194.145.224.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wh1J4-0003Cr-CQ for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 08:37:30 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1wh1J2-00CqDE-Vf for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 10:37:28 +0200 Received: from [10.42.69.1] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6a4cbab9-bab6-0a2a0a5309dd-0a2a4501cdb4-44 for ; Tue, 07 Jul 2026 10:37:28 +0200 Received: from [209.85.221.45] (helo=mail-wr1-f45.google.com) by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6a4cbac8-400f-0a2a45010019-d155dd2dd9a5-3 for ; Tue, 07 Jul 2026 10:37:28 +0200 Received: by mail-wr1-f45.google.com with SMTP id ffacd0b85a97d-45fd464d51fso2000373f8f.3 for ; Tue, 07 Jul 2026 01:37:28 -0700 (PDT) Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de. [37.24.206.209]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-47aa0960816sm30728346f8f.29.2026.07.07.01.37.27 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 07 Jul 2026 01:37:27 -0700 (PDT) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" 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" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1783413448; x=1784018248; darn=lists.xenproject.org; h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to :content-type; bh=r0FA7YGBTQf9PlPRxd4lq++npfL8jfIrohvmnplJ9js=; b=eCqWWtWkwMKXaSIJUbg/4ppiTwheX6qFufeP5pgnVIBUlHPrjLyobeqaPeF+VoN99E hLCYhCkqCikk8TpckL8v+3cPbISLUBDunSGrVpLgslD/Hd5V3fLVzogkw9DMEbM3gzQv YY9oxOyAFZ1hzqqRnghXX8wkubIOF+KhFATqirh1fNTQO5WxjnF4ImQb7nIfmCjUmgaQ 0nme7K+mFdXNXuwU1vVvIyKD8FPegXGDgeQzZyPobS9Hw/5Zq3VZsP1wk5odjTRB9P7l Kkw1S/G2mZ/un5qEQcosqW2upRW7cLDkUvhVuPM/TePVk1WHHuLWZAO8PIzgrsNf3EhJ 9iLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783413448; x=1784018248; h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=r0FA7YGBTQf9PlPRxd4lq++npfL8jfIrohvmnplJ9js=; b=n/xxhlMcMYOoQq7lcBolFcboTpW1jzto9pZvKUgZ32VbJc7Nz44NTTQ2dWpG2beAhX 6ryM1fqftekYCXWzihI/Bd0FLpYhYzOmzUD9s+wSWaV+94g8Mpsjar+Fq8UMZKs8ij1y hYvamQ7Ya9I9LMOyHtjRPrmfupq+HrwjgMSLMLEdFMQjD2PUDr2hwNFA+A2AWCYQ6gsZ goVl6qgFBGKRuoqQuwc/Lil9lijIhS1Zi/8B1KSy3zFFDyvhpKmxhNmrxH4F2vslkTiJ GHOJ1U6w3BSnW4jFMq5xW1piULNVFI63Yq+YoXHr0PDhhZrEs1+bR5Hr+Bnv1ai/6VZz grPQ== X-Forwarded-Encrypted: i=1; AHgh+RpnfZO4k4UdkA3doItNhy+otdSUTfBd8trEodOwTr6AqNttyvvFsaFRocXpRzdvxu140udo2OmDsm4=@lists.xenproject.org X-Gm-Message-State: AOJu0YzI+dVTLg1gvaCJr1Ub6sjEdnR3B04PDMWoD1m64a83TFCXK4AH /8E0yh6M3PDg193nQgDjgikD00VF0HEaEUg9t/NZ36kHdLdGLY2GZAnde6ubskl5cA== X-Gm-Gg: AfdE7cnZiS+lHPP+OaZRmQWepjiHPZosHwq7Y5fPNf/h+TRZmgcfm+bFAjwn2VUjG2j Zo6i6D3VsvzXvN97KctvXKERUeAq077hianlo44CNRbtBGZQASSBhXjciEjyYeIanbZfWKdwgYD Tzw/5A7S/Fe9wIlVJCEhDGd99F58bPrtzq9D2y0qDh233mA6mVIOBVkP/FnZZgO04Dmb18TaeCV 1uC9aiqVXHu2bD5o2jUerJw1BSxoCpPqPz+LahZCkdZ4aP3nfXa7GxAt6ogb0Ycm24PyFr9kvqC FdUKSEqZyJKPIiQ2PXKWKmX5IfPNRTtEPhBTZkb/gqnaWJsHNR+1/e/kX9NfUw7+7sDRd77yh/0 F2pTj8cmuMwzL01Q/286oNVJk5qyTdLs/r/GP1kgTDYBYmNdd4hJ+Dddb/b/Bj8OjYnFbNj87qR 2IhraK79gVf/BqEPTpZUrPeZfnYYH+2y2ZoFxe+SSjKGD4EfvbW1cgZV01CT7FTKPKPcQcJn+4W 48P X-Received: by 2002:a5d:4e82:0:b0:471:c76f:332a with SMTP id ffacd0b85a97d-47de665040emr3136377f8f.3.1783413448347; Tue, 07 Jul 2026 01:37:28 -0700 (PDT) Message-ID: <326e44ad-2014-43cd-bda8-e9c1faffe315@suse.com> Date: Tue, 7 Jul 2026 10:37:26 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v5 26/26] xen/riscv: do a 4th linking pass if necessary To: Oleksii Kurochko Cc: Romain Caritey , Baptiste Le Duc , Alistair Francis , Connor Davis , Andrew Cooper , Anthony PERARD , Michal Orzel , Julien Grall , =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= , Stefano Stabellini , xen-devel@lists.xenproject.org References: <3835ed9c-4c9a-49e4-90fd-37644262a942@suse.com> <66b5f31f-8ef6-4555-9c04-f5314512b598@gmail.com> Content-Language: en-US From: Jan Beulich Autocrypt: addr=jbeulich@suse.com; keydata= xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD /0tbFCzD2h20ahe8rC1gbb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Rbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A nAuWpQkjM1ASeQwSHEeAWPgskBQL In-Reply-To: <66b5f31f-8ef6-4555-9c04-f5314512b598@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-purgate-ID: tlsNG-d62444/1783413448-D16DE1E0-614FA668/0/0 X-purgate-type: clean X-purgate-size: 2644 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