lkml.org 
[lkml]   [2002]   [Jun]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject2.5.24-dj2: oops in finalize_mtrr_state with bochs
The bochs cpu emulator (tries to emulate Pentium cpus) oopses in 
finalize_mtrr_state():

mtrr_if is NULL, and thus use_intel() crashes.

Patch attached. I've modified is_cpu() as well, without checking if this
macro could be used if mtrr_if is not initialized.

Partially tested - bochs now hangs at the first access to the ide
interface :-(
--
Manfred
diff -u 2.5/arch/i386/kernel/cpu/mtrr/mtrr.h build-2.5/arch/i386/kernel/cpu/mtrr/mtrr.h
--- 2.5/arch/i386/kernel/cpu/mtrr/mtrr.h Tue Jun 25 20:27:47 2002
+++ build-2.5/arch/i386/kernel/cpu/mtrr/mtrr.h Tue Jun 25 21:22:15 2002
@@ -88,8 +88,8 @@
extern u32 size_or_mask, size_and_mask;
extern struct mtrr_ops * mtrr_if;

-#define is_cpu(vnd) (mtrr_if->vendor == X86_VENDOR_##vnd)
-#define use_intel() (mtrr_if->use_intel_if == 1)
+#define is_cpu(vnd) (mtrr_if && mtrr_if->vendor == X86_VENDOR_##vnd)
+#define use_intel() (mtrr_if && mtrr_if->use_intel_if == 1)

extern unsigned int num_var_ranges;
\
 
 \ /
  Last update: 2005-03-22 13:27    [W:0.050 / U:0.088 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site