InfiniteMac OSx86  


Reply
 
Thread tools Display modes
  #1  
Old 03-05-2009, 09:52 PM
Shadow3k's Avatar
Shadow3k Shadow3k is offline
Jaguar
 
Join Date: Feb 2008
Posts: 32
How to disable TLB fix in Phenom 9x00 systems under OSx86 [code+test kernel]

Hello,

If you cant disable TLB fix in BIOS there is another way to do it - modify kernel and disable TLB fix on start up.

If you dont know what TLB is here is copy&paste from wikipedia:
"Translation Lookaside Buffer (TLB) Error in Original Phenoms
Before Phenom's release, a flaw was discovered in the translation lookaside buffer that could cause a system lock-up in rare circumstances. Phenom processors up to and including stepping "B2" and "BA" are affected by this bug. BIOS and software workarounds disable the TLB, and typically incur a performance penalty of at least 10%. This penalty was not accounted for in pre-release previews of Phenom, hence the performance of early Phenoms delivered to customers is expected to be less than the preview benchmarks. "B3" stepping Phenom processors were released March 27, 2008 without the TLB bug and with "xx50" model numbers."

So what we do it just disable a workarounds and get original Phenom perfomance back. BUT IT COULD CAUSE SYSTEM LOCK-UP IN RARE CIRCUMSTANCES.

More detailed information about errdata an workarounds is available here:
AMD Phenom CPU errata and workarounds (TLB fix in detail) http://translate.google.com/translat...istory_state0=

So by disabling TLB fix we get a perfomance boost on affected by bug systems:

Voodoo kernel, without modification (TLB fix enabled - system is stable):

Xbench score is 138.41

Voodoo kernel, with few more line (below) (TLB fix disabled - full Phenom perfomance!)


Xbench score is 179.63

30% increase in perfomance according to xbench

p.s. benchmarked without HDD testing.

Code:

#define PHENOM_MSR_HWCR 0xc0010015
#define PHENOM_MSR_BU_CFG 0xc0011023

static void
phenom_tlbfix_disable(void)
{
uint32_t lo;
uint32_t hi;
/*
* Phenom 9x00:
* Disable TLB fix for perfomance.
* To workarounds for errata 254, 298 and 309 to disable
*/

if (cpuid_family() == 16 )
{
rdmsr(PHENOM_MSR_HWCR, lo, hi);
wrmsr (PHENOM_MSR_HWCR, 0x01000010,hi);
rdmsr(PHENOM_MSR_BU_CFG, lo, hi);
wrmsr (PHENOM_MSR_BU_CFG, 0x00000020, hi);
printf("TLB FIX disabled! Phenom at full speed!\n");
}
}

Currently i placed function call in mtrr_update_action procedure of mtrr.c to unfix all cores at start up. If you know a better place for patching MSR send me a message.

Voodoo kernel compiled with Phenom TLB fix disabler code: http://rapidshare.com/files/206029294/mach_kernel.tlb

-
Zephyroths OSX 10.5.1 distro upgraded to ... 10.5.6 , Voodoo kernel... downgraded to 10.5.4 to get USB working again! (with help of iPC distributive)
AMD Phenom X4 9500, MSI K9A2 CF,AMDŽ 790X (SB600), 4GB DDR2, ATI HD3850
Disable TLB fix http://www.infinitemac.com/f19/pheno...isabler-t2316/
-
Compaq Mini 311c, Windows XP SP3 and Snow Leopard 10.6.2 http://myhpmini.com/forum/viewtopic.php?f=17&t=3302

Last edited by Shadow3k; 04-05-2009 at 10:59 AM.
Reply With Quote
  #2  
Old 03-06-2009, 01:06 AM
LawlessPPC's Avatar
LawlessPPC LawlessPPC is offline
 
Join Date: May 2008
Location: United Kingdom
Posts: 506
ill tell you what shadow you dont make many posts but the one you do really seem to count. The thing is I'm not sure what you mean by TLB is this for cpu throttling? Looks like im gonna have to investigate!!!!


