ACK: [PATCH][SRU Bionic] UBUNTU: SAUCE: arm64: capabilities: Move setup_boot_cpu_capabilities() call to correct place

Stefan Bader stefan.bader at canonical.com
Tue Nov 26 09:09:23 UTC 2019


On 26.11.19 01:30, dann frazier wrote:
> BugLink: https://bugs.launchpad.net/bugs/1852723
> 
> In order to diagnose this issue, I prepared my own "clean-room" backport
> of the encompassing patch series. My backport didn't have this bug, and
> a git diff between mine and Ubuntu's showed one obvious difference:
> in my working backport, the call to setup_boot_cpu_capabilities() was in
> init_cpu_features(), while Ubuntu had it in update_cpu_ftr_reg(). Looking
> through the history, it appears that the introduction of this issue went
> back to an earlier patch that had added a call to
> update_cpu_errata_workarounds() in update_cpu_ftr_reg() instead of
> init_cpu_features(). The code at this site continued to evolve, eventually
> replacing the update_cpu_errata_workarounds() with the one to
> setup_boot_cpu_capabilities(), but did so in the wrong function. I verified
> that moving this call matches both mainline and stable 4.14.y.
> 
> Verified to fix booting on ThunderX2 and Kunpeng920 systems.
> 
> Fixes: 2cd18ebbeda69 ("arm64: capabilities: Move errata work around check on boot CPU")
> Signed-off-by: dann frazier <dann.frazier at canonical.com>
Acked-by: Stefan Bader <stefan.bader at canonical.com>
> ---
>  arch/arm64/kernel/cpufeature.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c
> index d19a7b8bb6fb0..b96d1a635a16a 100644
> --- a/arch/arm64/kernel/cpufeature.c
> +++ b/arch/arm64/kernel/cpufeature.c
> @@ -572,6 +572,12 @@ void __init init_cpu_features(struct cpuinfo_arm64 *info)
>  		init_cpu_ftr_reg(SYS_ZCR_EL1, info->reg_zcr);
>  		sve_init_vq_map();
>  	}
> +
> +	/*
> +	 * Detect and enable early CPU capabilities based on the boot CPU,
> +	 * after we have initialised the CPU feature infrastructure.
> +	 */
> +	setup_boot_cpu_capabilities();
>  }
>  
>  static void update_cpu_ftr_reg(struct arm64_ftr_reg *reg, u64 new)
> @@ -588,12 +594,6 @@ static void update_cpu_ftr_reg(struct arm64_ftr_reg *reg, u64 new)
>  		ftr_new = arm64_ftr_safe_value(ftrp, ftr_new, ftr_cur);
>  		reg->sys_val = arm64_ftr_set_value(ftrp, reg->sys_val, ftr_new);
>  	}
> -
> -	/*
> -	 * Detect and enable early CPU capabilities based on the boot CPU,
> -	 * after we have initialised the CPU feature infrastructure.
> -	 */
> -	setup_boot_cpu_capabilities();
>  }
>  
>  static int check_update_ftr_reg(u32 sys_id, int cpu, u64 val, u64 boot)
> 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.ubuntu.com/archives/kernel-team/attachments/20191126/b30fac15/attachment-0001.sig>


More information about the kernel-team mailing list