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 769A8C83F1B for ; Thu, 17 Jul 2025 08:36:41 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.1046392.1416707 (Exim 4.92) (envelope-from ) id 1ucK6N-0003VK-FQ; Thu, 17 Jul 2025 08:36:27 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 1046392.1416707; Thu, 17 Jul 2025 08:36:27 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1ucK6N-0003VD-CI; Thu, 17 Jul 2025 08:36:27 +0000 Received: by outflank-mailman (input) for mailman id 1046392; Thu, 17 Jul 2025 08:36:25 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1ucK6L-0003V7-H8 for xen-devel@lists.xenproject.org; Thu, 17 Jul 2025 08:36:25 +0000 Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [2a00:1450:4864:20::32f]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 1ed5d220-62e9-11f0-b894-0df219b8e170; Thu, 17 Jul 2025 10:36:23 +0200 (CEST) Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-451d3f72391so5876395e9.3 for ; Thu, 17 Jul 2025 01:36:23 -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 41be03b00d2f7-b3bbe52cdaesm15352085a12.10.2025.07.17.01.36.17 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 17 Jul 2025 01:36:22 -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" X-Inumbo-ID: 1ed5d220-62e9-11f0-b894-0df219b8e170 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1752741383; x=1753346183; 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=ip4Q3/HNx5Jj5pLFerg5GSyF7uOqp0iNk2jET3D7mjA=; b=M80Lmstx5DHGydzOgIGjQTeMiKS83ppljTRfAJwM7niF6fDVD4h9GTl0cAf21mkvwz ZOxqNVu5OZ25X5o527AjCT46sKxyf+aUXnZMSo5rs98ZDv4XX1GNHrNNJNL57aPPOKOq +EGRSyM/bgkrvnhZr7WU+CkczSL423f+r5CqTPNpDZJ2bE+LM/9qBTwnhc8WsXeDWvyq zwp1eGqhmjSbGZZXsRJqOiNFTZE3jeg0//e5q5fQJFSrzjh2nhYiHGHHA0bZZ5e+cocq wpDxF4NjxT/WJ0+tm5VuhkQrVaDUEjiBZgUITNS1Gqh832nCJl6D6ZpyQ2jmAU15sNzk d3ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752741383; x=1753346183; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=ip4Q3/HNx5Jj5pLFerg5GSyF7uOqp0iNk2jET3D7mjA=; b=rcSKhTtXX5kNF7N7SFZFxLxwoSz9I+ZpwoOp+aGyDbAIYShjH+CaWM93omD8bL+/Hl hncU0EY7GsK/c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xIB2DTasWprA== X-Received: by 2002:a5d:5f52:0:b0:3a4:dc42:a0ac with SMTP id ffacd0b85a97d-3b60e539d7fmr4039939f8f.49.1752741382715; Thu, 17 Jul 2025 01:36:22 -0700 (PDT) Message-ID: <46feb3ba-d298-4139-a97f-fb3961b0f8d4@suse.com> Date: Thu, 17 Jul 2025 10:36:12 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: xen.efi has MEM_DISCARDABLE flag in Characteristics field of .reloc section To: Yann Sionneau Cc: yann@sionneau.net, =?UTF-8?Q?Marek_Marczykowski-G=C3=B3recki?= , "Daniel P. Smith" , Xen developer discussion , nickc@redhat.com, Demi Marie Obenour References: <39104717-4b64-483c-b6fd-d30069df4c58@gmail.com> <7e039262-1f54-46e1-8f70-ac3f03607d5a@suse.com> <7a7f40b8-5d73-421a-9358-30421d12a243@vates.tech> <2e1d2e67-ac14-4cb7-a6ea-4351d1418be9@suse.com> <06ad1fe7-cc79-4976-8748-318a7f8f2b45@vates.tech> 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+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s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06ad1fe7-cc79-4976-8748-318a7f8f2b45@vates.tech> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 17.07.2025 10:28, Yann Sionneau wrote: > On 7/17/25 10:22, Jan Beulich wrote: >> On 17.07.2025 09:32, Yann Sionneau wrote: >>> Hello Demi Marie, Jan, Nick, all, >>> >>> Thank you Demi Marie for bringing this topic on the mailing list. >>> >>> I discussed it a bit with Jan on Matrix but the situation is not pretty, >>> there is no clean solution that stands out easily. >>> >>> As Jan said, it seems .reloc is meant to be discardable, so we can't >>> blame binutils LD for putting it: >>> >>> https://github.com/bminor/binutils-gdb/commit/25c80428af3311e761c87d8f706596b9701602ec#diff-078cf751467928c038996b40073a682425712b9b01182424e68cf18fb08a75b5R953-R977 >>> >>> And we can't obviously blame the loaders for honoring this flag. >>> >>> Most reasonable solution indeed would be to ask binutils to add a link >>> flag to say "please do not put the DISCARDABLE flag on the .reloc section" >>> >>> I'm adding Nick Clifton from binutils in CC so that he can comment on >>> this possible outcome or any other possible solution. >>> >>> In the mean time, while waiting for a solution to emerge (and be merged, >>> and released) what do we do? >>> >>> Do we put some hack in Xen build Makefiles so that xen.efi is >>> post-processed to strip this bit? >>> >>> This could be the temporary solution. >> >> As indicated - I don't think this is just a temporary solution. Beyond Xen, >> I simply don't see value in adding a linker flag (which then, sooner or >> later, llvm would also need to support just for Xen). The question rather >> is how to make the Xen side hack as little hacky as possible, without >> relying on the fragile behavior of objcopy. > > Ok I didn't understand your previous answer, it's more clear now, thank you. > Would you consider using a tool like this less fragile than objcopy: > https://github.com/fallen/keeprelocs ? Well, something like that. Generalized enough to at least be halfway easy to later also use for further purposes, and if at all possible using the header we already have for PE (efi/pe.h). Jan