Re: [GIT PULL] x86/cpu for v5.17

From: Linus Torvalds
Date: Mon Jan 10 2022 - 14:32:48 EST


On Mon, Jan 10, 2022 at 10:35 AM Borislav Petkov <bp@xxxxxxx> wrote:
>
> Right, the only point for doing the vendor check I see here is, well,
> because it is Intel who doesn't have CSTAR, let's check for Intel. But
> yeah, we do avoid the vendor checks if it can be helped.
>
> We can do a synthetic X86_FEATURE flag but that would be a waste. So the
> _safe thing and keep the comment sounds optimal to me.

I agree that a new feature flag for just this would seem a bit
wasteful, and just using wrmsrl_safe() would seem to be the natural
thing to do.

Particularly since that's literally what the wrmsrl's around that
thing do (ie MSR_IA32_SYSENTER_CS and friends). So that vendor check
really stands out as being the odd man out.

Linus