[PATCH v2 7/8] arm64: alternatives: add alternative_has_feature_*()

Catalin Marinas catalin.marinas at arm.com
Fri Sep 16 04:13:20 PDT 2022


On Mon, Sep 12, 2022 at 05:22:09PM +0100, Mark Rutland wrote:
> @@ -465,7 +464,7 @@ static __always_inline bool __cpus_have_const_cap(int num)
>  {
>  	if (num >= ARM64_NCAPS)
>  		return false;
> -	return static_branch_unlikely(&cpu_hwcap_keys[num]);
> +	return alternative_has_feature_unlikely(num);
>  }

I wonder whether we should move this to "likely" (as a subsequent
patch). It would save a branch as new CPUs turn up supporting the new
features. We may want to keep errata workarounds as "unlikely" though as
they tend not to stick around in future CPUs.

-- 
Catalin



More information about the linux-arm-kernel mailing list