aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSmita Koralahalli <[email protected]>2021-11-04 16:58:42 -0500
committerBorislav Petkov <[email protected]>2021-12-08 12:01:01 +0100
commit1e56279a49168f24b2b58e843ae92976f90a98a6 (patch)
tree09ea57e19726cde0bdfad3d8309902cb72c6a932
parente48d008bd13eaa9068ff59c65275d17516179f7b (diff)
x86/mce/inject: Set the valid bit in MCA_STATUS before error injection
MCA handlers check the valid bit in each status register (MCA_STATUS[Val]) and continue processing the error 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 as such errors will get ignored and such injections will be largely pointless. Signed-off-by: Smita Koralahalli <[email protected]> Signed-off-by: Borislav Petkov <[email protected]> Link: https://lore.kernel.org/r/[email protected]
-rw-r--r--arch/x86/kernel/cpu/mce/inject.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/x86/kernel/cpu/mce/inject.c b/arch/x86/kernel/cpu/mce/inject.c
index 725e8e4331a9..6eac840c64bb 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;