Jump to content
InsanelyMac Forum
flAked

MSRDumper

Recommended Posts

MSRDumper v1.0

 

MSRDumper is a special made kext for debugging P-State transitions on SandyBridge systems.

It will output the current CPU multiplier and the reached P-States over time in kernel.log.

 

MSRDumper was written from scratch by me with contributions by DHP. It spawned from the lack of reliable tools for SandyBridge and was used for various tests, including dumping interesting MSR's. The old version was also posted on tonymac to get readings from GigaByte owners.

 

Technical background: register MSR_PERF_STATUS (0x198) is read to get the current multiplier. For SandyBridge this MSR is only defined per package (all CPU). This kext can be used on other systems as well, but it will only show the multiplier for CPU0. For Nehalem the same MSR was defined per Core and possibly older systems as well. It used to show CPU-load and temperatures, but the constant readouts influenced the actual multiplier, so it is disabled for now.

 

Usage:

sudo bash
chown -R root:wheel MSRDumper.kext
kextload MSRDumper.kext

It is discouraged to copy MSRDumper to /S/L/E and load it at boot-time, because it might overwrite important log messages. Instead, load the kext from any location after the system booted. Do some benchmarks, start different applications, let it run for 15 minutes and see which P-States are used. Unload after use, otherwise it will continuously spam your kernel.log!

 

 

MSRDumper.kext.zip

Share this post


Link to post
Share on other sites
Advertisement

flAked, thanks for your great work.

 

Edit: Updated with MSRDumper 1.0

 

MSRDumper PStatesReached: 16 24 29 35 36 37

 

bdmesg:

SSDT with CPU C-States generated successfully

P-States: min 0x10, max 0x0

RSDT: Added 1 SSDT table(s

 

P-States not working properly.

 

Tool works great.

 

GA-H67N-USB3/i7-2600K/6870/10.6.7/imac12,2

Share this post


Link to post
Share on other sites
Is SpeedStep working on my i7-2600K?

Seems like only the turbo states are working, which might be hardware-controlled, or a misconfigured SSDT_PR.

 

Please keep the discussion on this thread on the tool itself.

 

Bug reports, suggestions, new releases, features, etc. Thank you.

Share this post


Link to post
Share on other sites

I know nothing about programing but was wondering if this could be made into a GUI program like CPU-Z for windows showing current speed and multiplier values?

 

Dude

Share this post


Link to post
Share on other sites
I know nothing about programing but was wondering if this could be made into a GUI program like CPU-Z for windows showing current speed and multiplier values?

Not planned at the moment. Developing a kernel extension that outputs information through kernel.log is relatively easy to do, a GUI that displays information from a kernel extension is far more complicated (kernel <-> userspace communication).

Share this post


Link to post
Share on other sites

Would it be possible to get an non Sandy Bridge CPU Version of the MSRDumper too?

LIke for C2D or other pre Sandy Intel CPUS.

Thanks.

Share this post


Link to post
Share on other sites

MSR_PERF_STATUS is a generic register for several of the last CPU's, so it should just work, I also tested this on my C2D MBP.

Share this post


Link to post
Share on other sites
MSR_PERF_STATUS is a generic register for several of the last CPU's, so it should just work, I also tested this on my C2D MBP.

THANKS!

But i get KP with my C2D (tried in 10.6.7 + 10.7) immediately after kextload.

Chameleon 2.0-RC5 (svn-r1078) [2011-06-26 01:03:30]

msr(295): ia32_perf_stat 0x06000a20

max: 10 current: 10

CPU: Brand String: Intel® Core™2 Duo CPU E7300 @ 3.00 GHz (10*300 FSB OCed)

CPU: Vendor/Family/ExtFamily: 0x756e6547/0x6/0x0

CPU: Model/ExtModel/Stepping: 0x17/0x1/0x6

CPU: MaxCoef/CurrCoef: 0xa/0xa

CPU: MaxDiv/CurrDiv: 0x0/0x0

CPU: TSCFreq: 3000MHz

CPU: FSBFreq: 300MHz

CPU: CPUFreq: 3000MHz

CPU: NoCores/NoThreads: 2/2

CPU: Features: 0x0000025f

Perhaps that older (first gen , without VX feature for example) C2D CPU must be little other MSR reading tasks / has other /less MSR registers than newer C2D cpu versions.

MSR Info from CPU_Z:

MSR 0x0000001B edx = 0x00000000 eax = 0xFEE00900

MSR 0x000000E8 edx = 0x0000005F eax = 0x6BDF2C7C

MSR 0x00000017 edx = 0x04000000 eax = 0xA9848A1E

MSR 0x000000CD edx = 0x00000000 eax = 0x00000800

MSR 0x0000003F edx = 0x00000000 eax = 0x00000000

MSR 0x000000CE edx = 0x001A0A1E eax = 0x19190716

MSR 0x000001A0 edx = 0x00000040 eax = 0x62972489

MSR 0x000000EE edx = 0x00000000 eax = 0x867D0300

MSR 0x0000011E edx = 0x00000000 eax = 0xBE702119

MSR 0x0000019C edx = 0x00000000 eax = 0x88350000

MSR 0x00000198 edx = 0x061A0A1E eax = 0x06000A1E

MSR 0x00000199 edx = 0x00000000 eax = 0x00000A1E

Share this post


Link to post
Share on other sites

CPU_Z for windows?

 

It is reading out 0x198 correctly, so it can't be that register. But on startup, MSRDumper is printing out some other registers, too. Let me compile a stripped down version...

 

Can you post a screen of the KP?

 

 

Try this one: MSRDumper_legacy.kext.zip

Share this post


Link to post
Share on other sites

Great, the new next didnt KP . ;)

 

