Re: [PATCH v5 02/16] x86/bugs: Restructure TAA mitigation

Borislav Petkov
2025-04-19T12:37:24Z

On Fri, Apr 18, 2025 at 11:17:07AM -0500, David Kaplan wrote:
> @@ -394,6 +399,11 @@ static const char * const taa_strings[] = {
> [TAA_MITIGATION_TSX_DISABLED] = "Mitigation: TSX disabled",
> };
>
> +static bool __init taa_vulnerable(void)
> +{
> + return boot_cpu_has_bug(X86_BUG_TAA) && boot_cpu_has(X86_FEATURE_RTM);
> +}
> +
> static void __init taa_select_mitigation(void)
> {
> if (!boot_cpu_has_bug(X86_BUG_TAA)) {

Shouldn't you use !taa_vulnerable() here directly too, since we're introducing
it as a helper?

--
Regards/Gruss,
Boris.