--- generic.c.O 2007-08-30 23:21:01.000000000 -0700 +++ generic.c 2007-09-16 09:09:34.000000000 -0700 @@ -78,6 +78,8 @@ base, base + step - 1, mtrr_attrib_to_str(*types)); } +static int set_mtrr_var_ranges(unsigned int index, struct mtrr_var_range *vr); + /* Grab all of the MTRR state for this CPU into *state */ void get_mtrr_state(void) { @@ -105,6 +107,21 @@ mtrr_state.def_type = (lo & 0xff); mtrr_state.enabled = (lo & 0xc00) >> 10; + /* Check for initial 4GB range, it should only be 3GB */ + if (!mtrr_state.var_ranges[0].base_hi && !(mtrr_state.var_ranges[0].base_lo & 0xffffff00) && + !(mtrr_state.var_ranges[0].mask_lo & 0x80000000)) { + /* split initial 4GB range into 2GB and 1GB */ + for (i = num_var_ranges-1; i>0; i--) + mtrr_state.var_ranges[i] = mtrr_state.var_ranges[i-1]; + mtrr_state.var_ranges[0].mask_lo |= 0x80000000; + mtrr_state.var_ranges[1].base_hi = 0; + mtrr_state.var_ranges[1].base_lo = 0x80000000 | MTRR_TYPE_WRBACK ; + mtrr_state.var_ranges[1].mask_hi = mtrr_state.var_ranges[2].mask_hi; + mtrr_state.var_ranges[1].mask_lo = mtrr_state.var_ranges[2].mask_lo; + for (i = 0; i < num_var_ranges; i++) + set_mtrr_var_ranges(i, &mtrr_state.var_ranges[i]); + } + if (mtrr_show) { int high_width;