28.07.11 19:54:33,000 kernel: MSRDumper CoreMulti(6)

28.07.11 19:54:33,000 kernel: MSRDumper PStatesReached:

28.07.11 19:54:33,000 kernel: MSRDumper CoreMulti(6)

28.07.11 19:54:33,000 kernel: MSRDumper PStatesReached:

28.07.11 19:54:34,000 kernel: MSRDumper CoreMulti(6)

28.07.11 19:54:34,000 kernel: MSRDumper PStatesReached:

28.07.11 19:54:34,000 kernel: MSRDumper CoreMulti(10)

28.07.11 19:54:34,000 kernel: MSRDumper PStatesReached: 10

Share this post


Link to post
Share on other sites

Oh, that the 6 is not shown is a bug.

 

Can you open up some programs, run a bench mark and see if more states are reached?

Share this post


Link to post
Share on other sites

I tried out MSRdumper with sandybridge mobo/proc (in sig) and it seems to be working great. Encoded a video on Handbrake and ran a few standard programs...seems like the highest it will go to is 34....but the most important thing is that is idles at 16x....Thanks a lot!

 

Jul 28 15:30:41 Macintosh kernel[0]: MSRDumper CoreMulti(16)

Jul 28 15:30:41 Macintosh kernel[0]: MSRDumper PStatesReached: 16 19 23 28 33 34

Share this post


Link to post
Share on other sites
Jul 28 15:30:41 Macintosh kernel[0]: MSRDumper CoreMulti(16)

Jul 28 15:30:41 Macintosh kernel[0]: MSRDumper PStatesReached: 16 19 23 28 33 34

Under Lion with which model identifier?

Share this post


Link to post
Share on other sites
Under Lion with which model identifier?

 

By Model indentifier...do you mean for the Mac...? I am using MacBook Pro 8,1. Tried MBP 8,3 and iMac12,2, but both do not allow my system to boot most likely because I am using the integrated graphics.

Share this post


Link to post
Share on other sites

Missing P-States for iMac12,2 on 10.7 seems to be a bug, we are currently investigating...

 

