kernel/x86: Enable machine check exceptions if supported.
This enables generation of exceptions that are due to uncorrected hardware errors. The exception handlers were already in place and will now actually trigger kernel panics. Note that this is the simplest form of MCE "handling" and does not add anything of the broader machine check architecture (MCA) that also allow reporting of corrected errors. As MCEs are generally hard to decode due to their hardware specifity, this merely makes such problems more obvious. Might help to discern hardware issues in cases that would otherwise just triple fault and cause a reboot. Change-Id: I9e3a2640458f7c562066478d0ca90e3a46c3a325 Reviewed-on: https://review.haiku-os.org/c/haiku/+/3155 Reviewed-by: waddlesplash <[email protected]> Reviewed-by: Axel Dörfler <[email protected]>
This commit is contained in:
committed by
Axel Dörfler
parent
f9b3a3b1f3
commit
4df4ae2e80
@@ -1350,6 +1350,9 @@ arch_cpu_init_percpu(kernel_args* args, int cpu)
|
||||
gCpuIdleFunc = halt_idle;
|
||||
}
|
||||
|
||||
if (x86_check_feature(IA32_FEATURE_MCE, FEATURE_COMMON))
|
||||
x86_write_cr4(x86_read_cr4() | IA32_CR4_MCE);
|
||||
|
||||
#ifdef __x86_64__
|
||||
// if RDTSCP is available write cpu number in TSC_AUX
|
||||
if (x86_check_feature(IA32_FEATURE_AMD_EXT_RDTSCP, FEATURE_EXT_AMD))
|
||||
|
||||
Reference in New Issue
Block a user