Contribute
Register

Lenovo U310 - Mavericks Upgrade [WIP]

Status
Not open for further replies.
Is your BIOS patched to unlock the MSRs? What did you have to do to enable xcpm on Ivy?

And I'd be interested in seeing your ioreg with xcpm working...

I don't know if it requires the SSDT. You could try without...

The 87 is weird.

The 'throttling' thing is coming from DirectHw which DPCIManager uses to read direct from the CPU registers.

Yes, PMPatch on the bios. Pike mentioned that XCPM supports Ivy Bridge processors. The only thing I did was add "-xcpm" boot flag (stab in the dark based off what I was reading in pike's blog, he didn't specify what the flag did but apparently it initiated it). Saved a copy of the IOreg because I was going to compare it to my IvyPM ioreg.

First thing I did was try to find out if XCPM was running to begin with, I looked at kextstat and saw the AICPUPM.kext was loaded but expected it not to be if XCPM was working. Then further, tried the commands that pike mentioned "sysctl machdep.xcpm.mode" and "sysctl machdep.xcpm.ratio_changes_total;" Quoting pike:
Running sysctl machdep.xcpm.mode shows us if XCPM is active and sysctl machdep.xcpm.ratio_changes_total shows us the number of ratio changes. Zero means that it XCPM isn’t functioning. In that case you should check the former MIB as well.
Code:
Cs-MacBook-Pro:~ c$ sysctl machdep.xcpm.mode
machdep.xcpm.mode: 0

Cs-MacBook-Pro:~ c$ sysctl machdep.xcpm.ratio_changes_total
machdep.xcpm.ratio_changes_total: 0

So that was enough to let me know that it wasn't loaded. So I gave the bootflag a shot. Rebooted and checked kextstat: AICPUPM.kext not loaded, good sign!
Those same two commands after booting with XCPM, and a third for more data.

Code:
Cs-MacBook-Pro:~ c$ sysctl machdep.xcpm.mode
machdep.xcpm.mode: 1

Cs-MacBook-Pro:~ c$ sysctl machdep.xcpm.ratio_changes_total
machdep.xcpm.ratio_changes_total: 51173

Cs-MacBook-Pro:~ c$ sysctl machdep.xcpm
machdep.xcpm.mode: 1
machdep.xcpm.asserts_enabled: 0
machdep.xcpm.asserts_traced: 0
machdep.xcpm.cpu_wakeup_energy_cost_selector: 0
machdep.xcpm.disable_quiesce: 0
machdep.xcpm.mp_match: 0
machdep.xcpm.disable_idle_self_select: 0
machdep.xcpm.mp_load_txfr_coeff: 128
machdep.xcpm.scalability_cpi_threshold: 4
machdep.xcpm.scalability_cpi_demotion_threshold: 5
machdep.xcpm.scalability_reeval_interval: 1000
machdep.xcpm.scalability_eval_ratio_min: 17
machdep.xcpm.scalability_detection_enabled: 0
machdep.xcpm.hard_plimit_max_100mhz_ratio: 31
machdep.xcpm.hard_plimit_min_100mhz_ratio: 8
machdep.xcpm.soft_plimit_max_100mhz_ratio: 31
machdep.xcpm.soft_plimit_min_100mhz_ratio: 8
machdep.xcpm.ratio_changes_hf: 0
machdep.xcpm.ratio_changes_lf: 2
machdep.xcpm.ratio_change_limited: 0
machdep.xcpm.ratio_change_hf_limit: 2
machdep.xcpm.ratio_change_lf_limit: 1
machdep.xcpm.ratio_change_ratelimit_ns: 500000
machdep.xcpm.ratio_changes_total: 504941
machdep.xcpm.maxbusdelay: 0
machdep.xcpm.maxintdelay: 0
machdep.xcpm.mbd_mode: 1
machdep.xcpm.mbd_applications: 0
machdep.xcpm.mbd_relaxations: 0
machdep.xcpm.forced_idle_ratio: 100
machdep.xcpm.forced_idle_period: 30000000
machdep.xcpm.deep_idle_log: 0
machdep.xcpm.qos_txfr: 1
machdep.xcpm.q_migration_ttd_min: 1000000
machdep.xcpm.q_migration_ttd_max: 100000000
machdep.xcpm.preidle_spin_tsc: 0
machdep.xcpm.qos_ratio_change_limited: 0
machdep.xcpm.qos_ratio_change_hf_limit: 8
machdep.xcpm.qos_ratio_change_lf_limit: 1
machdep.xcpm.qos_ratelimiting_enabled: 1
machdep.xcpm.quiesce_trace: 0
machdep.xcpm.deep_idle_count: 0
machdep.xcpm.deep_idle_last_stats: n/a
machdep.xcpm.deep_idle_total_stats: n/a