Lion retail installation tests:

MacBookPro8,3
PStatesReached: 16 22 26 30 [34 35 36]

iMac12,2
PStatesReached: 16 [34 35 36 37]

Share this post


Link to post
Share on other sites

I don't think that will work, because the stepper programs are version dependent on AICPUPM.

Share this post


Link to post
Share on other sites
I don't think that will work, because the stepper programs are version dependent on AICPUPM.

 

It hasn't been a good idea :\

Share this post


Link to post
Share on other sites

@flAked,

 

Can I run MSRDumper without sudo bash? I wanted to try this on a iMAC 12,2 (i7 Quad) and maybe the i5 but if I go to the apple store which I have done before and run DSDT editors and stuff without any complaints will I need to sudo to run MSRDumper?

 

I think I can chown -R root:wheel MSRDumper.kext without executing sudo bash first correct? Maybe I cannot run it as normal user after changing ownership?

 

I know they will not give me the sudo password thats for sure.

 

As far as dmesg I know I have to sudo but I could just copy the system logs onto my flash drive from /var/log

Share this post


Link to post
Share on other sites

No that's not possible. The only case where non-root users can load a kext is when a installed kext in /System has the OSBundleAllowUserLoad set (according to the kextload manpage).

 

It's a good thing that users can't load anything into the kernel without root-privileges.

 

That being said, we already have confirmation that this behavior is also present on iMac12,2 hardware and is being sent to QA and hopefully reach the engineers next week.

 

Thanks for your help, though! Much appreciated.

Share this post


Link to post
Share on other sites

Hi,

 

I tried it out (Mac Pro 3.1 / Sandy / i7 2600k) and here is my log at idle.

Do you think everything is ok ?

 

Aug 14 08:32:38 new-host-3 kernel[0]: MSRDumper CoreMulti(16)

Aug 14 08:32:38 new-host-3 kernel[0]: MSRDumper PStatesReached: 16 20 35

Thank for your tool.

Share this post


Link to post
Share on other sites

It looks promising because you have the 20x in there. Let it run for 20 minutes and start different applications. The idle state is not very interesting, let your CPU work a little ;)

Share this post


Link to post
Share on other sites

You're right.

It seems to be ok.

Thanks.

 

Aug 14 19:17:15 new-host-3 kernel[0]: MSRDumper CoreMulti(37)

Aug 14 19:17:15 new-host-3 kernel[0]: MSRDumper PStatesReached: 16 20 35 36 37

Share this post


Link to post
Share on other sites
Missing P-States for iMac12,2 on 10.7 seems to be a bug, we are currently investigating...

 

Lion retail installation tests:

MacBookPro8,3
PStatesReached: 16 22 26 30 [34 35 36]

iMac12,2
PStatesReached: 16 [34 35 36 37]

 

Have you made any headway with the above? My Hacintosh w/ iMac12,2 signature outputs:

Aug 27 11:46:19 jookiba kernel[0]: MSRDumper CoreMulti(35)

Aug 27 11:46:19 jookiba kernel[0]: MSRDumper PStatesReached: 16 35 36 37 38

 

It seems I'm missing the 34 state. Should I be concerned?

 

Also, when I run my 2600k at 4.2GHz, the only 2 states displayed are 16 and 42:

Aug 27 16:12:06 jookiba kernel[0]: MSRDumper CoreMulti(42)

Aug 27 16:12:06 jookiba kernel[0]: MSRDumper PStatesReached: 16 42

Share this post


Link to post
Share on other sites

These are two separate issues. Nothing new on the PM front for iMac12,2 I'm afraid. The new mac mini definitions have some interesting new format with three stepper programs to choose from. But I'm currently unable to investigate further.

 

Regarding over-clocking, you either need a custom made SSDT_PR with the P-State definition you want to use or RevoBoots auto SSDT_PR inject.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.



×