From nobody Fri Nov 29 08:47:23 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=citrix.com); dmarc=pass(p=reject dis=none) header.from=citrix.com ARC-Seal: i=2; a=rsa-sha256; t=1646228723; cv=pass; d=zohomail.com; s=zohoarc; b=ZmTb27Ewvz2WbDU0wdixN1Mej0woJNYVviXDn2HOJGa46E5VZxK9Hli1c7wTLjh0oPeWBlvqDuA2Sn7vFxYBdTr3nqH/Aidocl8AwkUv6+Opsstvu+bTqDt24vdFBlT5LGCNTf1rFa6kKBFv85xsjeqpMe6uJ3/hHw6g0G/JMCE= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1646228723; 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=/GuEWfnh7t7WFYhXPlf7lXrB2XILSCmjAhkM/Liht00=; b=RXqaOUFn6UelAVvsjYm7P0kXByM3b/iU3mybCBeU7/eX5ZFj45z8Vt1GqrtwXAReXpy9ptX/P0nty2w9rEx22OJOrj7VyecWK1NSlOE9IPDDUyesb+OQr23sl6lH9oWWmpgx6YTtBR71VzI5ecJ6CobOI/0tuoO+HP/z/JK0Tgo= 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=citrix.com); dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1646228723425896.7515607788412; Wed, 2 Mar 2022 05:45:23 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.282251.480884 (Exim 4.92) (envelope-from ) id 1nPPHp-00028y-2x; Wed, 02 Mar 2022 13:45:01 +0000 Received: by outflank-mailman (output) from mailman id 282251.480884; Wed, 02 Mar 2022 13:45:01 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nPPHo-00028r-Vy; Wed, 02 Mar 2022 13:45:00 +0000 Received: by outflank-mailman (input) for mailman id 282251; Wed, 02 Mar 2022 13:45:00 +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 1nPPHn-00028l-Vo for xen-devel@lists.xenproject.org; Wed, 02 Mar 2022 13:45:00 +0000 Received: from esa4.hc3370-68.iphmx.com (esa4.hc3370-68.iphmx.com [216.71.155.144]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id f23861b8-9a2e-11ec-8539-5f4723681683; Wed, 02 Mar 2022 14:44:58 +0100 (CET) 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: f23861b8-9a2e-11ec-8539-5f4723681683 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1646228697; h=from:to:cc:subject:date:message-id: content-transfer-encoding:mime-version; bh=yy95bZc1mafoynhoap3Dua9XOm5rukrDtL8/9mucZuA=; b=N0la9Poldn8bJMGAisj9ekpt6wT1pOPLPDuHumrdp0b54uIXhyAUBSHy kSJt1Q7SfWrz9fpSZJ0Y/tvcSYoeAv+opxMNXe6/qE8y0xfxHEjkDjgBP 03yvKGbzL+Vi5IvhbGELfca6GSWtHu3SXPfqjvIx5nyj4PswKHxips+uU E=; Authentication-Results: esa4.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com X-SBRS: 5.1 X-MesageID: 67611185 X-Ironport-Server: esa4.hc3370-68.iphmx.com X-Remote-IP: 162.221.156.83 X-Policy: $RELAYED IronPort-Data: A9a23:GHsVbq+YRLaz+LUzroUQDrUDdH6TJUtcMsCJ2f8bNWPcYEJGY0x3z TBNXTzVOqvcYTGjLdsgbdzj9UpTsMDQxtRmHAA5qi88E34SpcT7XtnIdU2Y0wF+jyHgoOCLy +1EN7Es+ehtFie0Si+Fa+Sn9T8mvU2xbuKU5NTsY0idfic5DnZ54f5fs7Rh2NQw2oDjW1jlV e7a+KUzBnf0g1aYDUpMg06zgEsHUCPa4W5wUvQWPJinjXeG/5UnJMt3yZKZdhMUdrJ8DO+iL 9sv+Znilo/vE7XBPfv++lrzWhVirrc/pmFigFIOM0SpqkAqSiDfTs/XnRfTAKtao2zhojx/9 DlCna6cYCcPb63HoroidkZAThgvH7RZ1LCSdBBTseTLp6HHW37lwvEoB0AqJ4wIvO1wBAmi9 9RBdmpLNErawbvrnvTrEYGAhex6RCXvFJkYtXx6iynQEN4tQIzZQrWM7thdtNs1rp4RQ6+HP ppEAdZpREX9ah91Z2saMrkRgeKOuiKjcB5f72vA8MLb5ECMlVcsgdABKuH9ZdiiVchT2EGCq Qru9WnjHgsTMtDZzDOf62+tncfGhya9U4UXfJWG8fptjEyW13YkIhQcXlumotG0kke7HdlYL iQ84TEypKI/8EiqSNjVXBCipnOA+BkGVLJ4A+A8rQ2A1KfQywKYHXQfCC5MbsQ8s807TiBs0 UWG9/vrDzFytLyeSVqG66yZ6zi1PEA9L3IGZCICZRsI5Z/kuo5bs/7UZo89Sujv1ISzQGyuh WDRxMQju1kNpfwn/oWdrFDMuWyTg8fRE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cKo4DuYcRsm8DHDLXHv3QSmvCEWiELtCN2PGqpbx7rlw7Oa2eIYQxJ93g5 jFWEMwjx9ER6svM7z74HRmyGG8fIzmZ0Wd9ih33ekLhoHB X-IronPort-AV: E=Sophos;i="5.90,149,1643691600"; d="scan'208";a="67611185" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mDqVfh6oljSx4eBGR10x6EWxja3KSGkv7qSLPWofeJed+WEbd6/c86cDvFwQ16HbtPK40sxI2cYZ/q7W6gSWdn95gKgUQI6nJzYqoRpNgQvKajCsNeYztR/3VzUwrfTI7aDuX2pv1swyAtqbOzRcaNOz+5DaB9Guvp+gEDBlwsD9KTO8c5Y2tFObGu3+pzt/TdePvvRzxvsPKyNzmwh5V9CB2odqIVee/VlTWIb9wPi2P1/c8hWTVNxucdX51r9iqu0+54hmeG1axbBb6qUj+GNsAWY79NT0ptgFvDfSddM47tAD1pWO2gPtxoCtsyGkGoGcY1vkncnRovFmAk1Qzg== 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=/GuEWfnh7t7WFYhXPlf7lXrB2XILSCmjAhkM/Liht00=; b=F/ERbX3jh3zH9e1ytbr4hAE0/yl0/q5QrJM9F9SVmNPMjPwnEpUlQ7wJVfbZmEywpLmcSNcZMdfSMwkl4TBWPuFRCdrhWrY1A77nkUtALPameFBvUuQ0yMV/1Mb46IYNn8Daol54wBejKDplA14EQsXnU2ixoZfbtrb7mIWfM46E92F0vAzQfUxYkWw/UkWjTmkril+rZ2iVpYPVEvTVv+BuKXn3OTdvLmposYNZvW59XrYsJ3/hfj5ypZcFrshggcichC2xB8H8LnBBmc+Z9uIczZ1xP7GiFbocb/XD6lyy5W06qZHGoLnnRuc9iTX5Fvwpq9QnDVOYaGE6DytKnQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/GuEWfnh7t7WFYhXPlf7lXrB2XILSCmjAhkM/Liht00=; b=SeXgBtTSt8lN6ChEZBGu89htEsjNMe8xX/7VkkvFUz7sT2ZXHyplfrLNtXxazGQXtnba2LI0/lroB4f8sfoQYmwPpZVmpG+TRyVGT0u7vhwswDqA6VwIxVJEE9xBIuEpPvRz2DHi4ckKpvCVunNNTMNf/J4HFrHcfS0Dlp3qdec= From: Roger Pau Monne To: CC: Roger Pau Monne , Andrew Cooper , George Dunlap , Jan Beulich , Julien Grall , Stefano Stabellini , Wei Liu , Bertrand Marquis , Volodymyr Babchuk Subject: [PATCH] livepatch: set -f{function,data}-sections compiler option Date: Wed, 2 Mar 2022 14:44:25 +0100 Message-ID: <20220302134425.38465-1-roger.pau@citrix.com> X-Mailer: git-send-email 2.34.1 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: LO2P265CA0089.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:8::29) To DS7PR03MB5608.namprd03.prod.outlook.com (2603:10b6:5:2c9::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5ac78c45-a56f-4859-078d-08d9fc52d3a9 X-MS-TrafficTypeDiagnostic: CY1PR03MB2251: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: Aiii8L2YNGwHzC8H2vhxlbAelxQJ1dgsybLkumfo01AqrG0d+QpdgbLedltfuEtfgWQlzaMp5H5vJxsx8SxHKzb/VSpNsjKNXUv/pE+isszwQZCrEW8L8jvfWfuWSRDsUo9WOO+HxPuNO1krGhIX+u4lB69/VXS0o9x+YRyuyZehku6klcgVwJtpfZ2plaucZtxpCFrJh/mH0Yn2nbDqZ9pKPrRdM54T3CZCmtov6tJE/3R2D4jKpBtGDqd0Pg+C5D07CT+ooP1iOLhRfF5k6/tvm2xMU/PrWzDXEsa7Yb0NZ7nvGwMDZswu1ia1X6o1nmdTKKmh4AUgM2pY2YucHSLCi482fxiHpsH8kItNIQnU+35bFs57yhM8Ds8YXLvysdaFUXSlyREyIjD4MDRIrfoHDKOmTlrwD+ve6LR0CPAtnikHHoz/vP6kJNB7PyXedjXGUGlrqs36JVQPKlC+Rh7yBQ5rz1iqwGAQbYsa6Vs+tQQdcl2Q6Dlcmep2SZXfSK0wGjxW6GMpIxV4L/eMDppsUzuEsTedqshS0WyA0YInnG3D2KczqNQJVJdVcjs8QP01gu5QUAkFx1LYLZRHE9e43lxfI8qwpuWuugP5jE3B/rsVocEhSeufhWz+LP94u26gcxCRCwq9J3NbNQMyHA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS7PR03MB5608.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(6512007)(82960400001)(26005)(6486002)(508600001)(6916009)(54906003)(316002)(38100700002)(4326008)(86362001)(6666004)(66556008)(66946007)(36756003)(6506007)(66476007)(5660300002)(2906002)(8936002)(8676002)(83380400001)(1076003)(2616005)(186003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?WmJKREErSzhCaFVxbzAwRWRXSGRGWlhSNmIydDZVWFNLWU5pUzh6cmxQK2oy?= =?utf-8?B?Z3JoUzJ1amZvNlZoW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l?= =?utf-8?B?M2NiRE1teDYrYUhGYy9hbTh3Wk9JaGljMTF2T0Y0VlRxTjlIZWlHYklBb2E0?= =?utf-8?B?RjhSbWM0MWRCMGZzQk9GQWtubDZhNzVBMjZIc3FiRG0rZ29oRGhuL0l1OUsy?= =?utf-8?B?UWluKzZXT0FtQjJBT0ZaUzVxNzZyb282eTFJcDd4WmRIRmU0ZDAwNmxOcnd0?= =?utf-8?B?V2FaQ0c3RlpCZ1J0UXByODk2Q0dqNUxyTjEzeUdZV2p4L1NnL21YQ3ZtVkpm?= =?utf-8?B?TkN3cXJXcmJVRG1LZHpMMnN1L0tsdS9HRmt1bHE2VmVYeVFyS1NYOGttV0Uz?= =?utf-8?Q?X349z9KpTHpU1zGx5OsMm08=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 5ac78c45-a56f-4859-078d-08d9fc52d3a9 X-MS-Exchange-CrossTenant-AuthSource: DS7PR03MB5608.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Mar 2022 13:44:51.9942 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: w0oqgrGbcNrhugkfQU61iI3m81yFT09p0vKS0W6ukPbDZHYRjLka9R0nUhGr70TI0SrqiDh285P5cDcfmMj9kg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR03MB2251 X-OriginatorOrg: citrix.com X-ZohoMail-DKIM: pass (identity @citrix.com) X-ZM-MESSAGEID: 1646228725667100001 If livepatching support is enabled build the hypervisor with -f{function,data}-sections compiler options, which is required by the livepatching tools to detect changes and create livepatches. This shouldn't result in any functional change on the hypervisor binary image, but does however require some changes in the linker script in order to handle that each function and data item will now be placed into its own section in object files. As a result add catch-all for .text, .data and .bss in order to merge each individual item section into the final image. The main difference will be that .text.startup will end up being part of .text rather than .init, and thus won't be freed. Such section only seems to appear when using -Os, which not the default for debug or production binaries. The benefit of having CONFIG_LIVEPATCH enable those compiler options is that the livepatch build tools no longer need to fiddle with the build system in order to enable them. Note the current livepatch tools are broken after the recent build changes due to the way they attempt to set -f{function,data}-sections. Signed-off-by: Roger Pau Monn=C3=A9 --- xen/Makefile | 4 ++++ xen/arch/arm/xen.lds.S | 9 +++++++++ xen/arch/x86/xen.lds.S | 9 +++++++++ xen/common/Kconfig | 4 +++- 4 files changed, 25 insertions(+), 1 deletion(-) diff --git a/xen/Makefile b/xen/Makefile index ed4891daf1..bf14a9bdd2 100644 --- a/xen/Makefile +++ b/xen/Makefile @@ -269,6 +269,10 @@ else CFLAGS +=3D -fomit-frame-pointer endif =20 +ifeq ($(CONFIG_LIVEPATCH),y) +CFLAGS +=3D -ffunction-sections -fdata-sections +endif + CFLAGS +=3D -nostdinc -fno-builtin -fno-common CFLAGS +=3D -Werror -Wredundant-decls -Wno-pointer-arith $(call cc-option-add,CFLAGS,CC,-Wvla) diff --git a/xen/arch/arm/xen.lds.S b/xen/arch/arm/xen.lds.S index 08016948ab..1c7c7d5469 100644 --- a/xen/arch/arm/xen.lds.S +++ b/xen/arch/arm/xen.lds.S @@ -33,6 +33,9 @@ SECTIONS *(.text) *(.text.cold) *(.text.unlikely) +#ifdef CONFIG_LIVEPATCH + *(.text.*) +#endif *(.fixup) *(.gnu.warning) _etext =3D .; /* End of text section */ @@ -96,6 +99,9 @@ SECTIONS =20 *(.data.rel) *(.data.rel.*) +#ifdef CONFIG_LIVEPATCH + *(.data.*) +#endif CONSTRUCTORS } :text =20 @@ -208,6 +214,9 @@ SECTIONS . =3D ALIGN(SMP_CACHE_BYTES); __per_cpu_data_end =3D .; *(.bss) +#ifdef CONFIG_LIVEPATCH + *(.bss.*) +#endif . =3D ALIGN(POINTER_ALIGN); __bss_end =3D .; } :text diff --git a/xen/arch/x86/xen.lds.S b/xen/arch/x86/xen.lds.S index 83def6541e..81bb608151 100644 --- a/xen/arch/x86/xen.lds.S +++ b/xen/arch/x86/xen.lds.S @@ -88,6 +88,9 @@ SECTIONS =20 *(.text.cold) *(.text.unlikely) +#ifdef CONFIG_LIVEPATCH + *(.text.*) +#endif *(.fixup) *(.gnu.warning) _etext =3D .; /* End of text section */ @@ -292,6 +295,9 @@ SECTIONS *(.data) *(.data.rel) *(.data.rel.*) +#ifdef CONFIG_LIVEPATCH + *(.data.*) +#endif CONSTRUCTORS } PHDR(text) =20 @@ -308,6 +314,9 @@ SECTIONS . =3D ALIGN(SMP_CACHE_BYTES); __per_cpu_data_end =3D .; *(.bss) +#ifdef CONFIG_LIVEPATCH + *(.bss.*) +#endif . =3D ALIGN(POINTER_ALIGN); __bss_end =3D .; } PHDR(text) diff --git a/xen/common/Kconfig b/xen/common/Kconfig index 6443943889..2423d9f490 100644 --- a/xen/common/Kconfig +++ b/xen/common/Kconfig @@ -353,7 +353,9 @@ config CRYPTO config LIVEPATCH bool "Live patching support" default X86 - depends on "$(XEN_HAS_BUILD_ID)" =3D "y" + depends on "$(XEN_HAS_BUILD_ID)" =3D "y" && \ + $(cc-option,-ffunction-sections) && \ + $(cc-option,-fdata-sections) ---help--- Allows a running Xen hypervisor to be dynamically patched using binary patches without rebooting. This is primarily used to binarily --=20 2.34.1