Re: [PATCH v3 1/1] x86/split_lock: check split lock support on initialization

From: Thomas Gleixner
Date: Mon Apr 06 2020 - 17:25:04 EST


Benjamin Lamowski <benjamin.lamowski@xxxxxxxxxxxxxxx> writes:

> While the sld setup code is run only if the TEST_CTRL MSR is available,
> the current sld initialization code unconditionally resets it even on
> systems where this architectural MSR is not available.
>
> This commit introduces a new default sld state sld_unsupported, which is
> changed in split_lock_setup() only if sld is available; and checks for
> split lock detect support before initializing it.

What for? You explain what the patch is doing, but not WHY. See
Documentation/process and while at it please search for 'This patch' as
well.

> Fixes: dbaba47085b0c ("x86/split_lock: Rework the initialization flow
> of split lock detection")

That's blantantly wrong. It fixes your hypervisor which fails to raise a
#GP when an unknown MSR is accessed.

Are we going to see that kind of 'fixes' everytime we decide to probe an
MSR for simplicity from now on?

Please fix the root cause and not the symptom.

Thanks,

tglx