]> git.baikalelectronics.ru Git - kernel.git/commit
x86/mce: Fix logic and comments around MSR_PPIN_CTL
authorTony Luck <tony.luck@intel.com>
Wed, 26 Feb 2020 01:17:37 +0000 (17:17 -0800)
committerBorislav Petkov <bp@suse.de>
Thu, 27 Feb 2020 20:36:42 +0000 (21:36 +0100)
commit2d99ffa03c2c0bc726043f3edf4c2e1bb08c0d9e
tree02283d1e1e745817bfae0b1226e2047997793a11
parentb524fc9c872b4c2da332ef3f2b0b8ef774c25560
x86/mce: Fix logic and comments around MSR_PPIN_CTL

There are two implemented bits in the PPIN_CTL MSR:

Bit 0: LockOut (R/WO)
      Set 1 to prevent further writes to MSR_PPIN_CTL.

Bit 1: Enable_PPIN (R/W)
       If 1, enables MSR_PPIN to be accessible using RDMSR.
       If 0, an attempt to read MSR_PPIN will cause #GP.

So there are four defined values:
0: PPIN is disabled, PPIN_CTL may be updated
1: PPIN is disabled. PPIN_CTL is locked against updates
2: PPIN is enabled. PPIN_CTL may be updated
3: PPIN is enabled. PPIN_CTL is locked against updates

Code would only enable the X86_FEATURE_INTEL_PPIN feature for case "2".
When it should have done so for both case "2" and case "3".

Fix the final test to just check for the enable bit. Also fix some of
the other comments in this function.

Fixes: be8f418393c7 ("x86/mce: Include the PPIN in MCE records when available")
Signed-off-by: Tony Luck <tony.luck@intel.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: <stable@vger.kernel.org>
Link: https://lkml.kernel.org/r/20200226011737.9958-1-tony.luck@intel.com
arch/x86/kernel/cpu/mce/intel.c