Bug 163

Summary: Impossible to setup MTRR registers
Product: Other Reporter: Paulo Andre' (fscked)
Component: OtherAssignee: Martin J. Bligh (mbligh)
Status: CLOSED CODE_FIX    
Severity: normal    
Priority: P2    
Hardware: i386   
OS: Linux   
Kernel Version: Subsystem:
Regression: --- Bisected commit-id:

Description Paulo Andre' 2002-12-11 13:22:21 UTC
Exact Kernel version: 2.5.51

Distribution: Slackware 8.1 

Hardware Environment: Pentium III 500MHz, 128MB RAM
Software Environment: glibc-2.2.5, gcc-2.95.3
Problem Description: It seems to be impossible to setup the MTRR registers. 
Whenever I try to set them up via /proc/mtrr, it fails whatever the type I 
assign to it saying the type is illegal. 

This doesn't happen on 2.4 though.


Steps to reproduce:

# echo "base=0xd8000000 size=0x2000000 type=write-combining" >| /proc/mtrr

ubik kernel: mtrr: illegal type: "write-combining"

# echo "base=0xd8000000 size=0x2000000 type=write-back" >| /proc/mtrr

ubik kernel: mtrr: illegal type: "write-back"
Comment 1 Dave Jones 2002-12-12 05:39:39 UTC
Andi Kleen fixed up a bunch of bugs in the MTRR driver as part of the current
x86-64 patch. I've extracted the relevant bits. Can you give it a try ?

It's at http://www.codemonkey.org.uk/cruft/mtrr.diff
Comment 2 Paulo Andre' 2002-12-12 06:47:09 UTC
Yes, the patch fixes it. It's now possible to set up the MTRR registers:

root@ubik:/home/paulo# cat /proc/mtrr
reg00: base=0x00000000 (   0MB), size= 128MB: write-back, count=1
root@ubik:/home/paulo# echo "base=0xd8000000 size=0x2000000 
type=write-combining" >| /proc/mtrr
root@ubik:/home/paulo# cat /proc/mtrr                                          
reg00: base=0x00000000 (   0MB), size= 128MB: write-back, count=1
reg01: base=0xd8000000 (3456MB), size=  32MB: write-combining, count=1

Comment 3 Dave Jones 2002-12-13 16:44:32 UTC
Close when merged to mainline.
Comment 4 Randy Dunlap 2003-01-25 14:51:30 UTC
The patch is merged in 2.5.59.