linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arm64: make secondary_start_kernel() notrace
@ 2018-06-12  9:07 Zhizhou Zhang
  2018-06-12  9:14 ` Mark Rutland
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Zhizhou Zhang @ 2018-06-12  9:07 UTC (permalink / raw)
  To: catalin.marinas, will.deacon, james.morse, mark.rutland,
	julien.thierry, suzuki.poulose, hoeun.ryu, ard.biesheuvel
  Cc: linux-kernel, linux-arm-kernel, zhizhouzhang

We can't call function trace hook before setup percpu offset.
When entering secondary_start_kernel(), percpu offset has not
been initialized.  So this lead hotplug malfunction.
Here is the flow to reproduce this bug:

echo 0 > /sys/devices/system/cpu/cpu1/online
echo function > /sys/kernel/debug/tracing/current_tracer
echo 1 > /sys/kernel/debug/tracing/tracing_on
echo 1 > /sys/devices/system/cpu/cpu1/online

Signed-off-by: Zhizhou Zhang <zhizhouzhang@asrmicro.com>
---
 arch/arm64/kernel/smp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c
index f3e2e3ae..11b0f30 100644
--- a/arch/arm64/kernel/smp.c
+++ b/arch/arm64/kernel/smp.c
@@ -179,7 +179,7 @@ int __cpu_up(unsigned int cpu, struct task_struct *idle)
  * This is the secondary CPU boot entry.  We're using this CPUs
  * idle thread stack, but a set of temporary page tables.
  */
-asmlinkage void secondary_start_kernel(void)
+notrace asmlinkage void secondary_start_kernel(void)
 {
 	u64 mpidr = read_cpuid_mpidr() & MPIDR_HWID_BITMASK;
 	struct mm_struct *mm = &init_mm;
-- 
1.9.1


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

* Re: [PATCH] arm64: make secondary_start_kernel() notrace
  2018-06-12  9:07 [PATCH] arm64: make secondary_start_kernel() notrace Zhizhou Zhang
@ 2018-06-12  9:14 ` Mark Rutland
  2018-06-12  9:27 ` Suzuki K Poulose
  2018-06-18 17:12 ` Catalin Marinas
  2 siblings, 0 replies; 4+ messages in thread
From: Mark Rutland @ 2018-06-12  9:14 UTC (permalink / raw)
  To: Zhizhou Zhang
  Cc: catalin.marinas, will.deacon, james.morse, julien.thierry,
	suzuki.poulose, hoeun.ryu, ard.biesheuvel, linux-kernel,
	linux-arm-kernel

On Tue, Jun 12, 2018 at 05:07:37PM +0800, Zhizhou Zhang wrote:
> We can't call function trace hook before setup percpu offset.
> When entering secondary_start_kernel(), percpu offset has not
> been initialized.  So this lead hotplug malfunction.
> Here is the flow to reproduce this bug:
> 
> echo 0 > /sys/devices/system/cpu/cpu1/online
> echo function > /sys/kernel/debug/tracing/current_tracer
> echo 1 > /sys/kernel/debug/tracing/tracing_on
> echo 1 > /sys/devices/system/cpu/cpu1/online
> 
> Signed-off-by: Zhizhou Zhang <zhizhouzhang@asrmicro.com>
> ---
>  arch/arm64/kernel/smp.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c
> index f3e2e3ae..11b0f30 100644
> --- a/arch/arm64/kernel/smp.c
> +++ b/arch/arm64/kernel/smp.c
> @@ -179,7 +179,7 @@ int __cpu_up(unsigned int cpu, struct task_struct *idle)
>   * This is the secondary CPU boot entry.  We're using this CPUs
>   * idle thread stack, but a set of temporary page tables.
>   */
> -asmlinkage void secondary_start_kernel(void)
> +notrace asmlinkage void secondary_start_kernel(void)

Minor nit: can we please keep asmlinkage first, e.g.

asmlinkage notrace void secondary_start_kernel(void)

Either way:

Acked-by: Mark Rutland <mark.rutland@arm.com>

Thanks,
Mark.

