[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] xen: Consolidate linker script setup data


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jason Andryuk <jason.andryuk@xxxxxxx>
  • Date: Wed, 23 Sep 2026 12:19:35 -0400
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=GyKqwygtGsE4qSrFPliY7ncBXi+c2UzL9Gwyvrui5b0=; b=N5sReWPRVLkC38xdLJc0SRnqD4YS3Xe5xTy1yV6aqlVa93vXfQzNdbt+xsIB1PY3hqgGZAelWMxaBrCXdxi2s+H7ApSNeliGxc3P5loUebT7K+mm4RlIaZdooZAEz97EE6dOVCUIxLuRE8b6pktvH07UcH5aMbCuMs2bF8yxFz83oeAi51Be764kfl99omGWUbqk46yXKDub70qmGQUlYpfDPNbAQ4xwykdQcE23w5y5cpRr9iO3ShqUkVP1FE0C0U0oJf/8BGQuOm3XVgAciAD7/mFksvBZU6jpIdjGMj0PGJqzY6i118oDsBD7wveodYOdYqRA3Y5FqXH+fCFSmw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Z+ogYtxpuJyktxxUPNzUYEgRMYKTOPncp8iH6OjAhNhPA3DQAwSmHuo0gT38zea09P//M/aBEeWM8I3k6pcRlCk2AYj4YNl3wDTC35YQM2SfS6dalxWgVpPNry/l6XtogUY2GvBBHHmEbTKmWTzR736JgIBfA+8GtndN4zDmUS6L3ueqwQCMI6D4cZNaev7Up93ZNYzqqfwVZ4JMhWYl9D9X2mSl0kC8FKsyyvOIX45PN0LEgnQq5arY+6EPCC1Je/D39lAExNQOKZZF4Tm6qsc54V7h8h8LkH4M8dqy6fCTpZfg3ruJw4Q+miArRXq/7qfREMxcJZGMpXqiGNzsgA==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=amd.com header.i="@amd.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
  • Cc: Jason Andryuk <jason.andryuk@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, "Volodymyr Babchuk" <Volodymyr_Babchuk@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, "Jan Beulich" <jbeulich@xxxxxxxx>, Roger Pau Monné <roger@xxxxxxxxxxxxxx>, Timothy Pearson <tpearson@xxxxxxxxxxxxxxxxxxxxx>, Alistair Francis <alistair.francis@xxxxxxx>, Connor Davis <connojdavis@xxxxxxxxx>, Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>, Teddy Astie <teddy.astie@xxxxxxxxxx>, Grygorii Strashko <grygorii_strashko@xxxxxxxx>, Alejandro Vallejo <alejandro.garciavallejo@xxxxxxx>
  • Delivery-date: Wed, 23 Sep 2026 16:20:08 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

.init.setup, .initcallpresmp.init, and .initcall1.init are duplicated
across architectures.  Replace them with a common define, SETUP_DATA.

Suggested-by: Grygorii Strashko <grygorii_strashko@xxxxxxxx>
Signed-off-by: Jason Andryuk <jason.andryuk@xxxxxxx>
Reviewed-by: Alejandro Vallejo <alejandro.garciavallejo@xxxxxxx>
Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
---
Alejandro reviewed internally.
Jan reviewed off list.
---
 xen/arch/arm/xen.lds.S    | 11 +----------
 xen/arch/ppc/xen.lds.S    | 12 +-----------
 xen/arch/riscv/xen.lds.S  | 12 +-----------
 xen/arch/x86/xen.lds.S    | 11 +----------
 xen/include/xen/xen.lds.h | 12 ++++++++++++
 5 files changed, 16 insertions(+), 42 deletions(-)

diff --git a/xen/arch/arm/xen.lds.S b/xen/arch/arm/xen.lds.S
index d4d9594033..32afbfe131 100644
--- a/xen/arch/arm/xen.lds.S
+++ b/xen/arch/arm/xen.lds.S
@@ -135,16 +135,7 @@ SECTIONS
        *(.init.rodata)
        *(.init.rodata.*)
 
