ajw1980
08-18-2008, 10:43 AM
Hi,
I've got a phenom with the TLB problem and a motherboard without an option to disable the TLB fix. I didn't want to have to patch the kernel source to disable it, so I figured out it was enough to twiddle some MSR bits.
Here is a script that turns off the TLB fix:
#!/bin/bash
MSR1=0xC0010015
MSR2=0xC0011023
if [ ! -d /dev/cpu ]; then
modprobe msr
fi
for i in /dev/cpu/*; do
CPU=$(basename $i)
VAL=$(rdmsr -p $CPU -u $MSR1)
wrmsr -p $CPU $MSR1 $(( VAL &= ~(1 << 3) ))
VAL=$(rdmsr -p $CPU -u $MSR2)
wrmsr -p $CPU $MSR2 $(( VAL &= ~(1 << 1) ))
done
It uses the msr tools from here:
http://www.kernel.org/pub/linux/utils/cpu/msr-tools/
Be careful of the msr-tools Debian package. It isn't compiled correctly. It works ok using 64 bit, but 32 bit is broken. I've filed bug #495445 for it.
Benchmarks are here to make sure it is working
http://global.phoronix-test-suite.com/index.php?k=profile&u=ajw-3221-31493-11066
I've got a phenom with the TLB problem and a motherboard without an option to disable the TLB fix. I didn't want to have to patch the kernel source to disable it, so I figured out it was enough to twiddle some MSR bits.
Here is a script that turns off the TLB fix:
#!/bin/bash
MSR1=0xC0010015
MSR2=0xC0011023
if [ ! -d /dev/cpu ]; then
modprobe msr
fi
for i in /dev/cpu/*; do
CPU=$(basename $i)
VAL=$(rdmsr -p $CPU -u $MSR1)
wrmsr -p $CPU $MSR1 $(( VAL &= ~(1 << 3) ))
VAL=$(rdmsr -p $CPU -u $MSR2)
wrmsr -p $CPU $MSR2 $(( VAL &= ~(1 << 1) ))
done
It uses the msr tools from here:
http://www.kernel.org/pub/linux/utils/cpu/msr-tools/
Be careful of the msr-tools Debian package. It isn't compiled correctly. It works ok using 64 bit, but 32 bit is broken. I've filed bug #495445 for it.
Benchmarks are here to make sure it is working
http://global.phoronix-test-suite.com/index.php?k=profile&u=ajw-3221-31493-11066