diff mbox

[v3,3/4] xen/init: Move initcall infrastructure into .init.data

Message ID 1466676775-11603-1-git-send-email-andrew.cooper3@citrix.com (mailing list archive)
State New, archived
Headers show

Commit Message

Andrew Cooper June 23, 2016, 10:12 a.m. UTC
Its contents is constant.

The ALIGN(32) is also dropped.  On x86, there is nothing between it and a
larger alignment.  On ARM, __init_end_efi is between the two, but its sole use
is to fill SizeOfRawData in the PE Section Table, and doesn't require any
specific alignment.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Stefano Stabellini <sstabellini@kernel.org>
CC: Julien Grall <julien.grall@arm.com>

v3:
 * Expand the commit message
v2:
 * New
---
 xen/arch/arm/xen.lds.S | 14 ++++++--------
 xen/arch/x86/xen.lds.S | 14 ++++++--------
 xen/include/xen/init.h |  4 ++--
 3 files changed, 14 insertions(+), 18 deletions(-)

Comments

Julien Grall June 23, 2016, 11:46 a.m. UTC | #1
Hi Andrew,

On 23/06/16 11:12, Andrew Cooper wrote:
> Its contents is constant.
>
> The ALIGN(32) is also dropped.  On x86, there is nothing between it and a
> larger alignment.  On ARM, __init_end_efi is between the two, but its sole use
> is to fill SizeOfRawData in the PE Section Table, and doesn't require any
> specific alignment.
>
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> Reviewed-by: Jan Beulich <jbeulich@suse.com>

For ARM bits:

Acked-by: Julien Grall <julien.grall@arm.com>

Regards,
diff mbox

Patch

diff --git a/xen/arch/arm/xen.lds.S b/xen/arch/arm/xen.lds.S
index b00ee81..b18c9c2 100644
--- a/xen/arch/arm/xen.lds.S
+++ b/xen/arch/arm/xen.lds.S
@@ -145,6 +145,12 @@  SECTIONS
        *(.init.proc.info)
        __proc_info_end = .;
 
+       __initcall_start = .;
+       *(.initcallpresmp.init)
+       __presmp_initcall_end = .;
+       *(.initcall1.init)
+       __initcall_end = .;
+
        *(.init.data)
        *(.init.data.rel)
        *(.init.data.rel.*)
@@ -154,14 +160,6 @@  SECTIONS
        *(.init_array)
        __ctors_end = .;
   } :text
-  . = ALIGN(32);
-  .initcall.init : {
-       __initcall_start = .;
-       *(.initcallpresmp.init)
-       __presmp_initcall_end = .;
-       *(.initcall1.init)
-       __initcall_end = .;
-  } :text
   __init_end_efi = .;
   . = ALIGN(STACK_SIZE);
   __init_end = .;
diff --git a/xen/arch/x86/xen.lds.S b/xen/arch/x86/xen.lds.S
index 2443b93..a1678d8 100644
--- a/xen/arch/x86/xen.lds.S
+++ b/xen/arch/x86/xen.lds.S
@@ -158,6 +158,12 @@  SECTIONS
        *(.init.setup)
        __setup_end = .;
 
+       __initcall_start = .;
+       *(.initcallpresmp.init)
+       __presmp_initcall_end = .;
+       *(.initcall1.init)
+       __initcall_end = .;
+
        *(.init.data)
        *(.init.data.rel)
        *(.init.data.rel.*)
@@ -183,14 +189,6 @@  SECTIONS
        *(.ctors)
        __ctors_end = .;
   } :text
-  . = ALIGN(32);
-  .initcall.init : {
-       __initcall_start = .;
-       *(.initcallpresmp.init)
-       __presmp_initcall_end = .;
-       *(.initcall1.init)
-       __initcall_end = .;
-  } :text
   . = ALIGN(PAGE_SIZE);
   __init_end = .;
 
diff --git a/xen/include/xen/init.h b/xen/include/xen/init.h
index b04bcf9..0afc430 100644
--- a/xen/include/xen/init.h
+++ b/xen/include/xen/init.h
@@ -61,9 +61,9 @@  typedef int (*initcall_t)(void);
 typedef void (*exitcall_t)(void);
 
 #define presmp_initcall(fn) \
-    static initcall_t __initcall_##fn __init_call("presmp") = fn
+    const static initcall_t __initcall_##fn __init_call("presmp") = fn
 #define __initcall(fn) \
-    static initcall_t __initcall_##fn __init_call("1") = fn
+    const static initcall_t __initcall_##fn __init_call("1") = fn
 #define __exitcall(fn) \
     static exitcall_t __exitcall_##fn __exit_call = fn