Jump to content

MSRDumper


  • Please log in to reply
81 replies to this topic

#1
flAked

flAked

    InsanelyMac Sage

  • Members
  • PipPipPipPipPipPip
  • 470 posts
  • Gender:Male
  • Location:internets
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!


Attached File  MSRDumper.kext.zip   13.83KB   7754 downloads

#2
toleda

toleda

    InsanelyMac Legend

  • Gurus
  • 811 posts
  • Gender:Male
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

#3
flAked

flAked

    InsanelyMac Sage

  • Members
  • PipPipPipPipPipPip
  • 470 posts
  • Gender:Male
  • Location:internets

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.

#4
dudedudedude

dudedudedude

    InsanelyMac Protégé

  • Members
  • Pip
  • 26 posts
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

#5
flAked

flAked

    InsanelyMac Sage

  • Members
  • PipPipPipPipPipPip
  • 470 posts
  • Gender:Male
  • Location:internets

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).

#6
mitch_de

mitch_de

    InsanelyMacaholic

  • Local Moderators
  • 2,879 posts
  • Gender:Male
  • Location:Stuttgart / Germany
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.

#7
flAked

flAked

    InsanelyMac Sage

  • Members
  • PipPipPipPipPipPip
  • 470 posts
  • Gender:Male
  • Location:internets
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.

#8
mitch_de

mitch_de

    InsanelyMacaholic

  • Local Moderators
  • 2,879 posts
  • Gender:Male
  • Location:Stuttgart / Germany

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

#9
flAked

flAked

    InsanelyMac Sage

  • Members
  • PipPipPipPipPipPip
  • 470 posts
  • Gender:Male
  • Location:internets
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: Attached File  MSRDumper_legacy.kext.zip   14KB   339 downloads

#10
mitch_de

mitch_de

    InsanelyMacaholic

  • Local Moderators
  • 2,879 posts
  • Gender:Male
  • Location:Stuttgart / Germany
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

#11
flAked

flAked

    InsanelyMac Sage

  • Members
  • PipPipPipPipPipPip
  • 470 posts
  • Gender:Male
  • Location:internets
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?

#12
rimmi2002

rimmi2002

    InsanelyMac Geek

  • Members
  • PipPipPip
  • 153 posts
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

#13
flAked

flAked

    InsanelyMac Sage

  • Members
  • PipPipPipPipPipPip
  • 470 posts
  • Gender:Male
  • Location:internets

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?

#14
rimmi2002

rimmi2002

    InsanelyMac Geek

  • Members
  • PipPipPip
  • 153 posts

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.

#15
flAked

flAked

    InsanelyMac Sage

  • Members
  • PipPipPipPipPipPip
  • 470 posts
  • Gender:Male
  • Location:internets
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]


#16
buoo

buoo

    The Prodigal Son

  • Moderators
  • 4,534 posts
  • Gender:Male
  • Location:Italy
We could try to replace the SMC plugin with the 10.6.8's

...I do a test

#17
flAked

flAked

    InsanelyMac Sage

  • Members
  • PipPipPipPipPipPip
  • 470 posts
  • Gender:Male
  • Location:internets
I don't think that will work, because the stepper programs are version dependent on AICPUPM.

#18
buoo

buoo

    The Prodigal Son

  • Moderators
  • 4,534 posts
  • Gender:Male
  • Location:Italy

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


It hasn't been a good idea :\

#19
oSxFr33k

oSxFr33k

    InsanelyMac Legend

  • Members
  • PipPipPipPipPipPipPip
  • 788 posts
  • Gender:Male
  • Interests:Sound and Graphic Design. Electronics in general.
@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

#20
flAked

flAked

    InsanelyMac Sage

  • Members
  • PipPipPipPipPipPip
  • 470 posts
  • Gender:Male
  • Location:internets
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.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

© 2014 InsanelyMac  |   News  |   Forum  |   Downloads  |   OSx86 Wiki  |   Mac Netbook  |   PHP hosting by CatN  |   Designed by Ed Gain  |   Logo by irfan  |   Privacy Policy