Messages in this thread Patch in this message | | | From | Smita Koralahalli <> | Subject | [PATCH v3 2/6] x86/mce/inject: Set the valid bit in MCA_STATUS before error injection | Date | Thu, 4 Nov 2021 16:58:42 -0500 |
| |
MCA handlers check the valid bit in each status register (MCA_STATUS[Val]) and examine the remainder of the status register only if the valid bit is set.
Set the valid bit unconditionally in the corresponding MCA_STATUS register and correct any Val=0 injections made by the user.
Signed-off-by: Smita Koralahalli <Smita.KoralahalliChannabasappa@amd.com> Link: https://lkml.kernel.org/r/20211019233641.140275-3-Smita.KoralahalliChannabasappa@amd.com --- v2: Added a warning statement instead of setting the valid bit. v3: Reverted the changes and set the valid bit conditionally. --- arch/x86/kernel/cpu/mce/inject.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/arch/x86/kernel/cpu/mce/inject.c b/arch/x86/kernel/cpu/mce/inject.c index fcec99e6c5d1..5e83a1ce7ac8 100644 --- a/arch/x86/kernel/cpu/mce/inject.c +++ b/arch/x86/kernel/cpu/mce/inject.c @@ -503,6 +503,8 @@ static void do_inject(void) i_mce.tsc = rdtsc_ordered(); + i_mce.status |= MCI_STATUS_VAL; + if (i_mce.misc) i_mce.status |= MCI_STATUS_MISCV; -- 2.17.1
| |