Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F105747565
D10536.id27834.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D10536.id27834.diff
View Options
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 *recoverablep)
{
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 (recoverablep != NULL)
+ *recoverablep = 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 recoverable, count;
if (!(cpu_feature & CPUID_MCA)) {
/*
@@ -1164,20 +1166,18 @@
}
/* 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;
if (!recoverable) {
/*
- * Wait for at least one error to be logged before
- * panic'ing. Some errors will assert a machine check
- * on all CPUs, but only certain CPUs will find a valid
- * bank to log.
+ * Only panic if the error was detected local to this CPU.
+ * Some errors will assert a machine check on all CPUs, but
+ * only certain CPUs will find a valid bank to log.
*/
- while (mca_count == old_count)
+ while (count == 0)
cpu_spinwait();
panic("Unrecoverable machine check exception");
@@ -1199,7 +1199,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
Details
Attached
Mime Type
text/plain
Expires
Sat, Dec 21, 2:13 AM (14 h, 27 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15537234
Default Alt Text
D10536.id27834.diff (1 KB)
Attached To
Mode
D10536: x86 MCA: Fix a deadlock in MCA exception processing
Attached
Detach File
Event Timeline
Log In to Comment