diff --git a/src/add-ons/kernel/cpu/x86/generic_x86.cpp b/src/add-ons/kernel/cpu/x86/generic_x86.cpp index 53d1355ee7..11bb1038fc 100644 --- a/src/add-ons/kernel/cpu/x86/generic_x86.cpp +++ b/src/add-ons/kernel/cpu/x86/generic_x86.cpp @@ -60,6 +60,9 @@ generic_count_mtrrs(void) void generic_init_mtrrs(uint32 count) { + if (count == 0) + return; + // disable and clear all MTRRs // (we leave the fixed MTRRs as is) // TODO: check if the fixed MTRRs are set on all CPUs identically? diff --git a/src/system/kernel/arch/x86/arch_cpu.c b/src/system/kernel/arch/x86/arch_cpu.c index b4aab754f5..1ea4a96e66 100644 --- a/src/system/kernel/arch/x86/arch_cpu.c +++ b/src/system/kernel/arch/x86/arch_cpu.c @@ -358,11 +358,9 @@ arch_cpu_init_post_modules(kernel_args *args) close_module_list(cookie); - if (sCpuModule == NULL) - return B_OK; - - // initialize MTRRs - call_all_cpus(&init_mtrrs, NULL); + // initialize MTRRs if available + if (x86_count_mtrrs > 0) + call_all_cpus(&init_mtrrs, NULL); return B_OK; }