xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 1/4] xen/init: Annotate all command line parameter infrastructure as const
@ 2016-06-21 16:59 Andrew Cooper
  2016-06-21 16:59 ` [PATCH v2 2/4] arm/init: Move .init.proc.info into .init.data Andrew Cooper
                   ` (5 more replies)
  0 siblings, 6 replies; 17+ messages in thread
From: Andrew Cooper @ 2016-06-21 16:59 UTC (permalink / raw)
  To: Xen-devel; +Cc: Andrew Cooper, Julien Grall, Stefano Stabellini, Jan Beulich

There is no reason for any of it to be modified.  Additionally, link
.init.setup beside the other constant .init data.

While editing this area, correct the types used in the extern
declarations for __setup_start and __setup_end to match the types the
linker actually produces.

No functional change.

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

v2:
 * Extra const
---
 xen/arch/arm/xen.lds.S | 11 ++++++-----
 xen/arch/x86/xen.lds.S | 11 ++++++-----
 xen/common/kernel.c    |  6 +++---
 xen/include/xen/init.h |  7 ++++---
 4 files changed, 19 insertions(+), 16 deletions(-)

diff --git a/xen/arch/arm/xen.lds.S b/xen/arch/arm/xen.lds.S
index 8320381..2ed7dee 100644
--- a/xen/arch/arm/xen.lds.S
+++ b/xen/arch/arm/xen.lds.S
@@ -135,6 +135,12 @@ SECTIONS
        *(.init.rodata)
        *(.init.rodata.rel)
        *(.init.rodata.str*)
+
+       . = ALIGN(POINTER_ALIGN);
+       __setup_start = .;
+       *(.init.setup)
+       __setup_end = .;
+
        *(.init.data)
        *(.init.data.rel)
        *(.init.data.rel.*)
@@ -145,11 +151,6 @@ SECTIONS
        __ctors_end = .;
   } :text
   . = ALIGN(32);
-  .init.setup : {
-       __setup_start = .;
-       *(.init.setup)
-       __setup_end = .;
-  } :text
   .init.proc.info : {
        __proc_info_start = .;
        *(.init.proc.info)
diff --git a/xen/arch/x86/xen.lds.S b/xen/arch/x86/xen.lds.S
index dcbb8fe..2443b93 100644
--- a/xen/arch/x86/xen.lds.S
+++ b/xen/arch/x86/xen.lds.S
@@ -152,6 +152,12 @@ SECTIONS
        *(.init.rodata)
        *(.init.rodata.rel)
        *(.init.rodata.str*)
+
+       . = ALIGN(POINTER_ALIGN);
+       __setup_start = .;
+       *(.init.setup)
+       __setup_end = .;
+
        *(.init.data)
        *(.init.data.rel)
        *(.init.data.rel.*)
@@ -178,11 +184,6 @@ SECTIONS
        __ctors_end = .;
   } :text
   . = ALIGN(32);
