PDA

View Full Version : Disable TLB fix on phenoms


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

spikestabber
08-19-2008, 11:16 AM
Most BIOS's have an option to disable the microcode updates, this will kill the harmful TLB fix. The BIOS fix itself has a nasty impact on performance. There is a kernel patch floating around that fixes the bug without any performance impact at all. I'm not sure if the MSR stuff you did will disable the 'fix' that the BIOS microcode provides.