Thread (18 messages) 18 messages, 3 authors, 2021-10-14
STALE1718d

[PATCH 2/5] x86/mce/inject: Set the valid bit in MCA_STATUS before error injection

From: Smita Koralahalli <hidden>
Date: 2021-09-15 23:28:26
Also in: lkml
Subsystem: the rest, x86 architecture (32-bit and 64-bit), x86 mce infrastructure · Maintainers: Linus Torvalds, Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen, Tony Luck

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 in the corresponding MCA_STATUS register if the user
forgets to set it while doing error simulation.

Signed-off-by: Smita Koralahalli <redacted>
---
 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 51ac575c4605..8de709b049fc 100644
--- a/arch/x86/kernel/cpu/mce/inject.c
+++ b/arch/x86/kernel/cpu/mce/inject.c
@@ -490,6 +490,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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help