Re: [PATCH v2] x86/speculation/srbds: do not try to turn mitigation off when not supported

Ricardo Cañuelo
2022-03-31T07:48:23Z

Borislav Petkov <bp@alien8.de> writes:
> So we could also do the below to denote what the situation is and
> therefore clear the bug flag for such CPUs.
>
> The thing is: I want this to be as clear as possible because bugs.c is
> already a nightmare and just slapping more logic to it without properly
> thinking it through is going to be a serious pain to deal with later...

Thanks Boris,

I agree that the more explicit the better, I'll give this a try. I saw
Pawan's suggestion as well but that one is similar to the originally
proposed patch in that the logic/checks are split between two functions,
this solution based on clearing the bug flag seems clearer considering
the comment just before the code block:

/*
* Check to see if this is one of the MDS_NO systems supporting
* TSX that are only exposed to SRBDS when TSX is enabled.
*/

Cheers,
Ricardo