Re: [PATCH 1/2] x86/bugs: Use cpu_smt_possible helper

From: Pawan Gupta
Date: Mon Oct 28 2024 - 10:07:13 EST


On Tue, Oct 15, 2024 at 03:51:05AM -0700, Breno Leitao wrote:
> There is a helper function to check if SMT is available. Use this helper
> instead of performing the check manually.
>
> The helper function cpu_smt_possible() does exactly the same thing as
> was being done manually inside spectre_v2_user_select_mitigation().
> Specifically, it returns false if CONFIG_SMP is disabled, otherwise
> it checks the cpu_smt_control global variable.
>
> This change improves code consistency and reduces duplication.
>
> Signed-off-by: Breno Leitao <leitao@xxxxxxxxxx>

Reviewed-by: Pawan Gupta <pawan.kumar.gupta@xxxxxxxxxxxxxxx>