-       . = ALIGN(POINTER_ALIGN);
-       __setup_start = .;
-       *(.init.setup)
-       __setup_end = .;
-
-       __initcall_start = .;
-       *(.initcallpresmp.init)
-       __presmp_initcall_end = .;
-       *(.initcall1.init)
-       __initcall_end = .;
+       SETUP_DATA
 
        . = ALIGN(4);
        __alt_instructions = .;
diff --git a/xen/arch/ppc/xen.lds.S b/xen/arch/ppc/xen.lds.S
index d0f2ed43f1..37256c8865 100644
--- a/xen/arch/ppc/xen.lds.S
+++ b/xen/arch/ppc/xen.lds.S
@@ -107,17 +107,7 @@ SECTIONS
         *(.init.rodata)
         *(.init.rodata.*)
 
-        . = ALIGN(POINTER_ALIGN);
-        __setup_start = .;
-        *(.init.setup)
-        __setup_end = .;
-
-        __initcall_start = .;
-        *(.initcallpresmp.init)
-        __presmp_initcall_end = .;
-        *(.initcall1.init)
-        __initcall_end = .;
-
+        SETUP_DATA
         LOCK_PROFILE_DATA
 
         *(.init.data)
diff --git a/xen/arch/riscv/xen.lds.S b/xen/arch/riscv/xen.lds.S
index 70db658fef..d9375a9616 100644
--- a/xen/arch/riscv/xen.lds.S
+++ b/xen/arch/riscv/xen.lds.S
@@ -114,17 +114,7 @@ SECTIONS
         *(.init.rodata)
         *(.init.rodata.*)
 
-        . = ALIGN(POINTER_ALIGN);
-        __setup_start = .;
-        *(.init.setup)
-        __setup_end = .;
-
-        __initcall_start = .;
-        *(.initcallpresmp.init)
-        __presmp_initcall_end = .;
-        *(.initcall1.init)
-        __initcall_end = .;
-
+        SETUP_DATA
         LOCK_PROFILE_DATA
 
         *(.init.data)
diff --git a/xen/arch/x86/xen.lds.S b/xen/arch/x86/xen.lds.S
index b9e888e596..8f943e11ea 100644
--- a/xen/arch/x86/xen.lds.S
+++ b/xen/arch/x86/xen.lds.S
@@ -223,16 +223,7 @@ SECTIONS
        *(.init.rodata)
        *(.init.rodata.*)
 
-       . = ALIGN(POINTER_ALIGN);
-       __setup_start = .;
-       *(.init.setup)
-       __setup_end = .;
-
-       __initcall_start = .;
-       *(.initcallpresmp.init)
-       __presmp_initcall_end = .;
-       *(.initcall1.init)
-       __initcall_end = .;
+       SETUP_DATA
 
        *(.init.data)
        *(.init.data.rel)
diff --git a/xen/include/xen/xen.lds.h b/xen/include/xen/xen.lds.h
index ea11e3fb62..958f8256b0 100644
--- a/xen/include/xen/xen.lds.h
+++ b/xen/include/xen/xen.lds.h
@@ -179,6 +179,18 @@
        *(.data.schedulers)           \
        __end_schedulers_array = .;
 
+#define SETUP_DATA                   \
+       . = ALIGN(POINTER_ALIGN);     \
+       __setup_start = .;            \
+       *(.init.setup)                \
+       __setup_end = .;              \
+                                     \
+       __initcall_start = .;         \
+       *(.initcallpresmp.init)       \
+       __presmp_initcall_end = .;    \
+       *(.initcall1.init)            \
+       __initcall_end = .;
+
 #ifdef CONFIG_HYPFS
 #define HYPFS_PARAM              \
        . = ALIGN(POINTER_ALIGN); \
-- 
2.55.0




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.