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 C748DCF885C for ; Thu, 20 Nov 2025 14:05:09 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.1167436.1493745 (Exim 4.92) (envelope-from ) id 1vM5HK-0002XG-Pq; Thu, 20 Nov 2025 14:04:54 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 1167436.1493745; Thu, 20 Nov 2025 14:04:54 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1vM5HK-0002X9-NI; Thu, 20 Nov 2025 14:04:54 +0000 Received: by outflank-mailman (input) for mailman id 1167436; Thu, 20 Nov 2025 14:04:53 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1vM5HJ-0002X1-4X for xen-devel@lists.xenproject.org; Thu, 20 Nov 2025 14:04:53 +0000 Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [2a00:1450:4864:20::62d]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id e1e04e78-c619-11f0-9d18-b5c5bf9af7f9; Thu, 20 Nov 2025 15:04:51 +0100 (CET) Received: by mail-ej1-x62d.google.com with SMTP id a640c23a62f3a-b737cd03d46so136937766b.0 for ; Thu, 20 Nov 2025 06:04:51 -0800 (PST) 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 a640c23a62f3a-b7654cdabd0sm212662566b.12.2025.11.20.06.04.49 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 20 Nov 2025 06:04:50 -0800 (PST) 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" X-Inumbo-ID: e1e04e78-c619-11f0-9d18-b5c5bf9af7f9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1763647491; x=1764252291; darn=lists.xenproject.org; h=content-transfer-encoding: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; bh=LaVScHmpCpLH4nKHmuYOng/4hzi4cORaPRTP66z1juo=; b=P4Tx42vP6UCk5/e+72uASxKxR5vNn1EDZm23iqUOs0gz3/85CQWJdpGa9aynWQN8pR UCN/0Du7kE3Mo0jgWlTdEeCOlQnPXzZm59TkCGwrolA8wL9ArQ0Z66ZlQJQfzpkINmbv CAMENFSKlCaZCAZPYkC284JdP9/Hd2GxkFP7LT/i22NkrvrfGzwIw2aFA8Cfa2dT5gXK zx5o0sQZYwJcqWrElakcXJIL3XSx07BTf/PudcxHzNEdttbZmdEWlXKquhqqaQoS8/dp bYpdj2/rBdvlNS1P5Uadph+gmgZar+tSfgJZhja4AtmqXvEsi0Qmb//oDc2N8FU/490L oEMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763647491; x=1764252291; h=content-transfer-encoding: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; bh=LaVScHmpCpLH4nKHmuYOng/4hzi4cORaPRTP66z1juo=; b=xKw1uYX0+7F9ZfQFMhuJK3Hr4I5xaRWiE9cM4uQUG8QaD6jh6aoKzEfO3ajSDjvgNu 6+450z/2VNRM+mjAs3Z0nM0P6rqmGP9EdZPHNXgg2FPTfLJGfvrlLVQMwNnKoKmchf9N FqjjkglSm5sKA7hL12EiqmCnbhsgJ2ZKnKr0TaC5A3DA6eyB+Nzl2mWcvbwVOV1bgJmV HGGnhu02wkUNwMWzqcvbjATk+/V938tGWSWcUl1FMaB7yAdVzda76GctaZxaF9e0AM6L Soyy8+PdWL8MidegrNpMFAczrFAttjm86CwthaSUMyXm5YS0Zb4z0gJVSo0+hVp1DFyM fJJA== X-Forwarded-Encrypted: i=1; AJvYcCWTaV3iOG8UPXU2bxpYuLrYr8Ocfk9L9uex0HPoaboYhTlyd7LDa5tK2XXd6T3k9PVTnPHBM+mpsTI=@lists.xenproject.org X-Gm-Message-State: AOJu0YxTRptqBzf37fEcQnzJ3evupBKlT7uheXigCnxwfNeA4564htUe FoRy4lzHkwrOT2cOAoBQY9PNW3dhtU9kjDq4O8bK+rkoLUIqREx6boOvMzcbYoiJww== X-Gm-Gg: ASbGncvuuXc6G1LcKajhXb3N6a9yIMcNGmD7DrFLquraLNT6ycvFz/YU8cSa/g+5H+n +F16U/p+v3QwREwUIG1wB6wWZzhnw9CrDDhu0KKbNT4r+qoVzdIqBLEZwxQ9xcyZKnFVzVeE6Ni bQkKFQLBk6tiyrtaCw2alricGp2BntXe1AJNW/uWtOsbNGo9tLKAjCtczy5204Rx+qPbc7qOTNn T56kh9Lj344sxkKWdVe/3TmQljmgXJK6+40ehTr7KOQw3GEI/Qm1rEyPxez5em13uAAX0Iq8REl YNgpYLPhw/lBaAWwvxJYudp3dNhPeuc1rJEW773jdlZ3IFS/j6NGnvhDWCAFLD+5i5dO2A3xKSH HC3dHMZDZeNEnSXLrAzgvpF/e0tmfEgN9hmUlbTIHg906aiN/XK0FJysfVSmvqQwK+XAxf4MvRc s9zqfr3p3gwntZeJ9otSU0T73qCnlP/99/5oD51h6auBg7EO9peBnsPvsYXZcWJ14aXnvorZUVX JArk4EL/gNzMQ== X-Google-Smtp-Source: AGHT+IG9QgDPD6HADt40cHT1k2UZNhB0wW72ukiBekDgPSTgP9suSiOC7zr7WaUjcLmH+CA/ymtfNg== X-Received: by 2002:a17:907:7f8a:b0:b70:af3d:e97b with SMTP id a640c23a62f3a-b7654d5ca86mr367781566b.17.1763647491016; Thu, 20 Nov 2025 06:04:51 -0800 (PST) Message-ID: <1ac3c7ca-89dc-4782-ac97-b6bdcc729a37@suse.com> Date: Thu, 20 Nov 2025 15:04:48 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v8] xen: Strip xen.efi by default To: Frediano Ziglio Cc: Oleksii Kurochko , Frediano Ziglio , xen-devel@lists.xenproject.org, Frediano Ziglio , Anthony PERARD , Michal Orzel , Julien Grall , =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= , Stefano Stabellini , Demi Marie Obenour , =?UTF-8?Q?Marek_Marczykowski-G=C3=B3recki?= , Stewart Hildebrand , Andrew Cooper References: <20251113154358.28704-1-frediano.ziglio@citrix.com> <6729f3d9-618c-4dcd-93f8-d02ca7cea017@gmail.com> <8f8a769d-95ea-4554-8ee0-d6247f583e37@citrix.com> Content-Language: en-US From: Jan Beulich Autocrypt: addr=jbeulich@suse.com; keydata= xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuC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3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A nAuWpQkjM1ASeQwSHEeAWPgskBQL In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 20.11.2025 14:59, Frediano Ziglio wrote: > On Sat, 15 Nov 2025 at 06:23, Frediano Ziglio wrote: >> >> On Fri, 14 Nov 2025 at 19:18, Andrew Cooper wrote: >>> >>> On 14/11/2025 3:40 pm, Oleksii Kurochko wrote: >>>> >>>> >>>> On 11/13/25 4:43 PM, Frediano Ziglio wrote: >>>>> From: Frediano Ziglio >>>>> >>>>> For xen.gz file we strip all symbols and have an additional >>>>> xen-syms.efi file version with all symbols. >>>>> Make xen.efi more coherent stripping all symbols too. >>>>> xen-syms.efi can be used for debugging. >>>>> >>>>> Signed-off-by: Frediano Ziglio >>>> Release-Acked-By: Oleksii Kurochko >>>> >>>> Thanks. >>> >>> Thanks. Unfortunately CI says no. >>> >>> Ubuntu's 20.04, 18.04 and 16.04 all fail: >>> https://gitlab.com/xen-project/hardware/xen-staging/-/pipelines/2159622869 >>> >>> From 16.04: >>> >>> 2025-11-14T18:01:51.192964Z 01O strip xen-syms.efi -o xen.efi >>> 2025-11-14T18:01:51.198151Z 01O strip:xen-syms.efi[.init]: relocation count is negative: File truncated >>> 2025-11-14T18:01:51.198166Z 01O strip: xen.efi: Failed to read debug data section >>> 2025-11-14T18:01:51.198169Z 01O strip:xen.efi: error copying private BFD data: File truncated >>> 2025-11-14T18:01:51.198932Z 01O arch/x86/Makefile:207: recipe for target 'xen.efi' failed >>> 2025-11-14T18:01:51.198937Z 01O make[3]: *** [xen.efi] Error 1 >>> 2025-11-14T18:01:51.199616Z 01O build.mk:90: recipe for target 'xen' failed >>> 2025-11-14T18:01:51.199619Z 01O make[2]: *** [xen] Error 2 >>> 2025-11-14T18:01:51.200402Z 01O Makefile:600: recipe for target 'xen' failed >>> 2025-11-14T18:01:51.200409Z 01O make[1]: *** [xen] Error 2 >>> >>> >>> I find it hard to believe that the relocation count is really negative, >>> and given that newer binuitls works, I expect this is a binutils bug. >>> >> >> Unless the message is just misleading I find it hard to have a >> negative number of items in a container. >> >>> Nevertheless, we need some workaround. Given that the previous >>> behaviour was not to strip, I think we can reuse that for broken toolchains? >>> >> >> Something like that ? >> >> diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile >> index a154ffe6b2..c465eb12e2 100644 >> --- a/xen/arch/x86/Makefile >> +++ b/xen/arch/x86/Makefile >> @@ -236,7 +236,9 @@ ifeq ($(CONFIG_DEBUG_INFO),y) >> $(if $(filter --strip-debug,$(EFI_LDFLAGS)),:$(space))$(OBJCOPY) \ >> -O elf64-x86-64 $(TARGET)-syms.efi $@.elf >> endif >> - $(STRIP) $(TARGET)-syms.efi -o $@ >> + $(STRIP) $(TARGET)-syms.efi -o $@ || { \ >> + LANG=C strip $(TARGET)-syms.efi -o $@ 2>&1 | grep -q \ >> + "relocation count is negative" && mv -f $(TARGET)-syms.efi $@; } >> ifneq ($(CONFIG_DEBUG_INFO),y) >> rm -f $(TARGET)-syms.efi >> endif >> >> It will fall back to not stripping in case that bug is detected. I >> don't know how to test it. >> (the LANG=C is to always force the English message). >> > > It looks like this change works better and CI is happy. > It duplicates the linking with -s option if the strip fails. > Yes, it's a hack and almost duplicates the one command above. > What about it? As alluded to elsewhere - can't we detect the situation and avoid linking with debug info included in that case, like we already do for other reasons? Linking xen.efi is quite a bit slower than linking xen-syms, so the extra linking pass would better be avoided imo. Jan > --- a/xen/arch/x86/Makefile > +++ b/xen/arch/x86/Makefile > @@ -236,7 +236,10 @@ ifeq ($(CONFIG_DEBUG_INFO),y) > $(if $(filter --strip-debug,$(EFI_LDFLAGS)),:$(space))$(OBJCOPY) \ > -O elf64-x86-64 $(TARGET)-syms.efi $@.elf > endif > - $(STRIP) $(TARGET)-syms.efi -o $@ > + $(STRIP) $(TARGET)-syms.efi -o $@ || \ > + $(LD) $(call EFI_LDFLAGS,$(VIRT_BASE)) -T $(obj)/efi.lds $< \ > + $(dot-target).1r.o $(dot-target).1s.o $(orphan-handling-y) \ > + $(note_file_option) -s -o $@ > ifneq ($(CONFIG_DEBUG_INFO),y) > rm -f $(TARGET)-syms.efi > endif > > Frediano