>  {
>  	u64 mpidr = read_cpuid_mpidr() & MPIDR_HWID_BITMASK;
>  	struct mm_struct *mm = &init_mm;
> -- 
> 1.9.1
> 

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

* Re: [PATCH] arm64: make secondary_start_kernel() notrace
  2018-06-12  9:07 [PATCH] arm64: make secondary_start_kernel() notrace Zhizhou Zhang
  2018-06-12  9:14 ` Mark Rutland
@ 2018-06-12  9:27 ` Suzuki K Poulose
  2018-06-18 17:12 ` Catalin Marinas
  2 siblings, 0 replies; 4+ messages in thread
From: Suzuki K Poulose @ 2018-06-12  9:27 UTC (permalink / raw)
  To: Zhizhou Zhang, catalin.marinas, will.deacon, james.morse,
	mark.rutland, julien.thierry, hoeun.ryu, ard.biesheuvel
  Cc: linux-kernel, linux-arm-kernel

On 12/06/18 10:07, Zhizhou Zhang wrote:
> We can't call function trace hook before setup percpu offset.
> When entering secondary_start_kernel(), percpu offset has not
> been initialized.  So this lead hotplug malfunction.
> Here is the flow to reproduce this bug:
> 
> echo 0 > /sys/devices/system/cpu/cpu1/online
> echo function > /sys/kernel/debug/tracing/current_tracer
> echo 1 > /sys/kernel/debug/tracing/tracing_on
> echo 1 > /sys/devices/system/cpu/cpu1/online
> 
> Signed-off-by: Zhizhou Zhang <zhizhouzhang@asrmicro.com>
> ---
>   arch/arm64/kernel/smp.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c
> index f3e2e3ae..11b0f30 100644
> --- a/arch/arm64/kernel/smp.c
> +++ b/arch/arm64/kernel/smp.c
> @@ -179,7 +179,7 @@ int __cpu_up(unsigned int cpu, struct task_struct *idle)
>    * This is the secondary CPU boot entry.  We're using this CPUs
>    * idle thread stack, but a set of temporary page tables.
>    */
> -asmlinkage void secondary_start_kernel(void)
> +notrace asmlinkage void secondary_start_kernel(void)
>   {
>   	u64 mpidr = read_cpuid_mpidr() & MPIDR_HWID_BITMASK;
>   	struct mm_struct *mm = &init_mm;
> 

Tested-by: Suzuki K Poulose <suzuki.poulose@arm.com>

I think this should go to stable releases as well.

Suzuki

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

* Re: [PATCH] arm64: make secondary_start_kernel() notrace
  2018-06-12  9:07 [PATCH] arm64: make secondary_start_kernel() notrace Zhizhou Zhang
  2018-06-12  9:14 ` Mark Rutland
  2018-06-12  9:27 ` Suzuki K Poulose
@ 2018-06-18 17:12 ` Catalin Marinas
  2 siblings, 0 replies; 4+ messages in thread
From: Catalin Marinas @ 2018-06-18 17:12 UTC (permalink / raw)
  To: Zhizhou Zhang
  Cc: will.deacon, james.morse, mark.rutland, julien.thierry,
	suzuki.poulose, hoeun.ryu, ard.biesheuvel, linux-kernel,
	linux-arm-kernel

On Tue, Jun 12, 2018 at 05:07:37PM +0800, Zhizhou Zhang wrote:
> We can't call function trace hook before setup percpu offset.
> When entering secondary_start_kernel(), percpu offset has not
> been initialized.  So this lead hotplug malfunction.
> Here is the flow to reproduce this bug:
> 
> echo 0 > /sys/devices/system/cpu/cpu1/online
> echo function > /sys/kernel/debug/tracing/current_tracer
> echo 1 > /sys/kernel/debug/tracing/tracing_on
> echo 1 > /sys/devices/system/cpu/cpu1/online
> 
> Signed-off-by: Zhizhou Zhang <zhizhouzhang@asrmicro.com>

Queued for 4.18. Thanks.

-- 
Catalin

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

end of thread, other threads:[~2018-06-18 17:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-12  9:07 [PATCH] arm64: make secondary_start_kernel() notrace Zhizhou Zhang
2018-06-12  9:14 ` Mark Rutland
2018-06-12  9:27 ` Suzuki K Poulose
2018-06-18 17:12 ` Catalin Marinas

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