Can you put your full results in hardware forum there a sticky at top of page may be some intels to compare against?


Last edited by LawlessPPC; 03-06-2009 at 01:08 AM.
Reply With Quote
  #3  
Old 03-06-2009, 09:06 AM
Shadow3k's Avatar
Shadow3k Shadow3k is offline
Jaguar
 
Join Date: Feb 2008
Posts: 32
"Translation Lookaside Buffer (TLB) Error in Original Phenoms
Before Phenom's release, a flaw was discovered in the translation lookaside buffer that could cause a system lock-up in rare circumstances. Phenom processors up to and including stepping "B2" and "BA" are affected by this bug. BIOS and software workarounds disable the TLB, and typically incur a performance penalty of at least 10%. This penalty was not accounted for in pre-release previews of Phenom, hence the performance of early Phenoms delivered to customers is expected to be less than the preview benchmarks. "B3" stepping Phenom processors were released March 27, 2008 without the TLB bug and with "xx50" model numbers." (from wiki)

So what we do it just disable a workarounds and get original Phenom perfomance back. BUT IT COULD CAUSE SYSTEM LOCK-UP IN RARE CIRCUMSTANCES.

But we running a hack dont we?

AMD Phenom CPU errata and workarounds (TLB fix in detail) http://translate.google.com/translat...istory_state0=

Modified kernel uploaded, link in first post.

-
Zephyroths OSX 10.5.1 distro upgraded to ... 10.5.6 , Voodoo kernel... downgraded to 10.5.4 to get USB working again! (with help of iPC distributive)
AMD Phenom X4 9500, MSI K9A2 CF,AMDŽ 790X (SB600), 4GB DDR2, ATI HD3850
Disable TLB fix http://www.infinitemac.com/f19/pheno...isabler-t2316/
-
Compaq Mini 311c, Windows XP SP3 and Snow Leopard 10.6.2 http://myhpmini.com/forum/viewtopic.php?f=17&t=3302

Last edited by Shadow3k; 03-06-2009 at 03:07 PM.
Reply With Quote
  #4  
Old 12-28-2009, 08:50 PM
bhokuto bhokuto is offline
Puma
 
Join Date: Dec 2009
Location: California
Posts: 15
Hi, Greetings Shadow

I have a Phenom X3 8400

I am using one on Windows which I use using in conjunction with CPU something I forgot the name of the program.

Will your's work or do I have to make a change? Because technically and X3 has four cores with last one disabled.

This is my very first Mac and I just installed it for the umpteenth time this week getting things in order.

Thanks
Stu
Reply With Quote
  #5  
Old 01-03-2010, 08:53 PM
Shadow3k's Avatar
Shadow3k Shadow3k is offline
Jaguar
 
Join Date: Feb 2008
Posts: 32
Just download to / , boot up with mach_kernel.tlb and benchmark. Patch is placed in place where it runs on each available core. No difference X4 or X3.

Quote:
Originally Posted by bhokuto View Post
Hi, Greetings Shadow

I have a Phenom X3 8400

I am using one on Windows which I use using in conjunction with CPU something I forgot the name of the program.

Will your's work or do I have to make a change? Because technically and X3 has four cores with last one disabled.

This is my very first Mac and I just installed it for the umpteenth time this week getting things in order.

Thanks
Stu



💡 Deploy cloud instances seamlessly on DigitalOcean. Free credits ($100) for InfMac readers.


-
Zephyroths OSX 10.5.1 distro upgraded to ... 10.5.6 , Voodoo kernel... downgraded to 10.5.4 to get USB working again! (with help of iPC distributive)
AMD Phenom X4 9500, MSI K9A2 CF,AMDŽ 790X (SB600), 4GB DDR2, ATI HD3850
Disable TLB fix http://www.infinitemac.com/f19/pheno...isabler-t2316/
-
Compaq Mini 311c, Windows XP SP3 and Snow Leopard 10.6.2 http://myhpmini.com/forum/viewtopic.php?f=17&t=3302
Reply With Quote
Reply