public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: mark.rutland@arm.com (Mark Rutland)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] arm64: Fix incorrect per-cpu usage for boot CPU
Date: Thu, 21 Jul 2016 11:33:07 +0100	[thread overview]
Message-ID: <20160721103307.GC20559@leverpostej> (raw)
In-Reply-To: <1469095975-976-1-git-send-email-suzuki.poulose@arm.com>

On Thu, Jul 21, 2016 at 11:12:55AM +0100, Suzuki K Poulose wrote:
> In smp_prepare_boot_cpu(), we invoke cpuinfo_store_boot_cpu to  store
> the cpuinfo in a per-cpu ptr, before initialising the per-cpu offset for
> the boot CPU. This patch reorders the sequence to make sure we initialise
> the per-cpu offset before accessing the per-cpu area.
> 
> Commit 4b998ff1885eec ("arm64: Delay cpuinfo_store_boot_cpu") fixed the
> issue where we modified the per-cpu area even before the kernel initialises
> the per-cpu areas, but failed to wait until the boot cpu updated it's
> offset.
> 
> Fixes: commit 4b998ff1885eec ("arm64: Delay cpuinfo_store_boot_cpu")
> Cc: <stable@vger.kernel.org>
> Cc: Will Deacon <will.deacon@arm.com>
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>

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

Mark.

> ---
>  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 62ff3c0..d242e81 100644
> --- a/arch/arm64/kernel/smp.c
> +++ b/arch/arm64/kernel/smp.c
> @@ -437,9 +437,9 @@ void __init smp_cpus_done(unsigned int max_cpus)
>  
>  void __init smp_prepare_boot_cpu(void)
>  {
> +	set_my_cpu_offset(per_cpu_offset(smp_processor_id()));
>  	cpuinfo_store_boot_cpu();
>  	save_boot_cpu_run_el();
> -	set_my_cpu_offset(per_cpu_offset(smp_processor_id()));
>  }
>  
>  static u64 __init of_get_cpu_mpidr(struct device_node *dn)
> -- 
> 2.7.4
> 

  reply	other threads:[~2016-07-21 10:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-21 10:12 [PATCH] arm64: Fix incorrect per-cpu usage for boot CPU Suzuki K Poulose
2016-07-21 10:33 ` Mark Rutland [this message]
2016-07-21 15:02 ` Catalin Marinas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160721103307.GC20559@leverpostej \
    --to=mark.rutland@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox