diff mbox

[1/4] arm: acpi/boot.c is only used during initialisation

Message ID 1472558492-22273-2-git-send-email-wei.liu2@citrix.com (mailing list archive)
State New, archived
Headers show

Commit Message

Wei Liu Aug. 30, 2016, 12:01 p.m. UTC
That file should contain code and data used during initialisation only.

Mark it as such in build system and correctly annotate enabled_cpus.
This is required to enable gcov support on ARM.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
---
Cc: Stefano Stabellini <sstabellini@kernel.org>
Cc: Julien Grall <julien.grall@arm.com>
---
 xen/arch/arm/acpi/Makefile | 2 +-
 xen/arch/arm/acpi/boot.c   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Comments

Julien Grall Aug. 31, 2016, 1:25 p.m. UTC | #1
Hi Wei,

On 30/08/16 13:01, Wei Liu wrote:
> That file should contain code and data used during initialisation only.
>
> Mark it as such in build system and correctly annotate enabled_cpus.
> This is required to enable gcov support on ARM.

I am not sure to understand the requirement here. Does it mean it is not 
possible to have a mix of init code and runtime code?

>
> Signed-off-by: Wei Liu <wei.liu2@citrix.com>

Regardless the questions:

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

> ---
> Cc: Stefano Stabellini <sstabellini@kernel.org>
> Cc: Julien Grall <julien.grall@arm.com>
> ---
>  xen/arch/arm/acpi/Makefile | 2 +-
>  xen/arch/arm/acpi/boot.c   | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/xen/arch/arm/acpi/Makefile b/xen/arch/arm/acpi/Makefile
> index 196c40a..23963f8 100644
> --- a/xen/arch/arm/acpi/Makefile
> +++ b/xen/arch/arm/acpi/Makefile
> @@ -1,2 +1,2 @@
>  obj-y += lib.o
> -obj-y += boot.o
> +obj-y += boot.init.o
> diff --git a/xen/arch/arm/acpi/boot.c b/xen/arch/arm/acpi/boot.c
> index 28b3450..c3242a0 100644
> --- a/xen/arch/arm/acpi/boot.c
> +++ b/xen/arch/arm/acpi/boot.c
> @@ -37,7 +37,7 @@
>  #include <asm/setup.h>
>
>  /* Processors with enabled flag and sane MPIDR */
> -static unsigned int enabled_cpus = 1;
> +static unsigned int __initdata enabled_cpus = 1;
>  static bool __initdata bootcpu_valid;
>
>  /* total number of cpus in this system */
>

Regards,
Wei Liu Aug. 31, 2016, 1:45 p.m. UTC | #2
On Wed, Aug 31, 2016 at 02:25:59PM +0100, Julien Grall wrote:
> Hi Wei,
> 
> On 30/08/16 13:01, Wei Liu wrote:
> >That file should contain code and data used during initialisation only.
> >
> >Mark it as such in build system and correctly annotate enabled_cpus.
> >This is required to enable gcov support on ARM.
> 
> I am not sure to understand the requirement here. Does it mean it is not
> possible to have a mix of init code and runtime code?
> 

No. That's still allowed.

"This is required to enable gcov support on ARM" is remnant that should
be deleted, because strictly speaking if we don't change boot.o to
boot.init.o, the resulting binary should still work.

Please consider this patch a general cleanup.

Can I keep your RoB?

> >
> >Signed-off-by: Wei Liu <wei.liu2@citrix.com>
> 
> Regardless the questions:
> 
> Reviewed-by: Julien Grall <julien.grall@arm.com>
> 
> >---
> >Cc: Stefano Stabellini <sstabellini@kernel.org>
> >Cc: Julien Grall <julien.grall@arm.com>
> >---
> > xen/arch/arm/acpi/Makefile | 2 +-
> > xen/arch/arm/acpi/boot.c   | 2 +-
> > 2 files changed, 2 insertions(+), 2 deletions(-)
> >
> >diff --git a/xen/arch/arm/acpi/Makefile b/xen/arch/arm/acpi/Makefile
> >index 196c40a..23963f8 100644
> >--- a/xen/arch/arm/acpi/Makefile
> >+++ b/xen/arch/arm/acpi/Makefile
> >@@ -1,2 +1,2 @@
> > obj-y += lib.o
> >-obj-y += boot.o
> >+obj-y += boot.init.o
> >diff --git a/xen/arch/arm/acpi/boot.c b/xen/arch/arm/acpi/boot.c
> >index 28b3450..c3242a0 100644
> >--- a/xen/arch/arm/acpi/boot.c
> >+++ b/xen/arch/arm/acpi/boot.c
> >@@ -37,7 +37,7 @@
> > #include <asm/setup.h>
> >
> > /* Processors with enabled flag and sane MPIDR */
> >-static unsigned int enabled_cpus = 1;
> >+static unsigned int __initdata enabled_cpus = 1;
> > static bool __initdata bootcpu_valid;
> >
> > /* total number of cpus in this system */
> >
> 
> Regards,
> 
> -- 
> Julien Grall
Julien Grall Aug. 31, 2016, 1:54 p.m. UTC | #3
On 31/08/16 14:45, Wei Liu wrote:
> On Wed, Aug 31, 2016 at 02:25:59PM +0100, Julien Grall wrote:
>> Hi Wei,
>>
>> On 30/08/16 13:01, Wei Liu wrote:
>>> That file should contain code and data used during initialisation only.
>>>
>>> Mark it as such in build system and correctly annotate enabled_cpus.
>>> This is required to enable gcov support on ARM.
>>
>> I am not sure to understand the requirement here. Does it mean it is not
>> possible to have a mix of init code and runtime code?
>>
>
> No. That's still allowed.
>
> "This is required to enable gcov support on ARM" is remnant that should
> be deleted, because strictly speaking if we don't change boot.o to
> boot.init.o, the resulting binary should still work.
>
> Please consider this patch a general cleanup.

I had a similar clean up in my todo list :).

> Can I keep your RoB?

Sure.

Regards,
diff mbox

Patch

diff --git a/xen/arch/arm/acpi/Makefile b/xen/arch/arm/acpi/Makefile
index 196c40a..23963f8 100644
--- a/xen/arch/arm/acpi/Makefile
+++ b/xen/arch/arm/acpi/Makefile
@@ -1,2 +1,2 @@ 
 obj-y += lib.o
-obj-y += boot.o
+obj-y += boot.init.o
diff --git a/xen/arch/arm/acpi/boot.c b/xen/arch/arm/acpi/boot.c
index 28b3450..c3242a0 100644
--- a/xen/arch/arm/acpi/boot.c
+++ b/xen/arch/arm/acpi/boot.c
@@ -37,7 +37,7 @@ 
 #include <asm/setup.h>
 
 /* Processors with enabled flag and sane MPIDR */
-static unsigned int enabled_cpus = 1;
+static unsigned int __initdata enabled_cpus = 1;
 static bool __initdata bootcpu_valid;
 
 /* total number of cpus in this system */