apianti Posted August 3, 2017 Share Posted August 3, 2017 This will be applied to a system which >= 10.8.5 && <= 10.12.5, right? I mean, 83 c3 c4 83 fb 22 is only there on 10.12.0 - 10.12.5, so earlier versions of OS X like 10.11 will still stay in the lack of XCPM. (Cuz not patched) Entry->KernelAndKextPatches->FakeCPUID = (UINT32)(0x0306A0); // correct FakeCPUID KernelCPUIDPatch((UINT8*)KernelData, Entry); More catastrophically. This will trigger AICPUPM loading (due to this Ivy Bridge CPU ID), and Haswell+ Celeron/Pentium is not supported by AICPUPM, which will lead to AICPUPM KP. So... On <= 10.11 systems there will be a KP with this code I guess. Oh, I misunderstood you. Is there even a known patch for this? This patch came out for 10.11.6, which is pretty much the beginning of 10.12, so it has that sequence. Did you actually check < 10.11.6? OK! Yes I want to add more changes. I will commit more change and add xcpm for 10.10.x and 10.11.x as well. I need some test once I finish. Anyway, your idea is good, and I will try to give it more improvement! Have a nice day, syscl Yes, I was thinking of adding -xcpm for 10.10.x-10.11.x, and at the first, we need to commit the first change. Then we can do the following change(e.g. -xcpm enforce for Haswell+ Celeron/Pentium...) Thank you, syscl I committed your last changes already to revision 4134. What is your sourceforge username and I will add you to the dev team for the repo. 2 Link to comment Share on other sites More sharing options...
PMheart Posted August 3, 2017 Share Posted August 3, 2017 Oh, I misunderstood you. Is there even a known patch for this? This patch came out for 10.11.6, which is pretty much the beginning of 10.12, so it has that sequence. Did you actually check < 10.11.6? Well, this became popular because Apple removed -xcpm support as of 10.12 and at that time Pike found some helpful patches. As for 10.8.5+ && 10.11- I think the best way is adding -xcpm kernel flag instead of patching something. There will be for sure some similar patches, but I'm just too lazy to find that out. (And also lack of disassembly environment for the time being...) By the way, could you please commit my new kernel_patcher.c to prevent KP on 10.11- systems if the code looks good? Thanks in advance. Link to comment Share on other sites More sharing options...
syscl Posted August 3, 2017 Share Posted August 3, 2017 With your code I guess there will be a KP on 10.8.5 - 10.11.x due to AICPUPM unsupported and XCPM not enabled/patched. So for now should we change something like: (See attachment below) kernel_patcher.c.zip 10.11- is supported and 10.10 is supported w/o _bootstrap patch. I've posted a guide about that very long time ago. Difference is we need to applied -xcpm for 10.11- manually. We can do it by passing the argument "-xcpm" while we detect Haswell+ Celeron/Pentium on 10.11-. On 10.12.x and newer, we need _bootstrap patches to stop kernel panics. FYI, I've tested Clover r4134 on my MSI H87m-G41 + Celeron G1840(Haswell Refresh) flawlessly. I will test 10.10 and older version once I download the old image. Thank you, syscl Oh, I misunderstood you. Is there even a known patch for this? This patch came out for 10.11.6, which is pretty much the beginning of 10.12, so it has that sequence. Did you actually check < 10.11.6? I committed your last changes already to revision 4134. What is your sourceforge username and I will add you to the dev team for the repo. As for 10.10-10.11, no need _bootstrap patches, only FakeCPUID and -xcpm is enough. That's why I am sure to make that change and put FakeCPUID at the beginning of KernelHSWLowEndPatch(...). On 10.12.x and later we need _bootstrap and _xcpm_idle patches to stop kernel panics on Haswell+ Celeron/Pentium. My username is syscl on sourceforge Thank you, syscl 2 Link to comment Share on other sites More sharing options...
PMheart Posted August 3, 2017 Share Posted August 3, 2017 10.11- is supported and 10.10 is supported w/o _bootstrap patch. I've posted a guide about that very long time ago. Difference is we need to applied -xcpm for 10.11- manually. We can do it by passing the argument "-xcpm" while we detect Haswell+ Celeron/Pentium on 10.11-. On 10.12.x and newer, we need _bootstrap patches to stop kernel panics. FYI, I've tested Clover r4134 on my MSI H87m-G41 + Celeron G1840(Haswell Refresh) flawlessly. I will test 10.10 and older version once I download the old image. Thank you, syscl Hmm, well, will there be a KP w/o XCPM but with AICPUPM? (AICPUPM is invoked by FakeCPUID = 0x306A0) If so, on 10.11- your code may lead to a KP, because FakeCPUID = 0x306A0 has been set, and AICPUPM loads on unsupported Haswell Pentium/Celeron. (-xcpm not set, therefore no XCPM support but AICPUPM, and it is unsupported, then a KP occurs) Please try booting 10.11 with Clover 4134, without -xcpm flag. In case a KP really happens... Link to comment Share on other sites More sharing options...
Sherlocks Posted August 3, 2017 Share Posted August 3, 2017 10.11- is supported and 10.10 is supported w/o _bootstrap patch. I've posted a guide about that very long time ago. Difference is we need to applied -xcpm for 10.11- manually. We can do it by passing the argument "-xcpm" while we detect Haswell+ Celeron/Pentium on 10.11-. On 10.12.x and newer, we need _bootstrap patches to stop kernel panics. FYI, I've tested Clover r4134 on my MSI H87m-G41 + Celeron G1840(Haswell Refresh) flawlessly. I will test 10.10 and older version once I download the old image. Thank you, syscl your are right. 10.11 and older FakeCPUID 0x0306A0 bootarg "-xcpm" kernel pm(if hasn't msr patch in bios) 10.12 and newer FakeCPUID 0x0306A0 _bootstrap C6 _cpuid_set_info_rdmsr kernel pm(if hasn't msr patch in bios) actually i don't need MSR 0xE2 _xcpm_idle instant reboot on my skylake pentium. but i think that want to use hwp, maybe need it. sorry my english. 2 Link to comment Share on other sites More sharing options...
syscl Posted August 3, 2017 Share Posted August 3, 2017 your are right. 10.11 and older FakeCPUID 0x0306A0 bootarg "-xcpm" kernel pm(if hasn't msr patch in bios) 10.12 and newer FakeCPUID 0x0306A0 _bootstrap C6 _cpuid_set_info_rdmsr kernel pm(if hasn't msr patch in bios) actually i don't need MSR 0xE2 _xcpm_idle instant reboot on my skylake pentium. but i think that want to use hwp, maybe need it. sorry my english. Oh Sherlocks, nice. I forget to consider MSR 0xE2 lock for those motherboards that haven't been unlocked yet because I've already unlocked MSR 0xE2 lock. So, later on I will add a detection to check if MSR 0xE2 patch is required or not once @apianti gives the permission on sourceforge. Thank you! syscl Hmm, well, will there be a KP w/o XCPM but with AICPUPM? (AICPUPM is invoked by FakeCPUID = 0x306A0) If so, on 10.11- your code may lead to a KP, because FakeCPUID = 0x306A0 has been set, and AICPUPM loads on unsupported Haswell Pentium/Celeron. (-xcpm not set, therefore no XCPM support but AICPUPM, and it is unsupported, then a KP occurs) Please try booting 10.11 with Clover 4134, without -xcpm flag. In case a KP really happens... Without -xcpm, I still can boot into system and enjoy the old style power management. syscl 2 Link to comment Share on other sites More sharing options...
Sherlocks Posted August 3, 2017 Share Posted August 3, 2017 10.11- is supported and 10.10 is supported w/o _bootstrap patch. I've posted a guide about that very long time ago. Difference is we need to applied -xcpm for 10.11- manually. We can do it by passing the argument "-xcpm" while we detect Haswell+ Celeron/Pentium on 10.11-. On 10.12.x and newer, we need _bootstrap patches to stop kernel panics. FYI, I've tested Clover r4134 on my MSI H87m-G41 + Celeron G1840(Haswell Refresh) flawlessly. I will test 10.10 and older version once I download the old image. Thank you, syscl As for 10.10-10.11, no need _bootstrap patches, only FakeCPUID and -xcpm is enough. That's why I am sure to make that change and put FakeCPUID at the beginning of KernelHSWLowEndPatch(...). On 10.12.x and later we need _bootstrap and _xcpm_idle patches to stop kernel panics on Haswell+ Celeron/Pentium. My username is syscl on sourceforge Thank you, syscl just question and discussion. no need to reflect this think. Have you ever booted skylake cpuid? Now most of the Pentium systems are booting Ivy Bridge tricked into cpuid I want to boot using skylake cpuid on skylake pentium. Because it is my parents system, it is impossible to test immediately. Is it theoretically possible? EDIT. your cpu haswell refresh.. hmm. i will research what i mentioned EDIT1. Ofc. What use ivy cpuid can support more osx(old and new) thanks in advance Link to comment Share on other sites More sharing options...
PMheart Posted August 3, 2017 Share Posted August 3, 2017 Without -xcpm, I still can boot into system and enjoy the old style power management. syscl Oops. Alright, sorry then. Well, AICPUPM will lead to a KP on @p.H's Skylake Pentium CPU... He had to use NullCPUPM.kext to prevent this. So I assumed this would happen on all platforms before. Sorry again, PMheart Link to comment Share on other sites More sharing options...
syscl Posted August 3, 2017 Share Posted August 3, 2017 Oops. Alright, sorry then. Well, AICPUPM will lead to a KP on @p.H's Skylake Pentium CPU... He had to use NullCPUPM.kext to prevent this. So I assumed this would happen on all platforms before. Sorry again, PMheart Not a problem, discussion helps things better. I don't have Skylake Pentium/Celeron, I need @Sherlocks and other people who own Skylake Pentium/Celeron to report if this work or not. syscl 1 Link to comment Share on other sites More sharing options...
PMheart Posted August 3, 2017 Share Posted August 3, 2017 just question and discussion. no need to reflect this think. Have you ever booted skylake cpuid? Now most of the Pentium systems are booting Ivy Bridge tricked into cpuid I want to boot using skylake cpuid on skylake pentium. Because it is my parents system, it is impossible to test immediately. Is it theoretically possible? EDIT. your cpu haswell refresh.. hmm. i will research what i mentioned thanks in advance If I remember correctly you have to use Ivy Bridge CPUID on Haswell+ Pentium/Celeron due to some reasons which I've forgotten unfortunately. Otherwise there will be a panic. So you have to use syscl's way (Fake as Ivy Bridge and add XCPM support for IVB) Link to comment Share on other sites More sharing options...
apianti Posted August 3, 2017 Share Posted August 3, 2017 @syscl, I gave you permission, just try not to break anything... lol MSR 0xE2 patch is already detected somewhere, you can see it in the boot.log. You can make these changes that are being discussed... @PMheart, The patch won't be applied if it's not found so there's no problem there, since you need to fakeid the cpu anyway. Maybe the best approach would be to add another if before the test for <= 10.12.5, a test for < 10.11.6 and just add the "-xcpm" argument instead of finding the patch. However then the entire remaining part of the _xcpm_bootstrap patch would need to go in the else to prevent accidental patch when not needed. I assume the other patches after would still be needed? 1 Link to comment Share on other sites More sharing options...
syscl Posted August 3, 2017 Share Posted August 3, 2017 just question and discussion. no need to reflect this think. Have you ever booted skylake cpuid? Now most of the Pentium systems are booting Ivy Bridge tricked into cpuid I want to boot using skylake cpuid on skylake pentium. Because it is my parents system, it is impossible to test immediately. Is it theoretically possible? EDIT. your cpu haswell refresh.. hmm. i will research what i mentioned thanks in advance Skylake and later low-end should be supported, notice here BOOLEAN apply_idle_patch = gCPUStructure.Model >= CPU_MODEL_SKYLAKE_U ? TRUE : FALSE; this line check if we need _xcpm_idle patch as well. But I don't have Skylake low-end, so I need people to report. No need to rush, I wait for your report syscl 1 Link to comment Share on other sites More sharing options...
Sherlocks Posted August 3, 2017 Share Posted August 3, 2017 Not a problem, discussion helps things better. I don't have Skylake Pentium/Celeron, I need @Sherlocks and other people who own Skylake Pentium/Celeron to report if this work or not. syscl Okay i will test and help you.Thank you If I remember correctly you have to use Ivy Bridge CPUID on Haswell+ Pentium/Celeron due to some reasons which I've forgotten unfortunately. Otherwise there will be a panic. So you have to use syscl's way (Fake as Ivy Bridge and add XCPM support for IVB)Yes. Fake as ivy bridge cpuid is better for more osx and best choice.I just want to test that works or not to use native id and know result. 나의 LG-F800S 의 Tapatalk에서 보냄 1 Link to comment Share on other sites More sharing options...
PMheart Posted August 3, 2017 Share Posted August 3, 2017 @PMheart, The patch won't be applied if it's not found so there's no problem there, since you need to fakeid the cpu anyway. Maybe the best approach would be to add another if before the test for < 10.12.5, a test for < 10.11.6 and just add the "-xcpm" argument instead of finding the patch. However then the entire remaining part of the _xcpm_bootstrap patch would need to go in the else to prevent accidental patch when not needed. I assume the other patches after would still be needed? Hi. Nope. For example, @p.H's hack... There will be a KP on his case if FakeCPUID has been set and lack of XCPM, unlike syscl's, he could also enjoy the old AICPUPM on his Haswell Pentium/Celeron. For >= 10.12.0 and <= 10.12.5, syscl's code looks good. There will be no problem. For < 10.11.6, syscl confirmed FakeCPUID (IVB one) + -xcpm works well. (Skylake may need _xcpm_idle patch on 10.11.1+, and syscl's code helps us, on even earlier, no Skylake support...) The next problem could be MSR 0xE2 lock, KernelPm should be our friend then. (So if it's locked, then turning on KernelPm automatically would be another improvement) 1 Link to comment Share on other sites More sharing options...
apianti Posted August 3, 2017 Share Posted August 3, 2017 Hi. Nope. For example, @p.H's hack... There will be a KP on his case if FakeCPUID has been set and lack of XCPM, unlike syscl's, he could also enjoy the old AICPUPM on his Haswell Pentium/Celeron. For >= 10.12.0 and <= 10.12.5, syscl's code looks good. There will be no problem. For < 10.11.6, syscl confirmed FakeCPUID (IVB one) + -xcpm works well. (Skylake may need _xcpm_idle patch on 10.11.1+, and syscl's code helps us, on even earlier, no Skylake support...) The next problem could be MSR 0xE2 lock, KernelPm should be our friend then. (So if it's locked, then turning on KernelPm automatically would be another improvement) Did you just disagree with me and say the same thing?? lmao EDIT: Also AFAIK there already is a MSR 0xE2 lock check that enables KernelPm patch... If not then it's weird to print in the log that it is being enabled because locked MSR 0xE2. 1 Link to comment Share on other sites More sharing options...
TheRacerMaster Posted August 3, 2017 Share Posted August 3, 2017 EDIT: Also AFAIK there already is a MSR 0xE2 lock check that enables KernelPm patch... If not then it's weird to print in the log that it is being enabled because locked MSR 0xE2. Yeah, this behavior is already present in Clover: if (msr & 0x8000) { MsgLog("MSR 0xE2 is locked, PM patches will be turned on\n"); NeedPMfix = TRUE; } (This is on line 494 of cpu.c). 1 Link to comment Share on other sites More sharing options...
Sherlocks Posted August 3, 2017 Share Posted August 3, 2017 Did you just disagree with me and say the same thing?? lmao EDIT: Also AFAIK there already is a MSR 0xE2 lock check that enables KernelPm patch... If not then it's weird to print in the log that it is being enabled because locked MSR 0xE2. Actually need to check KernelPM(vanilla bios of laptop, no patch 0xE2)If uncheck KernelPM, stop with aptiofix message. 나의 LG-F800S 의 Tapatalk에서 보냄 Link to comment Share on other sites More sharing options...
Slice Posted August 3, 2017 Share Posted August 3, 2017 Automatically applying HWP speedshift for Skylake and newer process © syscl Sorry? I want disable HWP for my Skylake. Link to comment Share on other sites More sharing options...
syscl Posted August 3, 2017 Share Posted August 3, 2017 Sorry? I want disable HWP for my Skylake. Oh, what's wrong with HWP on Skylake? I mean by applying the _xcpm_idle patch, people can enable HWP as they want on Skylake+ Celeron/Pentium. I was saying to fast that I miss telling some points. On Skylake+ Celeron/Pentium on r4134: Without HWPEnable=True, CPU still use -xcpm without speedshift With HWPEnable=True, CPU use speedshift People still need HWPEnable argument if they want speedshift. But I don't have any Skylake+ low-end process to test if this is correct or not. Still waiting for report syscl 1 Link to comment Share on other sites More sharing options...
PMheart Posted August 4, 2017 Share Posted August 4, 2017 Did you just disagree with me and say the same thing?? lmao EDIT: Also AFAIK there already is a MSR 0xE2 lock check that enables KernelPm patch... If not then it's weird to print in the log that it is being enabled because locked MSR 0xE2. I see. Great. Thanks for the information. But it seems that @Sherlocks reports that that's not working? Oh, what's wrong with HWP on Skylake? I mean by applying the _xcpm_idle patch, people can enable HWP as they want on Skylake+ Celeron/Pentium. I was saying to fast that I miss telling some points. On Skylake+ Celeron/Pentium on r4134: Without HWPEnable=True, CPU still use -xcpm without speedshift With HWPEnable=True, CPU use speedshift People still need HWPEnable argument if they want speedshift. But I don't have any Skylake+ low-end process to test if this is correct or not. Still waiting for report syscl Why isn't _xcpm_hwp_enable() from XNU our buddy but relying on HWPEnable? I guess, if FrequnecyVectors indicates HWP enabled (0x01), then _xcpm_hwp_enable() will be called, it will write relevant MSRs to enable HWP. (write/read 0x1aa and write 0x770) But this will only happen on MacBook9+ and MacBookPro13+, since only these models have hwp = 0x1 in their FrequnecyVectors. There were some old discussions (http://www.insanelymac.com/forum/topic/284656-clover-general-discussion/page-673?do=findComment&comment=2448402), also check contexts, as @RehabMan said, there could be some negative effects on iMac and therefore Apple didn't tend to enable HWP on desktops but only on laptops due to energy efficiency reasons I guess. Link to comment Share on other sites More sharing options...
Sherlocks Posted August 4, 2017 Share Posted August 4, 2017 I see. Great. Thanks for the information. But it seems that @Sherlocks reports that that's not working? Why isn't _xcpm_hwp_enable() from XNU our buddy but relying on HWPEnable? I guess, if FrequnecyVectors indicates HWP enabled (0x01), then _xcpm_hwp_enable() will be called, it will write relevant MSRs to enable HWP. (write/read 0x1aa and write 0x770) But this will only happen on MacBook9+ and MacBookPro13+, since only these models have hwp = 0x1 in their FrequnecyVectors. There were some old discussions (http://www.insanelymac.com/forum/topic/284656-clover-general-discussion/page-673?do=findComment&comment=2448402), also check contexts, as @RehabMan said, there could be some negative effects on iMac and therefore Apple didn't tend to enable HWP on desktops but only on laptops due to energy efficiency reasons I guess. Yes not working if uncheck KernelPm.Should be check KernelPM 나의 LG-F800S 의 Tapatalk에서 보냄 Link to comment Share on other sites More sharing options...
Loloflat6 Posted August 4, 2017 Share Posted August 4, 2017 I 'm reading those last replies because i have a buid with Celeron G1840 : So i'm particulary interest : Generaly as reported Sherlocks : i must set : 10.11 and older FakeCPUID 0x0306A0 bootarg "-xcpm" kernel pm(if hasn't msr patch in bios) 10.12 and newer FakeCPUID 0x0306A0 _bootstrap C6 _cpuid_set_info_rdmsr kernel pm(if hasn't msr patch in bios) - before Sierra the boot arg -xcpm was requiried to boot - but recently i "reinstalled" ML 10.8.5 : i was able to boot without this boot arg (strange ) - i "reinstalled" Maverick 10.9.5 : unable to boot with this boot arg ( ok) The last version of Clover i used is 4104 If some test on my build could help you , i would try. (Sorry for my english) Link to comment Share on other sites More sharing options...
HmO Posted August 4, 2017 Share Posted August 4, 2017 I 'm reading those last replies because i have a buid with Celeron G1840 : So i'm particulary interest : Generaly as reported Sherlocks : i must set : 10.11 and older FakeCPUID 0x0306A0 bootarg "-xcpm" kernel pm(if hasn't msr patch in bios) 10.12 and newer FakeCPUID 0x0306A0 _bootstrap C6 _cpuid_set_info_rdmsr kernel pm(if hasn't msr patch in bios) - before Sierra the boot arg -xcpm was requiried to boot - but recently i reinstalled ML 10.8.5 : i was able to boot without this boot arg (strange ) - i resinstalled Maverick 10.9.5 : unable to boot with this boot arg ( ok) The last version of Clover i used is 4104 If some test on my build could help you , i would try. (Sorry for my english) Latest clover is 4136 1 Link to comment Share on other sites More sharing options...
syscl Posted August 4, 2017 Share Posted August 4, 2017 I 'm reading those last replies because i have a buid with Celeron G1840 : So i'm particulary interest : Generaly as reported Sherlocks : i must set : 10.11 and older FakeCPUID 0x0306A0 bootarg "-xcpm" kernel pm(if hasn't msr patch in bios) 10.12 and newer FakeCPUID 0x0306A0 _bootstrap C6 _cpuid_set_info_rdmsr kernel pm(if hasn't msr patch in bios) - before Sierra the boot arg -xcpm was requiried to boot - but recently i "reinstalled" ML 10.8.5 : i was able to boot without this boot arg (strange ) - i "reinstalled" Maverick 10.9.5 : unable to boot with this boot arg ( ok) The last version of Clover i used is 4104 If some test on my build could help you , i would try. (Sorry for my english) Please try the following Clover(r4136) without any Celeron patches and without "-xcpm" argument. r4136.zip Wait for your report. syscl 2 Link to comment Share on other sites More sharing options...
Loloflat6 Posted August 4, 2017 Share Posted August 4, 2017 Please try the following Clover(r4136) without any Celeron patches and without "-xcpm" argument. r4136.zip Wait for your report. syscl Ok thanks will try this evening 1 Link to comment Share on other sites More sharing options...
Recommended Posts