Function report |
Source Code:arch\x86\kernel\cpu\mce\core.c |
Create Date:2022-07-28 08:00:45 |
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
| home page | Tree |
| Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:The actual machine check handler. This only handles real* exceptions when something got corrupted coming in through int 18.* This is executed in NMI context not subject to normal locking rules. This* implies that most kernel services cannot be safely used
Proto:void do_machine_check(struct pt_regs *regs, long error_code)
Type:void
Parameter:
| Type | Parameter | Name |
|---|---|---|
| struct pt_regs * | regs | |
| long | error_code |
| 1231 | DECLARE_BITMAP(valid_banks, Maximum banks number.* This is the limit of the current register layout on* Intel CPUs.) |
| 1232 | DECLARE_BITMAP(toclear, Maximum banks number.* This is the limit of the current register layout on* Intel CPUs.) |
| 1234 | cpu = smp_processor_id() |
| 1235 | msg = "Unknown" |
| 1237 | worst = 0 |
| 1243 | order = -1 |
| 1249 | no_way_out = 0 |
| 1255 | kill_it = 0 |
| 1261 | lmce = 1 |
| 1263 | If Cases where we avoid rendezvous handler timeout:* 1) If this CPU is offline Then Return |
| 1271 | CPU time stamp counter = dtsc() - returns the current TSC without ordering constraints* rdtsc() returns the result of RDTSC as a 64-bit integer |
| 1273 | final = this_cpu_ptr( & mces_seen) |
| 1276 | memset(valid_banks, 0, size of valid_banks ) |
| 1277 | no_way_out = Do a quick check if any of the events requires a panic.* This decides if we keep the events around or clear them. |
| 1286 | If Not (Machine Check Global Status MSR & start ip valid ) Then kill_it = 1 |
| 1293 | If Kernel's X86_VENDOR enum == X86_VENDOR_INTEL || Kernel's X86_VENDOR enum == X86_VENDOR_ZHAOXIN Then lmce = Machine Check Global Status MSR & LMCE signaled |
| 1304 | If lmce Then |
| 1305 | If no_way_out Then mce_panic("Fatal local machine check", & m, msg) |
| 1307 | Else |
| 1311 | __mc_scan_banks( & m, final, toclear, valid_banks, no_way_out, & worst) |
| 1313 | If Not no_way_out Then mce_clear_state(toclear) |
| 1320 | If Not lmce Then |
| 1323 | Else |
| 1332 | If worst >= MCE_PANIC_SEVERITY && tolerant < 3 Then |
| 1344 | Else if no_way_out Then mce_panic("Fatal machine check on current CPU", & m, msg) |
| 1347 | If worst > 0 Then irq_work_queue( & mce_irq_work) |
| 1350 | mce_wrmsrl(MSR_IA32_MCG_STATUS, 0) |
| 1354 | If worst != MCE_AR_SEVERITY && Not kill_it Then Go to out_ist |
| 1358 | If (Code segment & 3) == 3 Then |
| 1362 | If kill_it || do_memory_failure( & m) Then force_sig(SIGBUS) |
| 1364 | local_irq_disable() |
| 1366 | Else |
| 1367 | If Not fixup_exception(regs, X86_TRAP_MC, error_code, 0) Then mce_panic("Failed kernel mode recovery", & m, NULL) |
| 1371 | out_ist : |
| Source code conversion tool public plug-in interface | X |
|---|---|
| Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |