Messages in this thread |  | | From | Thomas Gleixner <> | Subject | Re: [PATCH v17] x86/split_lock: Enable split lock detection by kernel | Date | Wed, 29 Jan 2020 13:31:24 +0100 |
| |
"Luck, Tony" <tony.luck@intel.com> writes: > +static bool __sld_msr_set(bool on) > +{ > + u64 test_ctrl_val; > + > + if (rdmsrl_safe(MSR_TEST_CTRL, &test_ctrl_val)) > + return false; > + > + if (on) > + test_ctrl_val |= MSR_TEST_CTRL_SPLIT_LOCK_DETECT; > + else > + test_ctrl_val &= ~MSR_TEST_CTRL_SPLIT_LOCK_DETECT; > + > + return !wrmsrl_safe(MSR_TEST_CTRL, test_ctrl_val); > +} > + > +static void split_lock_init(void) > +{ > + if (sld_state == sld_off) > + return; > + > + if (__sld_msr_set(true)) > + return; > + > + /* > + * If this is anything other than the boot-cpu, you've done > + * funny things and you get to keep whatever pieces. > + */ > + pr_warn("MSR fail -- disabled\n"); > + __sld_msr_set(sld_off);
This one is pretty pointless. If the rdmsrl or the wrmsrl failed, then the next attempt is going to fail too. Aside of that sld_off would be not really the right argument value here. I just zap that line.
Thanks,
tglx
|  |