-  .init.setup : {
-       __setup_start = .;
-       *(.init.setup)
-       __setup_end = .;
-  } :text
   .initcall.init : {
        __initcall_start = .;
        *(.initcallpresmp.init)
diff --git a/xen/common/kernel.c b/xen/common/kernel.c
index dae7e35..942b042 100644
--- a/xen/common/kernel.c
+++ b/xen/common/kernel.c
@@ -27,7 +27,7 @@ int tainted;
 xen_commandline_t saved_cmdline;
 
 static void __init assign_integer_param(
-    struct kernel_param *param, uint64_t val)
+    const struct kernel_param *param, uint64_t val)
 {
     switch ( param->len )
     {
@@ -52,7 +52,7 @@ void __init cmdline_parse(const char *cmdline)
 {
     char opt[100], *optval, *optkey, *q;
     const char *p = cmdline;
-    struct kernel_param *param;
+    const struct kernel_param *param;
     int bool_assert;
 
     if ( cmdline == NULL )
@@ -96,7 +96,7 @@ void __init cmdline_parse(const char *cmdline)
         if ( !bool_assert )
             optkey += 3;
 
-        for ( param = &__setup_start; param < &__setup_end; param++ )
+        for ( param = __setup_start; param < __setup_end; param++ )
         {
             if ( strcmp(param->name, optkey) )
             {
diff --git a/xen/include/xen/init.h b/xen/include/xen/init.h
index 671ac81..b04bcf9 100644
--- a/xen/include/xen/init.h
+++ b/xen/include/xen/init.h
@@ -86,10 +86,11 @@ struct kernel_param {
     void *var;
 };
 
-extern struct kernel_param __setup_start, __setup_end;
+extern const struct kernel_param __setup_start[], __setup_end[];
 
-#define __setup_str static __initdata __attribute__((__aligned__(1))) char
-#define __kparam static __initsetup \
+#define __setup_str static const  __initconstrel \
+    __attribute__((__aligned__(1))) char
+#define __kparam static const __initsetup \
     __attribute__((__aligned__(sizeof(void *)))) struct kernel_param
 
 #define custom_param(_name, _var) \
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

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

* [PATCH v2 2/4] arm/init: Move .init.proc.info into .init.data
  2016-06-21 16:59 [PATCH v2 1/4] xen/init: Annotate all command line parameter infrastructure as const Andrew Cooper
@ 2016-06-21 16:59 ` Andrew Cooper
  2016-06-21 17:18   ` Konrad Rzeszutek Wilk
  2016-06-23 11:44   ` Julien Grall
  2016-06-21 16:59 ` [PATCH v2 3/4] xen/init: Move initcall infrastructure " Andrew Cooper
                   ` (4 subsequent siblings)
  5 siblings, 2 replies; 17+ messages in thread
From: Andrew Cooper @ 2016-06-21 16:59 UTC (permalink / raw)
  To: Xen-devel; +Cc: Andrew Cooper, Julien Grall, Stefano Stabellini

Its contents is constant, and only requires pointer alignment, so move it
adacent to .init.setup.

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

v2:
 * New
---
 xen/arch/arm/xen.lds.S | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/xen/arch/arm/xen.lds.S b/xen/arch/arm/xen.lds.S
index 2ed7dee..b00ee81 100644
--- a/xen/arch/arm/xen.lds.S
+++ b/xen/arch/arm/xen.lds.S
@@ -141,6 +141,10 @@ SECTIONS
        *(.init.setup)
        __setup_end = .;
 
+       __proc_info_start = .;
+       *(.init.proc.info)
+       __proc_info_end = .;
+
        *(.init.data)
        *(.init.data.rel)
        *(.init.data.rel.*)
@@ -151,11 +155,6 @@ SECTIONS
        __ctors_end = .;
   } :text
   . = ALIGN(32);
-  .init.proc.info : {
-       __proc_info_start = .;
-       *(.init.proc.info)
-       __proc_info_end = .;
-  } :text
   .initcall.init : {
        __initcall_start = .;
        *(.initcallpresmp.init)
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

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

* [PATCH v2 3/4] xen/init: Move initcall infrastructure into .init.data
  2016-06-21 16:59 [PATCH v2 1/4] xen/init: Annotate all command line parameter infrastructure as const Andrew Cooper
  2016-06-21 16:59 ` [PATCH v2 2/4] arm/init: Move .init.proc.info into .init.data Andrew Cooper
@ 2016-06-21 16:59 ` Andrew Cooper
  2016-06-21 17:19   ` Konrad Rzeszutek Wilk
                     ` (2 more replies)
  2016-06-21 16:59 ` [PATCH v2 4/4] x86/boot: copy/clear sections more efficiently Andrew Cooper
                   ` (3 subsequent siblings)
  5 siblings, 3 replies; 17+ messages in thread
From: Andrew Cooper @ 2016-06-21 16:59 UTC (permalink / raw)
  To: Xen-devel; +Cc: Andrew Cooper, Julien Grall, Stefano Stabellini, Jan Beulich

Its contents is constant.

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

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(-)

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
 
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

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

* [PATCH v2 4/4] x86/boot: copy/clear sections more efficiently
  2016-06-21 16:59 [PATCH v2 1/4] xen/init: Annotate all command line parameter infrastructure as const Andrew Cooper
  2016-06-21 16:59 ` [PATCH v2 2/4] arm/init: Move .init.proc.info into .init.data Andrew Cooper
  2016-06-21 16:59 ` [PATCH v2 3/4] xen/init: Move initcall infrastructure " Andrew Cooper
@ 2016-06-21 16:59 ` Andrew Cooper
  2016-06-22  6:57 ` [PATCH v2 1/4] xen/init: Annotate all command line parameter infrastructure as const Jan Beulich
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 17+ messages in thread
From: Andrew Cooper @ 2016-06-21 16:59 UTC (permalink / raw)
  To: Xen-devel; +Cc: Andrew Cooper

Both the trampoline copy and BSS initialise can be performed more
efficiently by using 4-byte variants of the string operations.

On Intel systems with ERMSB (efficient rep movsb), this is no practical
difference.  On all other systems, this is 4 times more efficient.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
v2:
 * Alter spacing after rep prefix
---
 xen/arch/x86/boot/head.S | 9 +++++----
 xen/arch/x86/xen.lds.S   | 5 +++++
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/boot/head.S b/xen/arch/x86/boot/head.S
index 0999997..85770e8 100644
--- a/xen/arch/x86/boot/head.S
+++ b/xen/arch/x86/boot/head.S
@@ -128,7 +128,8 @@ __start:
         mov     $sym_phys(__bss_end),%ecx
         sub     %edi,%ecx
         xor     %eax,%eax
-        rep     stosb
+        shr     $2,%ecx
+        rep stosl
 
         /* Interrogate CPU extended features via CPUID. */
         mov     $0x80000000,%eax
@@ -192,8 +193,8 @@ __start:
 
         /* Copy bootstrap trampoline to low memory, below 1MB. */
         mov     $sym_phys(trampoline_start),%esi
-        mov     $trampoline_end - trampoline_start,%ecx
-        rep     movsb
+        mov     $((trampoline_end - trampoline_start) / 4),%ecx
+        rep movsl
 
         /* Jump into the relocated trampoline. */
         lret
@@ -205,6 +206,6 @@ reloc:
 
 ENTRY(trampoline_start)
 #include "trampoline.S"
-GLOBAL(trampoline_end)
+ENTRY(trampoline_end)
 
 #include "x86_64.S"
diff --git a/xen/arch/x86/xen.lds.S b/xen/arch/x86/xen.lds.S
index a1678d8..d620e7a 100644
--- a/xen/arch/x86/xen.lds.S
+++ b/xen/arch/x86/xen.lds.S
@@ -314,3 +314,8 @@ ASSERT(IS_ALIGNED(cpu0_stack, STACK_SIZE), "cpu0_stack misaligned")
 
 ASSERT(IS_ALIGNED(__init_begin, PAGE_SIZE), "__init_begin misaligned")
 ASSERT(IS_ALIGNED(__init_end,   PAGE_SIZE), "__init_end misaligned")
+
+ASSERT(IS_ALIGNED(trampoline_start, 4), "trampoline_start misaligned")
+ASSERT(IS_ALIGNED(trampoline_end,   4), "trampoline_end misaligned")
+ASSERT(IS_ALIGNED(__bss_start,      4), "__bss_start misaligned")
+ASSERT(IS_ALIGNED(__bss_end,        4), "__bss_end misaligned")
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

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

* Re: [PATCH v2 2/4] arm/init: Move .init.proc.info into .init.data
  2016-06-21 16:59 ` [PATCH v2 2/4] arm/init: Move .init.proc.info into .init.data Andrew Cooper
@ 2016-06-21 17:18   ` Konrad Rzeszutek Wilk
  2016-06-23 11:44   ` Julien Grall
  1 sibling, 0 replies; 17+ messages in thread
From: Konrad Rzeszutek Wilk @ 2016-06-21 17:18 UTC (permalink / raw)
  To: Andrew Cooper; +Cc: Julien Grall, Stefano Stabellini, Xen-devel

On Tue, Jun 21, 2016 at 05:59:03PM +0100, Andrew Cooper wrote:
> Its contents is constant, and only requires pointer alignment, so move it
> adacent to .init.setup.

adjacent

with that Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

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

* Re: [PATCH v2 3/4] xen/init: Move initcall infrastructure into .init.data
  2016-06-21 16:59 ` [PATCH v2 3/4] xen/init: Move initcall infrastructure " Andrew Cooper
@ 2016-06-21 17:19   ` Konrad Rzeszutek Wilk
  2016-06-21 17:25     ` Andrew Cooper
  2016-06-22  7:00   ` Jan Beulich
  2016-06-23 10:12   ` [PATCH v3 " Andrew Cooper
  2 siblings, 1 reply; 17+ messages in thread
From: Konrad Rzeszutek Wilk @ 2016-06-21 17:19 UTC (permalink / raw)
  To: Andrew Cooper; +Cc: Julien Grall, Stefano Stabellini, Jan Beulich, Xen-devel

On Tue, Jun 21, 2016 at 05:59:04PM +0100, Andrew Cooper wrote:
> Its contents is constant.
> 

Could you mention why you don't need the ALIGN(32).

Thanks.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

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

* Re: [PATCH v2 3/4] xen/init: Move initcall infrastructure into .init.data
  2016-06-21 17:19   ` Konrad Rzeszutek Wilk
@ 2016-06-21 17:25     ` Andrew Cooper
  0 siblings, 0 replies; 17+ messages in thread
From: Andrew Cooper @ 2016-06-21 17:25 UTC (permalink / raw)
  To: Konrad Rzeszutek Wilk
  Cc: Julien Grall, Stefano Stabellini, Jan Beulich, Xen-devel

On 21/06/16 18:19, Konrad Rzeszutek Wilk wrote:
> On Tue, Jun 21, 2016 at 05:59:04PM +0100, Andrew Cooper wrote:
>> Its contents is constant.
>>
> Could you mention why you don't need the ALIGN(32).

Because there is no content following it, before a larger alignment.

~Andrew

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

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

* Re: [PATCH v2 1/4] xen/init: Annotate all command line parameter infrastructure as const
  2016-06-21 16:59 [PATCH v2 1/4] xen/init: Annotate all command line parameter infrastructure as const Andrew Cooper
                   ` (2 preceding siblings ...)
  2016-06-21 16:59 ` [PATCH v2 4/4] x86/boot: copy/clear sections more efficiently Andrew Cooper
@ 2016-06-22  6:57 ` Jan Beulich
  2016-06-23 11:42 ` Julien Grall
  2016-06-23 16:00 ` Jan Beulich
  5 siblings, 0 replies; 17+ messages in thread
From: Jan Beulich @ 2016-06-22  6:57 UTC (permalink / raw)
  To: Andrew Cooper; +Cc: JulienGrall, Stefano Stabellini, Xen-devel

>>> On 21.06.16 at 18:59, <andrew.cooper3@citrix.com> wrote:
> There is no reason for any of it to be modified.  Additionally, link
> .init.setup beside the other constant .init data.
> 
> While editing this area, correct the types used in the extern
> declarations for __setup_start and __setup_end to match the types the
> linker actually produces.
> 
> No functional change.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Reviewed-by: Jan Beulich <jbeulich@suse.com>


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

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

* Re: [PATCH v2 3/4] xen/init: Move initcall infrastructure into .init.data
  2016-06-21 16:59 ` [PATCH v2 3/4] xen/init: Move initcall infrastructure " Andrew Cooper
  2016-06-21 17:19   ` Konrad Rzeszutek Wilk
@ 2016-06-22  7:00   ` Jan Beulich
  2016-06-23 10:12   ` [PATCH v3 " Andrew Cooper
  2 siblings, 0 replies; 17+ messages in thread
From: Jan Beulich @ 2016-06-22  7:00 UTC (permalink / raw)
  To: Andrew Cooper; +Cc: JulienGrall, Stefano Stabellini, Xen-devel

>>> On 21.06.16 at 18:59, <andrew.cooper3@citrix.com> wrote:
> Its contents is constant.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Non-ARM part:
Reviewed-by: Jan Beulich <jbeulich@suse.com>

> @@ -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 = .;

For this part, other than the x86 side, I think Konrad has a point: You
change the alignment guarantees for __init_end_efi. Likely that won't
matter, but verifying (and stating so) would still seem necessary /
desirable.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

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

* [PATCH v3 3/4] xen/init: Move initcall infrastructure into .init.data
  2016-06-21 16:59 ` [PATCH v2 3/4] xen/init: Move initcall infrastructure " Andrew Cooper
  2016-06-21 17:19   ` Konrad Rzeszutek Wilk
  2016-06-22  7:00   ` Jan Beulich
@ 2016-06-23 10:12   ` Andrew Cooper
  2016-06-23 11:46     ` Julien Grall
  2 siblings, 1 reply; 17+ messages in thread
From: Andrew Cooper @ 2016-06-23 10:12 UTC (permalink / raw)
  To: Xen-devel; +Cc: Andrew Cooper, Julien Grall, Stefano Stabellini, Jan Beulich

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(-)

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
 
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

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

* Re: [PATCH v2 1/4] xen/init: Annotate all command line parameter infrastructure as const
  2016-06-21 16:59 [PATCH v2 1/4] xen/init: Annotate all command line parameter infrastructure as const Andrew Cooper
                   ` (3 preceding siblings ...)
  2016-06-22  6:57 ` [PATCH v2 1/4] xen/init: Annotate all command line parameter infrastructure as const Jan Beulich
@ 2016-06-23 11:42 ` Julien Grall
  2016-06-23 16:00 ` Jan Beulich
  5 siblings, 0 replies; 17+ messages in thread
From: Julien Grall @ 2016-06-23 11:42 UTC (permalink / raw)
  To: Andrew Cooper, Xen-devel; +Cc: Stefano Stabellini, Jan Beulich

Hi Andrew,

On 21/06/16 17:59, Andrew Cooper wrote:
> There is no reason for any of it to be modified.  Additionally, link
> .init.setup beside the other constant .init data.
>
> While editing this area, correct the types used in the extern
> declarations for __setup_start and __setup_end to match the types the
> linker actually produces.
>
> No functional change.
>
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

For the ARM bits:

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

Regards,

-- 
Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

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

* Re: [PATCH v2 2/4] arm/init: Move .init.proc.info into .init.data
  2016-06-21 16:59 ` [PATCH v2 2/4] arm/init: Move .init.proc.info into .init.data Andrew Cooper
  2016-06-21 17:18   ` Konrad Rzeszutek Wilk
@ 2016-06-23 11:44   ` Julien Grall
  1 sibling, 0 replies; 17+ messages in thread
From: Julien Grall @ 2016-06-23 11:44 UTC (permalink / raw)
  To: Andrew Cooper, Xen-devel; +Cc: Stefano Stabellini

Hi Andrew,

On 21/06/16 17:59, Andrew Cooper wrote:
> Its contents is constant, and only requires pointer alignment, so move it
> adacent to .init.setup.
>
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

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

Regards,

-- 
Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

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

* Re: [PATCH v3 3/4] xen/init: Move initcall infrastructure into .init.data
  2016-06-23 10:12   ` [PATCH v3 " Andrew Cooper
@ 2016-06-23 11:46     ` Julien Grall
  0 siblings, 0 replies; 17+ messages in thread
From: Julien Grall @ 2016-06-23 11:46 UTC (permalink / raw)
  To: Andrew Cooper, Xen-devel; +Cc: Stefano Stabellini, Jan Beulich

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,

-- 
Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

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

* Re: [PATCH v2 1/4] xen/init: Annotate all command line parameter infrastructure as const
  2016-06-21 16:59 [PATCH v2 1/4] xen/init: Annotate all command line parameter infrastructure as const Andrew Cooper
                   ` (4 preceding siblings ...)
  2016-06-23 11:42 ` Julien Grall
@ 2016-06-23 16:00 ` Jan Beulich
  2016-06-23 16:08   ` Andrew Cooper
  5 siblings, 1 reply; 17+ messages in thread
From: Jan Beulich @ 2016-06-23 16:00 UTC (permalink / raw)
  To: Andrew Cooper; +Cc: JulienGrall, Stefano Stabellini, Xen-devel

>>> On 21.06.16 at 18:59, <andrew.cooper3@citrix.com> wrote:
> --- a/xen/include/xen/init.h
> +++ b/xen/include/xen/init.h
> @@ -86,10 +86,11 @@ struct kernel_param {
>      void *var;
>  };
>  
> -extern struct kernel_param __setup_start, __setup_end;
> +extern const struct kernel_param __setup_start[], __setup_end[];
>  
> -#define __setup_str static __initdata __attribute__((__aligned__(1))) char
> -#define __kparam static __initsetup \
> +#define __setup_str static const  __initconstrel \
> +    __attribute__((__aligned__(1))) char

This slipped my attention during review, but causes build failure
with some gcc versions now: Why __initconstrel rather than
__initconst?

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

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

* Re: [PATCH v2 1/4] xen/init: Annotate all command line parameter infrastructure as const
  2016-06-23 16:00 ` Jan Beulich
@ 2016-06-23 16:08   ` Andrew Cooper
  2016-06-24  9:29     ` [PATCH] init: fix build with older gcc Jan Beulich
  0 siblings, 1 reply; 17+ messages in thread
From: Andrew Cooper @ 2016-06-23 16:08 UTC (permalink / raw)
  To: Jan Beulich; +Cc: JulienGrall, Stefano Stabellini, Xen-devel

On 23/06/16 17:00, Jan Beulich wrote:
>>>> On 21.06.16 at 18:59, <andrew.cooper3@citrix.com> wrote:
>> --- a/xen/include/xen/init.h
>> +++ b/xen/include/xen/init.h
>> @@ -86,10 +86,11 @@ struct kernel_param {
>>      void *var;
>>  };
>>  
>> -extern struct kernel_param __setup_start, __setup_end;
>> +extern const struct kernel_param __setup_start[], __setup_end[];
>>  
>> -#define __setup_str static __initdata __attribute__((__aligned__(1))) char
>> -#define __kparam static __initsetup \
>> +#define __setup_str static const  __initconstrel \
>> +    __attribute__((__aligned__(1))) char
> This slipped my attention during review, but causes build failure
> with some gcc versions now: Why __initconstrel rather than
> __initconst?

Because this was previously __initconst and you reverted it for breaking
on older GCC.  Message ID <56CB470E02000078000D4DBA@prv-mh.provo.novell.com>

I can't replicate any build failures with any GCC or clang combination
to hand.  Are you able to find some solution which GCC is happy with?

~Andrew

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

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

* [PATCH] init: fix build with older gcc
  2016-06-23 16:08   ` Andrew Cooper
@ 2016-06-24  9:29     ` Jan Beulich
  2016-06-24  9:32       ` Andrew Cooper
  0 siblings, 1 reply; 17+ messages in thread
From: Jan Beulich @ 2016-06-24  9:29 UTC (permalink / raw)
  To: xen-devel
  Cc: Stefano Stabellini, Wei Liu, George Dunlap, Andrew Cooper,
	Ian Jackson, Tim Deegan

[-- Attachment #1: Type: text/plain, Size: 926 bytes --]

__setup_str is used on arrays of char, so there aren't any relocatable
items. Hence __initconst has to be used here, not __initconstrel.

Whatever led to the revert of commit 59b151d2c0 (the original version
of a6066af5b1 "xen/init: Annotate all command line parameter
infrastructure as const" must have got addressed meanwhile - with the
patch here I can't see that old gcc (4.3ish) report a section type
conflict anymore.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/include/xen/init.h
+++ b/xen/include/xen/init.h
@@ -88,7 +88,7 @@ struct kernel_param {
 
 extern const struct kernel_param __setup_start[], __setup_end[];
 
-#define __setup_str static const  __initconstrel \
+#define __setup_str static const __initconst \
     __attribute__((__aligned__(1))) char
 #define __kparam static const __initsetup \
     __attribute__((__aligned__(sizeof(void *)))) struct kernel_param




[-- Attachment #2: const-cmdline-infra-fix.patch --]
[-- Type: text/plain, Size: 954 bytes --]

init: fix build with older gcc

__setup_str is used on arrays of char, so there aren't any relocatable
items. Hence __initconst has to be used here, not __initconstrel.

Whatever led to the revert of commit 59b151d2c0 (the original version
of a6066af5b1 "xen/init: Annotate all command line parameter
infrastructure as const" must have got addressed meanwhile - with the
patch here I can't see that old gcc (4.3ish) report a section type
conflict anymore.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/include/xen/init.h
+++ b/xen/include/xen/init.h
@@ -88,7 +88,7 @@ struct kernel_param {
 
 extern const struct kernel_param __setup_start[], __setup_end[];
 
-#define __setup_str static const  __initconstrel \
+#define __setup_str static const __initconst \
     __attribute__((__aligned__(1))) char
 #define __kparam static const __initsetup \
     __attribute__((__aligned__(sizeof(void *)))) struct kernel_param

[-- Attachment #3: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

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

* Re: [PATCH] init: fix build with older gcc
  2016-06-24  9:29     ` [PATCH] init: fix build with older gcc Jan Beulich
@ 2016-06-24  9:32       ` Andrew Cooper
  0 siblings, 0 replies; 17+ messages in thread
From: Andrew Cooper @ 2016-06-24  9:32 UTC (permalink / raw)
  To: Jan Beulich, xen-devel
  Cc: Stefano Stabellini, Wei Liu, George Dunlap, Tim Deegan, Ian Jackson

On 24/06/16 10:29, Jan Beulich wrote:
> __setup_str is used on arrays of char, so there aren't any relocatable
> items. Hence __initconst has to be used here, not __initconstrel.
>
> Whatever led to the revert of commit 59b151d2c0 (the original version
> of a6066af5b1 "xen/init: Annotate all command line parameter
> infrastructure as const" must have got addressed meanwhile - with the
> patch here I can't see that old gcc (4.3ish) report a section type
> conflict anymore.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>

>
> --- a/xen/include/xen/init.h
> +++ b/xen/include/xen/init.h
> @@ -88,7 +88,7 @@ struct kernel_param {
>  
>  extern const struct kernel_param __setup_start[], __setup_end[];
>  
> -#define __setup_str static const  __initconstrel \
> +#define __setup_str static const __initconst \
>      __attribute__((__aligned__(1))) char
>  #define __kparam static const __initsetup \
>      __attribute__((__aligned__(sizeof(void *)))) struct kernel_param
>
>
>


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

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

end of thread, other threads:[~2016-06-24  9:33 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-21 16:59 [PATCH v2 1/4] xen/init: Annotate all command line parameter infrastructure as const Andrew Cooper
2016-06-21 16:59 ` [PATCH v2 2/4] arm/init: Move .init.proc.info into .init.data Andrew Cooper
2016-06-21 17:18   ` Konrad Rzeszutek Wilk
2016-06-23 11:44   ` Julien Grall
2016-06-21 16:59 ` [PATCH v2 3/4] xen/init: Move initcall infrastructure " Andrew Cooper
2016-06-21 17:19   ` Konrad Rzeszutek Wilk
2016-06-21 17:25     ` Andrew Cooper
2016-06-22  7:00   ` Jan Beulich
2016-06-23 10:12   ` [PATCH v3 " Andrew Cooper
2016-06-23 11:46     ` Julien Grall
2016-06-21 16:59 ` [PATCH v2 4/4] x86/boot: copy/clear sections more efficiently Andrew Cooper
2016-06-22  6:57 ` [PATCH v2 1/4] xen/init: Annotate all command line parameter infrastructure as const Jan Beulich
2016-06-23 11:42 ` Julien Grall
2016-06-23 16:00 ` Jan Beulich
2016-06-23 16:08   ` Andrew Cooper
2016-06-24  9:29     ` [PATCH] init: fix build with older gcc Jan Beulich
2016-06-24  9:32       ` Andrew Cooper

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).