linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mark Rutland <mark.rutland@arm.com>
To: Anshuman Khandual <anshuman.khandual@arm.com>
Cc: linux-arm-kernel@lists.infradead.org,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>, Mark Brown <broonie@kernel.org>,
	Suzuki Poulose <suzuki.poulose@arm.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] arm64/cpuinfo: Drop boot_cpu_data
Date: Mon, 4 May 2020 13:43:21 +0100	[thread overview]
Message-ID: <20200504124321.GA73375@C02TD0UTHF1T.local> (raw)
In-Reply-To: <1588595400-4560-1-git-send-email-anshuman.khandual@arm.com>

On Mon, May 04, 2020 at 06:00:00PM +0530, Anshuman Khandual wrote:
> A global boot_cpu_data is not really required. Lets drop this.

I don't think it's true that this isn't required today.

One reason that we have both boot_cpu_data and a cpu_data variable for
CPU0 is that CPU0 itself can be hotplugged out then back in, and this
allows us to detect if CPU0's features have changed (e.g. due to FW
failing to configure it appropriately, or real physical hotplug
occurring).

So NAK to the patch as it stands. If we're certain we capture all of
those details even without boot_cpu_data, then we should make other
changes to make that clear (e.g. removing it as an argument to
update_cpu_features()).

Thanks,
Mark.

> While here, rename the local variable as boot_cpu_info when it is
> fetched for the boot cpu.
> 
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Will Deacon <will@kernel.org>
> Cc: Mark Brown <broonie@kernel.org>
> Cc: Mark Rutland <mark.rutland@arm.com>
> Cc: Suzuki Poulose <suzuki.poulose@arm.com>
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: linux-kernel@vger.kernel.org
> 
> Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
> ---
> Based on 5.7-rc4
> 
>  arch/arm64/kernel/cpuinfo.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/arch/arm64/kernel/cpuinfo.c b/arch/arm64/kernel/cpuinfo.c
> index a515d8f3639e..dabcdc132e56 100644
> --- a/arch/arm64/kernel/cpuinfo.c
> +++ b/arch/arm64/kernel/cpuinfo.c
> @@ -31,7 +31,6 @@
>   * values depending on configuration at or after reset.
>   */
>  DEFINE_PER_CPU(struct cpuinfo_arm64, cpu_data);
> -static struct cpuinfo_arm64 boot_cpu_data;
>  
>  static const char *icache_policy_str[] = {
>  	[0 ... ICACHE_POLICY_PIPT]	= "RESERVED/UNKNOWN",
> @@ -393,15 +392,16 @@ static void __cpuinfo_store_cpu(struct cpuinfo_arm64 *info)
>  void cpuinfo_store_cpu(void)
>  {
>  	struct cpuinfo_arm64 *info = this_cpu_ptr(&cpu_data);
> +	struct cpuinfo_arm64 *boot_cpu_info = &per_cpu(cpu_data, 0);
> +
>  	__cpuinfo_store_cpu(info);
> -	update_cpu_features(smp_processor_id(), info, &boot_cpu_data);
> +	update_cpu_features(smp_processor_id(), info, boot_cpu_info);
>  }
>  
>  void __init cpuinfo_store_boot_cpu(void)
>  {
> -	struct cpuinfo_arm64 *info = &per_cpu(cpu_data, 0);
> -	__cpuinfo_store_cpu(info);
> +	struct cpuinfo_arm64 *boot_cpu_info = &per_cpu(cpu_data, 0);
>  
> -	boot_cpu_data = *info;
> -	init_cpu_features(&boot_cpu_data);
> +	__cpuinfo_store_cpu(boot_cpu_info);
> +	init_cpu_features(boot_cpu_info);
>  }
> -- 
> 2.20.1
> 

  reply	other threads:[~2020-05-04 12:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-04 12:30 [PATCH] arm64/cpuinfo: Drop boot_cpu_data Anshuman Khandual
2020-05-04 12:43 ` Mark Rutland [this message]
2020-05-04 14:53   ` Anshuman Khandual
2020-05-04 15:50     ` Mark Rutland

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=20200504124321.GA73375@C02TD0UTHF1T.local \
    --to=mark.rutland@arm.com \
    --cc=anshuman.khandual@arm.com \
    --cc=broonie@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=suzuki.poulose@arm.com \
    --cc=will@kernel.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;
as well as URLs for NNTP newsgroup(s).