I would like to do some more testing on this but I don't really know what to look at (since I really don't know much about this stuff anyway)..

Anyway, the good news is that it just works :)
 
I don't know if it requires the SSDT. You could try without...

I did just that. I'm still seeing P States 8,14,17,20, 22,23,24,25,26,27,28,29; Problem is that X86PlatformPlugin.kext and X86PlatformShim.kext did not load. So CPU power management is working but iGPU power management is not? I'll try to figure out how to compile that kext so I can get more info..

Again, quoting Pike:

plugin-typeLet us go back to Ivy Bridge power management for a sec, which introduced a new property called plugin-type. Apple used a _DSM (Device Specific Method) in one of their ACPI tables to trigger additional plugins to load (X86PlatformPlugin.kext and X86PlatformShim.kext). And we still need to set this property, otherwise the plugins won’t load (matching will fail) and you end up seeing this error in system.log:


ACPI_SMC_PlatformPlugin::start – waitForService(resourceMatching(AppleIntelCPUPowerManagement) timed out


WARNING: IOPlatformPluginUtil : getCPUIDInfo: this is an unknown CPU model 0x3c — power management may be incomplete or unsupported

So that bit is in the _DSM on the SSDT. Hmmm..
 
I'll try to figure out how to compile that kext so I can get more info..
I've downloaded the source directory, there is no make file so I tried "xcodebuild" but it fails

I think I've figured out.. installing the kext now

Results (Custom SSDT, XCPM,MBA5,2):
AICPUPMI: CPU P-States [ 8 14 17 20 21 (22) 23 24 25 26 27 28 29 31 ] GPU P-States [ 24 ]
-----------
Well this is interesting....X86PlatformPlugin and X86PlatformShim aren't loaded. I didn't see any errors about it though.. IOReg attached
Results (Without SSDT, XCPM,MBA5,2)
AICPUPMI: CPU P-States [ (8) 14 17 20 21 22 23 24 25 26 27 28 29 31 ] GPU P-States [ 19 21 23 24 ]
 
I've downloaded the source directory, there is no make file so I tried "xcodebuild" but it fails :crazy:


I think I've figured out.. installing the kext now :D

Results (Custom SSDT, XCPM,MBA5,2):

AICPUPMI: Low Frequency Mode : 800 MHz

AICPUPMI: Clock Speed : 2500 MHz

AICPUPMI: Max Turbo Frequency: 3100 MHz
AICPUPMI: IGPU Current Freq..: 350 MHz
AICPUPMI: IGPU Max Frequency.: 350 MHz
AICPUPMI: IGPU Max Turbo Freq: 1200 MHz
AICPUPMI: CPU P-States [ (8) ] GPU P-States [ ]
AICPUPMI: CPU P-States [ 8 (17) ] GPU P-States [ ]
AICPUPMI: CPU P-States [ 8 17 (29) ] GPU P-States [ ]
AICPUPMI: CPU P-States [ 8 (14) 17 29 ] GPU P-States [ ]
AICPUPMI: CPU P-States [ 8 14 17 (23) 29 ] GPU P-States [ ]
AICPUPMI: CPU P-States [ 8 14 17 23 (28) 29 ] GPU P-States [ ]
AICPUPMI: CPU P-States [ 8 14 17 23 (27) 28 29 ] GPU P-States [ ]
AICPUPMI: CPU P-States [ 8 14 17 23 (26) 27 28 29 ] GPU P-States [ ]
AICPUPMI: CPU P-States [ 8 14 17 23 (24) 26 27 28 29 ] GPU P-States [ ]
AICPUPMI: CPU P-States [ 8 14 17 (21) 23 24 26 27 28 29 ] GPU P-States [ ]
AICPUPMI: CPU P-States [ 8 14 17 (20) 21 23 24 26 27 28 29 ] GPU P-States [ ]
AICPUPMI: CPU P-States [ 8 14 17 20 21 23 24 (25) 26 27 28 29 ] GPU P-States [ ]
AICPUPMI: CPU P-States [ 8 14 17 20 21 23 24 25 26 27 28 29 (31) ] GPU P-States [ ]
AICPUPMI: CPU P-States [ 8 (14) 17 20 21 23 24 25 26 27 28 29 31 ] GPU P-States [ (24) ]
AICPUPMI: CPU P-States [ 8 14 17 20 21 (22) 23 24 25 26 27 28 29 31 ] GPU P-States [ 24 ]

Well this is interesting....
Results (Without SSDT, XCPM,MBA5,2)


AICPUPMI: Low Frequency Mode : 800 MHz
AICPUPMI: Clock Speed : 2500 MHz
AICPUPMI: Max Turbo Frequency: 3100 MHz
AICPUPMI: IGPU Current Freq..: 350 MHz
AICPUPMI: IGPU Max Frequency.: 350 MHz
AICPUPMI: IGPU Max Turbo Freq: 1200 MHz
AICPUPMI: CPU P-States [ (8) 14 17 20 23 25 27 29 ] GPU P-States [ (24) ]
AICPUPMI: CPU P-States [ 8 14 (17) 20 23 25 27 29 ] GPU P-States [ (21) 24 ]
AICPUPMI: CPU P-States [ 8 14 17 20 23 25 27 29 (31) ] GPU P-States [ 21 24 ]
AICPUPMI: CPU P-States [ 8 14 17 20 (21) 23 25 27 29 31 ] GPU P-States [ (21) 24 ]
AICPUPMI: CPU P-States [ (8) 14 17 20 21 23 25 27 29 31 ] GPU P-States [ 21 (23) 24 ]
AICPUPMI: CPU P-States [ 8 14 17 20 21 (22) 23 25 27 29 31 ] GPU P-States [ 21 23 24 ]
AICPUPMI: CPU P-States [ 8 14 17 20 21 22 23 (24) 25 27 29 31 ] GPU P-States [ 21 23 24 ]
AICPUPMI: CPU P-States [ 8 14 17 20 21 22 23 24 25 (26) 27 29 31 ] GPU P-States [ 21 23 24 ]
AICPUPMI: CPU P-States [ 8 14 17 20 21 22 23 24 25 26 27 (28) 29 31 ] GPU P-States [ 21 23 24 ]
AICPUPMI: CPU P-States [ 8 14 17 20 21 22 23 24 (25) 26 27 28 29 31 ] GPU P-States [ 21 23 24 ]
AICPUPMI: CPU P-States [ 8 (14) 17 20 21 22 23 24 25 26 27 28 29 31 ] GPU P-States [ (19) 21 23 24 ]
AICPUPMI: CPU P-States [ 8 14 17 (20) 21 22 23 24 25 26 27 28 29 31 ] GPU P-States [ 19 21 23 24 ]
AICPUPMI: CPU P-States [ 8 14 (17) 20 21 22 23 24 25 26 27 28 29 31 ] GPU P-States [ 19 21 23 24 ]
AICPUPMI: CPU P-States [ 8 (14) 17 20 21 22 23 24 25 26 27 28 29 31 ] GPU P-States [ 19 21 23 24 ]
AICPUPMI: CPU P-States [ 8 14 17 (20) 21 22 23 24 25 26 27 28 29 31 ] GPU P-States [ 19 21 23 24 ]
AICPUPMI: CPU P-States [ (8) 14 17 20 21 22 23 24 25 26 27 28 29 31 ] GPU P-States [ 19 21 23 24 ]


X86PlatformPlugin and X86PlatformShim aren't loaded. I haven't seen any errors about it though..
IOReg attached

What is all this you are trying to accomplish? Should I be messing around with my SSDT? All I did was use one generated by the pro book installer..
 
What is all this you are trying to accomplish? Should I be messing around with my SSDT? All I did was use one generated by the pro book installer..

Can't you tell I am trying to flood this thread!? lol I am just checking out the new power management, its moved into the kernel (presumably for Haswell) but it is compatible with Ivy as well.. Its called XNU CPU Power Management (XCPM). It's already in our kernel, but we aren't using it; if you're curious, some light reading on the subject

http://pikeralpha.wordpress.com/2013/10/05/xnu-cpu-power-management/
 
X86PlatformPlugin and X86PlatformShim aren't loaded. I haven't seen any errors about it though..
IOReg attached

That is kind of interesting... Seems like GPU PM without SSDT/without plugin-type injection. But on my MacBookAir6,2 (Haswell, using xcpm) x86platformplugin is loaded against CPU object.

This could come down to the plists in x86platformplugin.kext/Contents/Resources. Is there one there that matches the board-id in your smbios.plist? (obviously only used if you're injecting plugin-type).

Oh... FYI... My MacBookAir6,2 does have all the APSN/APSS objects in its SSDT...
 
That is kind of interesting... Seems like GPU PM without SSDT/without plugin-type injection. But on my MacBookAir6,2 (Haswell, using xcpm) x86platformplugin is loaded against CPU object.

This could come down to the plists in x86platformplugin.kext/Contents/Resources. Is there one there that matches the board-id in your smbios.plist? (obviously only used if you're injecting plugin-type).

Oh... FYI... My MacBookAir6,2 does have all the APSN/APSS objects in its SSDT...

I'm using Mac-2E6FAB96566FE58C for board product, a matching plist is present. The only "injection" was from the SSDT with _DSM to CPU0

Code:
Method (_DSM, 4, NotSerialized)  // _DSM: Device-Specific Method
        {
            If (LEqual (Arg2, Zero))
            {
                Return (Buffer (One)
                {
                     0x03
                })
            }


            Return (Package (0x02)
            {
                "plugin-type", 
                One
            })
        }

That is what triggers them to load, from the SSDT. I think Haswell might not need that part?
Would it be possible to make sort of a mini SSDT with only the _DSM? Could it somehow go in the DSDT? (wishful thinking)
 
I'm using Mac-2E6FAB96566FE58C for board product, a matching plist is present. The only "injection" was from the SSDT with _DSM to CPU0

Code:
Method (_DSM, 4, NotSerialized)  // _DSM: Device-Specific Method
        {
            If (LEqual (Arg2, Zero))
            {
                Return (Buffer (One)
                {
                     0x03
                })
            }


            Return (Package (0x02)
            {
                "plugin-type", 
                One
            })
        }

That is what triggers them to load, from the SSDT. I think Haswell might not need that part?
Would it be possible to make sort of a mini SSDT with only the _DSM? Could it somehow go in the DSDT? (wishful thinking)

SSDT *is* a mini SSDT...

And yes you could place it in DSDT. But like I said, Apple's SSDT's do have APSN/APSS...
 

Attachments

  • Jan’s MacBook Air.zip
    351.2 KB · Views: 62
Status
Not open for further replies.
Back
Top