From nobody Fri Nov 29 03:33:25 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=suse.com); dmarc=pass(p=quarantine dis=none) header.from=suse.com ARC-Seal: i=2; a=rsa-sha256; t=1650883634; cv=pass; d=zohomail.com; s=zohoarc; b=BQVVGBBkwG8NakLWIk7BegOb7w8yH/r4HJS1PgoLghHi6JQ1JbjB4ZdDJnTiNq1SeJ3jGLa9qv/RCm+f4uvQx6mzSFH0XxvfF5HLH+D3nDwUTSzlJqw6GeP8uuVMdJeDWq6gCpUhqJV9qfsrFRExBarmI1UBX8fNmCmEhQcIw0Y= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1650883634; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=2IyVjbV4+UozLbWszz088eBp53KB5rBQs/D2spIZ4Eg=; b=d6K7NcLlfNPwH0rCnHl7kBLYtbFucb+rJxYfr4oPzJl4NR5y4quAArOzmC6Mn2hLsvt+ZYbj4UX4Q8HI0b8XUhXJJ/6jVteU1CHuBOaT2uXs1QJjCJao/41N+2lINITog2H6OO68i00597C8rPTIImVhxdpUNGPureGbmU/MJDI= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=suse.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1650883634090169.99581528071803; Mon, 25 Apr 2022 03:47:14 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.312744.530087 (Exim 4.92) (envelope-from ) id 1niwEd-0003zC-HP; Mon, 25 Apr 2022 10:46:27 +0000 Received: by outflank-mailman (output) from mailman id 312744.530087; Mon, 25 Apr 2022 10:46: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 1niwEd-0003z5-EP; Mon, 25 Apr 2022 10:46:27 +0000 Received: by outflank-mailman (input) for mailman id 312744; Mon, 25 Apr 2022 10:46:25 +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 1niwEb-0003yz-OO for xen-devel@lists.xenproject.org; Mon, 25 Apr 2022 10:46:25 +0000 Received: from de-smtp-delivery-102.mimecast.com (de-smtp-delivery-102.mimecast.com [194.104.109.102]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id f36575da-c484-11ec-a405-831a346695d4; Mon, 25 Apr 2022 12:46:24 +0200 (CEST) Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04lp2058.outbound.protection.outlook.com [104.47.14.58]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id de-mta-35-7QKDvqdEMmiiX_QwcYCRbg-1; Mon, 25 Apr 2022 12:46:21 +0200 Received: from DU2PR04MB8616.eurprd04.prod.outlook.com (2603:10a6:10:2db::16) by DB7PR04MB4377.eurprd04.prod.outlook.com (2603:10a6:5:37::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5186.20; Mon, 25 Apr 2022 10:46:19 +0000 Received: from DU2PR04MB8616.eurprd04.prod.outlook.com ([fe80::5cb0:5195:4203:7c2f]) by DU2PR04MB8616.eurprd04.prod.outlook.com ([fe80::5cb0:5195:4203:7c2f%9]) with mapi id 15.20.5186.021; Mon, 25 Apr 2022 10:46:19 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version 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: f36575da-c484-11ec-a405-831a346695d4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=mimecast20200619; t=1650883583; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2IyVjbV4+UozLbWszz088eBp53KB5rBQs/D2spIZ4Eg=; b=S+4rPD4YwsHRfcYM/HWoVLiVdt3O0LnoigR3LWy2KXou26kCg4WWeQwJHvnGGVnB9xAIxc hJv0dTRXSvwtyw7gSCAZX/e6pOgsrSlzwxknHs85Ds6Wz5sam0U0vaI6EYgRX3j2zO4102 fULuD5MhAkFN6riU21imipkiBcjlwPw= X-MC-Unique: 7QKDvqdEMmiiX_QwcYCRbg-1 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JdJZk4Jev86q83corYMJ/iAju7wV01Br4x78DBxCJXMYVKoRnt6q6tOONR7bCouk5tCZnWIXn3s+YhofZSpkMa+UgPEHCoKvZ4UcY0SatLArbWaLEvKSpjNpUxQAjUzMU+xC3lG1Sts9YzfCjsaxhcBcEA6EqPozf/R1JFFIBEU4Y3wsx5QzeJM6i2ncjSZfbj9NuUYTxB3Mwa6dEwrliX48MhkFTJzXS3rTpeFN+wdpDaCvlTfc3bbrodxUCxT/+9EnEb9+bGZibl9C7iF2O0AsJO3DoFRkiBK/c5GslpfiKyHOk6tbhZHji0c2XwIEMLzKrKndOAcXIqITxr01nA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=2IyVjbV4+UozLbWszz088eBp53KB5rBQs/D2spIZ4Eg=; b=eO9qSrNSnd4/KvbjVNYnnCPT5LzFQ+dBfkx3B97mDuKif8S2wRSEJ7E06Q8ZnalAbO9581NRkrpd46oSDEEU+fOuEgx8pzkJzXSnZJYDT7Mz7AFS7buNAeGmB+tldbo06+aZV+8NW++TzZqlmffaHhWE8tF4BlqypHqS7djChMNkfedkCb5/HH7YHqloWc77gzcYwkydJi+NVXQLSVJKBX3qpx7pZCOoXpL9kjE6zsfsG0k4V2AUuuiFuntd+Goyv08Jwnn87758AbECCpDIkBivJseH2aR74Qm+Dx7OT3SRGEIgk3JIgc4cAN1FMuZHrSsYlzDh3vSpLvqAPhc/jw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Message-ID: <394c1b94-beaf-bdcb-c333-65dd9987be54@suse.com> Date: Mon, 25 Apr 2022 12:46:17 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 Content-Language: en-US To: "xen-devel@lists.xenproject.org" Cc: Andrew Cooper , George Dunlap , Julien Grall , Stefano Stabellini , Wei Liu From: Jan Beulich Subject: [PATCH RFC] EFI: strip xen.efi when putting it on the EFI partition Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: AM6P191CA0088.EURP191.PROD.OUTLOOK.COM (2603:10a6:209:8a::29) To DU2PR04MB8616.eurprd04.prod.outlook.com (2603:10a6:10:2db::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0ea2bb26-9a84-4b51-0a8e-08da26a8d4d6 X-MS-TrafficTypeDiagnostic: DB7PR04MB4377:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: RBr1rDrryuCt/uQz9VSJSsOdT1yt02oXVMO6iBJ9FjIxIOdt/vA60URIWRxYwT5U6kcslcYlol/aWhIbihEB+xQCFcL1YRFTQc1Oexw55QlqsK23bIWjNGdyeRxwATK237JkhPQKDoi6Ue6OBapHDPUaajBzZgJ27mCwfj2bDXYpM/R+YW4Azq1QmBGRM1DmD00Uc4vb1/pw6dgln5uO/ZPKLZO0FmkV0kLfhXgc+SizeUDZByJdc08vi2oCbDg1QM1TO3wPFmskRRRcxqa1VFsNOa8YfD/usBgqldWF8JXj+ToLRktIVJj1BnMxfHVEup0+BF5EFGUoEQyYPqkwPL7lk+fE6h58XiSOD/2tjqa3soSlOrv+kFTrNQmRjdQq2U3nao1zhcG1mAYcl39Xkho4ItOhy1i8TpCPUDCngxUTFVepcrT+H9K2/AH0fjXYNR0D47kaSWmbpGKYtRf4krNxVPdCxtnliU6rPDgjtD5kFvSR6wy1tw5tpUfH+H0eeMP4GUaTHVNDA4Iqv7yvudx3PlzxdDIr5FxiPYeaZwS1FGd/ynfgIXNu2KnP0olvl65zJpPHqQnm5T1atkeofCQe9cU11wArAuBp4HNFNw3v2FO4oeuzN+w8trCCuJQ+DcK/KkoeVN54bGTOeqMWZy4+RVcpd5SUp6RJ9z5N6g0+nGpG1ZQGtliwnhdSnTDKqwv8Prc99JnIfE1W8XfyP05ptN2k0qL268zOP1ue2EA= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8616.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(366004)(4326008)(26005)(66556008)(5660300002)(186003)(6486002)(66476007)(8676002)(54906003)(36756003)(6916009)(31686004)(8936002)(66946007)(6512007)(316002)(508600001)(6506007)(83380400001)(2616005)(86362001)(38100700002)(31696002)(2906002)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?aVZYajB1NiswcU1FRHFQckJoSnY5Wm83bzhHcGJ6Tm0wRDJQczZMVjlCQ2NM?= =?utf-8?B?Z2pXQy9TaVVjY3llNGtCM3ZjYm1WUFBxSENPcUduQXV0bUVhZlpRWmZNVkhC?= =?utf-8?B?OFlubU1teHdhcVBmQ25EdDJEUmpyYVJxTFFkbFpDZHBGaDVzemRJMFhuNito?= =?utf-8?B?NGx4dVVTTTNzRng5NVdiT1R2WWYxS1Q4ZWNxQ2RrMmZsMzBERG5sbUJ1ZUhW?= =?utf-8?B?bkFFY1VUbkd2UU8xUWJuRkdqQnU2UTZKai81cE1RYktyc3Z2VGVwTUd4SS9H?= =?utf-8?B?UzFvWjN2SHg2WXBKbDNOQ1dzcmNmSzN1dmdhNWl4NE9MZkE2T0JQTnZ6TmJH?= =?utf-8?B?QlE1MCtaYlRxN1NVRXhabDVXeUgxeVhrODBpbmNnYjM0U1NxelhpS3E4QlY2?= =?utf-8?B?VWZTN2JjUDR2eVdpMS9NOGhyTUlibEkrNElReTJKU3kreWFPcGVKdWI2UDlI?= =?utf-8?B?UVYxWjRRNEExdklYTVpxVlV3VkhjclFuOGoxOS95K29FSUJGemRXQzl1YlJv?= =?utf-8?B?SU40QWFtSDRTbC9DT3l2eHJYK0hYNVZrcTV3YmRPZzhNeUkxM3YxZmdLd2M3?= =?utf-8?B?Y3g3TkNsM0RGdk5wQzRHMGsvWGIzcjZKMmNNZHpWbXN1M2lmT0I2em1QV1o5?= =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R04MB8616.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Apr 2022 10:46:19.4754 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: DsQEmnazSdp3T2NTiKal4fkGQfSRx7XLPYFBG/3HEMstIecCe1SuCpNQLsBNPNCx2R1lG1ZCNS667kxcAvCTOQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR04MB4377 X-ZohoMail-DKIM: pass (identity @suse.com) X-ZM-MESSAGEID: 1650883635565100001 Content-Type: text/plain; charset="utf-8" With debug info retained, xen.efi can be quite large. Unlike for xen.gz there's no intermediate step (mkelf32 there) involved which would strip debug info kind of as a side effect. While the installing of xen.efi on the EFI partition is an optional step (intended to be a courtesy to the developer), adjust it also for the purpose of documenting what distros would be expected to do during boot loader configuration (which is what would normally put xen.efi into the EFI partition). Model the control over stripping after Linux'es module installation, except that the stripped executable is constructed in the build area instead of in the destination location. This is to conserve on space used there - EFI partitions tend to be only a few hundred Mb in size. Signed-off-by: Jan Beulich --- RFC: GNU strip 2.38 appears to have issues when acting on a PE binary: - the new file positions of the sections do not respect the file alignment specified by the header (a resulting looks to work on one EFI implementation where I did actually try it, but I don't think we can rely on that), - file name symbols are also stripped; while there is a separate --keep-file-symbols option (which I would have thought to be on by default anyway), its use makes no difference. Older GNU strip (observed with 2.35.1) doesn't work at all ("Data Directory size (1c) exceeds space left in section (8)"). --- a/xen/Makefile +++ b/xen/Makefile @@ -461,6 +461,22 @@ endif .PHONY: _build _build: $(TARGET)$(CONFIG_XEN_INSTALL_SUFFIX) =20 +# Strip +# +# INSTALL_EFI_STRIP, if defined, will cause xen.efi to be stripped before = it +# is installed. If INSTALL_EFI_STRIP is '1', then the default option +# --strip-debug will be used. Otherwise, INSTALL_EFI_STRIP value will be u= sed +# as the option(s) to the strip command. +ifdef INSTALL_EFI_STRIP + +ifeq ($(INSTALL_EFI_STRIP),1) +efi-strip-opt :=3D --strip-debug +else +efi-strip-opt :=3D $(INSTALL_EFI_STRIP) +endif + +endif + .PHONY: _install _install: D=3D$(DESTDIR) _install: T=3D$(notdir $(TARGET)) @@ -485,6 +501,9 @@ _install: $(TARGET)$(CONFIG_XEN_INSTALL_ ln -sf $(T)-$(XEN_FULLVERSION).efi $(D)$(EFI_DIR)/$(T)-$(XEN_VERSION).ef= i; \ ln -sf $(T)-$(XEN_FULLVERSION).efi $(D)$(EFI_DIR)/$(T).efi; \ if [ -n '$(EFI_MOUNTPOINT)' -a -n '$(EFI_VENDOR)' ]; then \ + $(if $(efi-strip-opt), \ + $(STRIP) $(efi-strip-opt) -p -o $(TARGET).efi.stripped $(TARGET).e= fi && \ + $(INSTALL_DATA) $(TARGET).efi.stripped $(D)$(EFI_MOUNTPOINT)/efi/$= (EFI_VENDOR)/$(T)-$(XEN_FULLVERSION).efi ||) \ $(INSTALL_DATA) $(TARGET).efi $(D)$(EFI_MOUNTPOINT)/efi/$(EFI_VENDOR)/$= (T)-$(XEN_FULLVERSION).efi; \ elif [ "$(D)" =3D "$(patsubst $(shell cd $(XEN_ROOT) && pwd)/%,%,$(D))" = ]; then \ echo 'EFI installation only partially done (EFI_VENDOR not set)' >&2; \