All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xen: Consolidate linker script setup data
@ 2026-09-23 16:19 Jason Andryuk
  2026-09-24 15:58 ` Alejandro Vallejo
  0 siblings, 1 reply; 3+ messages in thread
From: Jason Andryuk @ 2026-09-23 16:19 UTC (permalink / raw)
  To: xen-devel
  Cc: Jason Andryuk, Stefano Stabellini, Julien Grall, Bertrand Marquis,
	Michal Orzel, Volodymyr Babchuk, Andrew Cooper, Anthony PERARD,
	Jan Beulich, Roger Pau Monné, Timothy Pearson,
	Alistair Francis, Connor Davis, Oleksii Kurochko, Teddy Astie,
	Grygorii Strashko, Alejandro Vallejo

.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@epam.com>
Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
Reviewed-by: Alejandro Vallejo <alejandro.garciavallejo@amd.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
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



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] xen: Consolidate linker script setup data
  2026-09-23 16:19 [PATCH] xen: Consolidate linker script setup data Jason Andryuk
@ 2026-09-24 15:58 ` Alejandro Vallejo
  2026-09-25  9:44   ` Orzel, Michal
  0 siblings, 1 reply; 3+ messages in thread
From: Alejandro Vallejo @ 2026-09-24 15:58 UTC (permalink / raw)
  To: Jason Andryuk, xen-devel
  Cc: Stefano Stabellini, Julien Grall, Bertrand Marquis, Michal Orzel,
	Volodymyr Babchuk, Andrew Cooper, Anthony PERARD, Jan Beulich,
	Roger Pau Monné, Timothy Pearson, Alistair Francis,
	Connor Davis, Oleksii Kurochko, Teddy Astie, Grygorii Strashko

On Wed Sep 23, 2026 at 6:19 PM CEST, Jason Andryuk wrote:
> .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@epam.com>
> Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
> Reviewed-by: Alejandro Vallejo <alejandro.garciavallejo@amd.com>
> Reviewed-by: Jan Beulich <jbeulich@suse.com>
> ---
> Alejandro reviewed internally.

In case it matters, I confirm.

Cheers,
Alejandro

> 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); \



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] xen: Consolidate linker script setup data
  2026-09-24 15:58 ` Alejandro Vallejo
@ 2026-09-25  9:44   ` Orzel, Michal
  0 siblings, 0 replies; 3+ messages in thread
From: Orzel, Michal @ 2026-09-25  9:44 UTC (permalink / raw)
  To: Alejandro Vallejo, Jason Andryuk, xen-devel
  Cc: Stefano Stabellini, Julien Grall, Bertrand Marquis,
	Volodymyr Babchuk, Andrew Cooper, Anthony PERARD, Jan Beulich,
	Roger Pau Monné, Timothy Pearson, Alistair Francis,
	Connor Davis, Oleksii Kurochko, Teddy Astie, Grygorii Strashko



On 24-Sep-26 17:58, Alejandro Vallejo wrote:
> On Wed Sep 23, 2026 at 6:19 PM CEST, Jason Andryuk wrote:
>> .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@epam.com>
>> Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
>> Reviewed-by: Alejandro Vallejo <alejandro.garciavallejo@amd.com>
>> Reviewed-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Michal Orzel <michal.orzel@amd.com>

~Michal



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-09-25  9:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-23 16:19 [PATCH] xen: Consolidate linker script setup data Jason Andryuk
2026-09-24 15:58 ` Alejandro Vallejo
2026-09-25  9:44   ` Orzel, Michal

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.