Page MenuHomeFreeBSD

D10536.id27827.diff
No OneTemporary

D10536.id27827.diff

Index: sys/x86/x86/mca.c
===================================================================
--- sys/x86/x86/mca.c
+++ sys/x86/x86/mca.c
@@ -653,7 +653,7 @@
* count of the number of valid MC records found.
*/
static int
-mca_scan(enum scan_mode mode)
+mca_scan(enum scan_mode mode, int *recoverable_out)
{
struct mca_record rec;
uint64_t mcg_cap, ucmask;
@@ -704,7 +704,9 @@
}
if (mode == POLLED)
mca_fill_freelist();
- return (mode == MCE ? recoverable : count);
+ if (recoverable_out != NULL)
+ *recoverable_out = recoverable;
+ return (count);
}
/*
@@ -726,7 +728,7 @@
CPU_FOREACH(cpu) {
sched_bind(td, cpu);
thread_unlock(td);
- count += mca_scan(POLLED);
+ count += mca_scan(POLLED, NULL);
thread_lock(td);
sched_unbind(td);
}
@@ -1150,7 +1152,7 @@
mca_intr(void)
{
uint64_t mcg_status;
- int old_count, recoverable;
+ int old_count, recoverable, count;
if (!(cpu_feature & CPUID_MCA)) {
/*
@@ -1165,7 +1167,7 @@
/* Scan the banks and check for any non-recoverable errors. */
old_count = mca_count;
- recoverable = mca_scan(MCE);
+ count = mca_scan(MCE, &recoverable);
mcg_status = rdmsr(MSR_MCG_STATUS);
if (!(mcg_status & MCG_STATUS_RIPV))
recoverable = 0;
@@ -1177,7 +1179,7 @@
* on all CPUs, but only certain CPUs will find a valid
* bank to log.
*/
- while (mca_count == old_count)
+ while (count == 0 && mca_count == old_count)
cpu_spinwait();
panic("Unrecoverable machine check exception");
@@ -1199,7 +1201,7 @@
* Serialize MCA bank scanning to prevent collisions from
* sibling threads.
*/
- count = mca_scan(CMCI);
+ count = mca_scan(CMCI, NULL);
/* If we found anything, log them to the console. */
if (count != 0) {

File Metadata

Mime Type
text/plain
Expires
Sat, Dec 21, 1:54 AM (14 h, 26 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15537085
Default Alt Text
D10536.id27827.diff (1 KB)

Event Timeline