Skip to content

Commit

Permalink
x86: mtrr_cleanup try gran_size to less than 1M, v3
Browse files Browse the repository at this point in the history
J.A. Magallón reported:

 >> Also, on a 64 bit box with 4Gb, it gives this:
 >>
 >> cicely:~# cat /proc/mtrr
 >> reg00: base=0x00000000 (   0MB), size=4096MB: write-back, count=1
 >> reg01: base=0x100000000 (4096MB), size=1024MB: write-back, count=1
 >> reg02: base=0x140000000 (5120MB), size= 512MB: write-back, count=1
 >> reg03: base=0x160000000 (5632MB), size= 256MB: write-back, count=1
 >> reg04: base=0x80000000 (2048MB), size=2048MB: uncachable, count=1

boundary handling has a problem ... fix it.

Reported-by: J.A. Magallón <jamagallon@ono.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Yinghai Lu authored and Ingo Molnar committed Oct 3, 2008
1 parent 136c82c commit 834836e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/x86/kernel/cpu/mtrr/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1044,7 +1044,7 @@ range_to_mtrr_with_hole(struct var_mtrr_state *state, unsigned long basek,
hole_sizek = range0_sizek - state->range_sizek - second_sizek;

/* hole size should be less than half of range0 size */
if (hole_sizek > (range0_sizek >> 1) &&
if (hole_sizek >= (range0_sizek >> 1) &&
range0_sizek >= chunk_sizek) {
range0_sizek -= chunk_sizek;
second_sizek = 0;
Expand Down

0 comments on commit 834836e

Please sign in to comment.