Re: [PATCH 1/1] x86/mce/amd: Add PPIN support for AMD MCE

From: Huang2, Wei
Date: Thu Mar 19 2020 - 16:58:25 EST


[AMD Official Use Only - Internal Distribution Only]

From: linux-kernel-owner@xxxxxxxxxxxxxxx <linux-kernel-owner@xxxxxxxxxxxxxxx> on behalf of Borislav Petkov <bp@xxxxxxxxx>

Sent: Thursday, March 19, 2020 3:21 PM

> You can add it to arch/x86/kernel/cpu/mce/amd.c just like
> intel_ppin_init() is respectively in .../mce/intel.c, as mce/ is where
> this thing is used only. We can move it to kernel/cpu/ later if it turns
> out that it is needed for something else.

To use this approach, I have to clear X86_FEATURE_AMD_PPIN if MSR_AMD_PPIN_CTL is locked and disabled.

However, there is a small problem: during boot, mce_setup() is called once before mce_amd_ppin_init() is invoked. As a result, mce_setup() might read X86_FEATURE_AMD_PPIN incorrectly. This concerns me.

Thanks,
-Wei