vector sigma Posted June 23, 2019 Share Posted June 23, 2019 Just now, Sherlocks said: right. seems to check kernelandkextpatch debug option and confirm patch is working I have to find a way to read the panic since it happens fast with a tedious kext's names logging that keeps all the screen without let me see the reason of the fault. But I suspect it's still regarding a locked msrs.. or at least it seems. Link to comment https://www.insanelymac.com/forum/topic/284656-clover-general-discussion/page/767/#findComment-2679013 Share on other sites More sharing options...
joevt Posted June 24, 2019 Share Posted June 24, 2019 2 hours ago, vector sigma said: I have to find a way to read the panic since it happens fast with a tedious kext's names logging that keeps all the screen without let me see the reason of the fault. But I suspect it's still regarding a locked msrs.. or at least it seems. serial or firewire kprintf? 1 Link to comment https://www.insanelymac.com/forum/topic/284656-clover-general-discussion/page/767/#findComment-2679018 Share on other sites More sharing options...
PMheart Posted June 24, 2019 Share Posted June 24, 2019 3 hours ago, vector sigma said: I have to find a way to read the panic since it happens fast with a tedious kext's names logging that keeps all the screen without let me see the reason of the fault. But I suspect it's still regarding a locked msrs.. or at least it seems. @joevt is correct, and I hope we have a workaround to this: (Apply the patch via Clover KernelToPatch) https://github.com/acidanthera/OcSupportPkg/blob/3223115d876632f13408f64c182046dc1badd785/Library/OcAppleKernelLib/CommonPatches.c#L948-L958 Credit to @vit9696. 2 Link to comment https://www.insanelymac.com/forum/topic/284656-clover-general-discussion/page/767/#findComment-2679023 Share on other sites More sharing options...
Matgen84 Posted June 24, 2019 Share Posted June 24, 2019 5 hours ago, vector sigma said: It's clearly a bug, already solved in Xcode 10 last year. Not sure we need a solution, which I eventually have (I have a tiny command line for that in the hwsensor project), or just wait for a better Xcode 11 that will fix the bug as already was with predecessor. Anyway I din't try it my self as I installed Catalina only few hours ago, but I will soon. Right, not sure we need a solution. Missing Clover Logo occurs in Mojave/ Xcode 10 and Catalina/ Xcode 11 into my config. It's the same with release from Repo. Link to comment https://www.insanelymac.com/forum/topic/284656-clover-general-discussion/page/767/#findComment-2679027 Share on other sites More sharing options...
Slice Posted June 24, 2019 Share Posted June 24, 2019 9 hours ago, vector sigma said: To be clear I've already checked the kernel and the below code seems to at least patch all occurrences as it is programmed for: BOOLEAN KernelIvyBridgeXCPM(VOID *kernelData, LOADER_ENTRY *Entry, BOOLEAN use_xcpm_idle) { UINT8 *kern = (UINT8*)kernelData; CHAR8 *comment; UINT32 i; UINT32 patchLocation; UINT64 os_version = AsciiOSVersionToUint64(Entry->OSVersion); // check whether Ivy Bridge if (gCPUStructure.Model != CPU_MODEL_IVY_BRIDGE) { DBG("Unsupported platform.\nRequires Ivy Bridge, aborted\n"); DBG("KernelIvyBridgeXCPM() <===FALSE\n"); return FALSE; } // check OS version suit for patches // PMheart: attempt to add 10.14 compatibility if (os_version < AsciiOSVersionToUint64("10.8.5") || os_version >= AsciiOSVersionToUint64("10.15")) { DBG("Unsupported macOS.\nIvy Bridge XCPM requires macOS 10.8.5 - 10.13.x, aborted\n"); DBG("KernelIvyBridgeXCPM() <===FALSE\n"); return FALSE; } else if (os_version >= AsciiOSVersionToUint64("10.8.5") && os_version < AsciiOSVersionToUint64("10.12")) { // 10.8.5 - 10.11.x no need the following kernel patches on Ivy Bridge - we just use -xcpm boot-args DBG("KernelIvyBridgeXCPM() <===\n"); return TRUE; } DBG("Searching _xcpm_pkg_scope_msr ...\n"); if (os_version >= AsciiOSVersionToUint64("10.12")) { // 10.12+ patchLocation = 0; // clean out the value just in case for (i = 0; i < 0x1000000; i++) { if (kern[i+0] == 0xBE && kern[i+1] == 0x07 && kern[i+2] == 0x00 && kern[i+3] == 0x00 && kern[i+4] == 0x00 && kern[i+5] == 0x31 && kern[i+6] == 0xD2 && kern[i+7] == 0xE8) { patchLocation = i+7; DBG("Found _xcpm_pkg_scope_msr\n"); break; } } if (patchLocation) { for (i = 0; i < 5; i++) { kern[patchLocation+i] = 0x90; } DBG("Applied _xcpm_pkg_scope_msr patch\n"); } else { DBG("_xcpm_pkg_scope_msr not found, patch aborted\n"); DBG("KernelIvyBridgeXCPM() <===FALSE\n"); return FALSE; } } comment = "_xcpm_bootstrap"; if (os_version <= AsciiOSVersionToUint64("10.12.5")) { // 10.12 - 10.12.5 STATIC UINT8 find[] = { 0x83, 0xC3, 0xC4, 0x83, 0xFB, 0x22 }; STATIC UINT8 repl[] = { 0x83, 0xC3, 0xC6, 0x83, 0xFB, 0x22 }; applyKernPatch(kern, find, sizeof(find), repl, comment); } else if (os_version < AsciiOSVersionToUint64("10.13")) { // 10.12.6 STATIC UINT8 find[] = { 0x8D, 0x43, 0xC4, 0x83, 0xF8, 0x22 }; STATIC UINT8 repl[] = { 0x8D, 0x43, 0xC6, 0x83, 0xF8, 0x22 }; applyKernPatch(kern, find, sizeof(find), repl, comment); // PMheart: attempt to add 10.14 compatibility } else if (os_version < AsciiOSVersionToUint64("10.15")) { // 10.13/10.14 STATIC UINT8 find[] = { 0x89, 0xD8, 0x04, 0xC4, 0x3C, 0x22 }; STATIC UINT8 repl[] = { 0x89, 0xD8, 0x04, 0xC6, 0x3C, 0x22 }; applyKernPatch(kern, find, sizeof(find), repl, comment); // PMheart: attempt to add 10.15 compatibility } else if (os_version < AsciiOSVersionToUint64("10.16")) { STATIC UINT8 find[] = { 0x8D, 0x43, 0xC4, 0x3C, 0x22 }; STATIC UINT8 repl[] = { 0x8D, 0x43, 0xC6, 0x3C, 0x22 }; applyKernPatch(kern, find, sizeof(find), repl, comment); } uless my cpu isn't involved, but should since is it a Core i5 3210M if I correctly understood the code. I didn't check in 10.14+ but it is working in 10.13 with my i5-3320M. Link to comment https://www.insanelymac.com/forum/topic/284656-clover-general-discussion/page/767/#findComment-2679045 Share on other sites More sharing options...
gujiangjiang Posted June 24, 2019 Share Posted June 24, 2019 When update to latest Clover it show an error or bug? EFI or EF? It shows "EF" in XPS 15 But in my anther laptop it shows well "EFI". Link to comment https://www.insanelymac.com/forum/topic/284656-clover-general-discussion/page/767/#findComment-2679069 Share on other sites More sharing options...
Sherlocks Posted June 24, 2019 Share Posted June 24, 2019 7 minutes ago, gujiangjiang said: When update to latest Clover it show an error or bug? EFI or EF? It shows "EF" in XPS 15 But in my anther laptop it shows well "EFI". also me too. 1 1 Link to comment https://www.insanelymac.com/forum/topic/284656-clover-general-discussion/page/767/#findComment-2679071 Share on other sites More sharing options...
vector sigma Posted June 24, 2019 Share Posted June 24, 2019 14 hours ago, joevt said: serial or firewire kprintf? @joevt easy as I said, no redirecting to any socket, just my screen as It took just two reboots to understand that the xcpm patch wasn't working as the AIPM works. Anyway not really sure it "just don't work" or it's a consequence of another thing. 12 hours ago, PMheart said: @joevt is correct, and I hope we have a workaround to this: (Apply the patch via Clover KernelToPatch) https://github.com/acidanthera/OcSupportPkg/blob/3223115d876632f13408f64c182046dc1badd785/Library/OcAppleKernelLib/CommonPatches.c#L948-L958 Credit to @vit9696. Thanks, looks pomising, I'll try it soon and let you know. 7 hours ago, Slice said: I didn't check in 10.14+ but it is working in 10.13 with my i5-3320M. I can confirm that it works well in mojave and sierra, but in 10.15 I have problems. Let see if I can provide more info with the patch @PMheart link to us... within an hour ...more or less when I'll be at Home. Link to comment https://www.insanelymac.com/forum/topic/284656-clover-general-discussion/page/767/#findComment-2679084 Share on other sites More sharing options...
vector sigma Posted June 24, 2019 Share Posted June 24, 2019 Beta of 10.15 (19A487l) Last login: Mon Jun 24 20:55:52 on console vectorsigma@MacBook-Pro-di-vector ~ % sysctl -n machdep.xcpm.mode 0 vectorsigma@MacBook-Pro-di-vector ~ % that's the outcome, xcpm enabled (confirmed in bdmesg) plus AICPM patch. This is the panic w/o AICPM patch and KernelXCPM turned on (thanks again to @PMheart for the patch linked): still panics on AppleIntelCPUPowerManagement. P.S. KernelPm turned on as well. Link to comment https://www.insanelymac.com/forum/topic/284656-clover-general-discussion/page/767/#findComment-2679097 Share on other sites More sharing options...
vector sigma Posted June 24, 2019 Share Posted June 24, 2019 14 hours ago, Matgen84 said: It's the same with release from Repo. Not related, sf or the OS remove it during the download or the decompression. During the compilation the image is there, or at least for me. Link to comment https://www.insanelymac.com/forum/topic/284656-clover-general-discussion/page/767/#findComment-2679101 Share on other sites More sharing options...
PMheart Posted June 25, 2019 Share Posted June 25, 2019 @vector sigma I think I have figured it out: https://sourceforge.net/p/cloverefiboot/code/4973/tree/rEFIt_UEFI/Platform/kernel_patcher.c#l1122 which should be os_version >= AsciiOSVersionToUint64("10.16") now. (Meaning that 10.15 is still "unsupported" despite I added necessary patches) Please also change the comment right above, thanks! 6 Link to comment https://www.insanelymac.com/forum/topic/284656-clover-general-discussion/page/767/#findComment-2679145 Share on other sites More sharing options...
Matgen84 Posted June 25, 2019 Share Posted June 25, 2019 9 hours ago, vector sigma said: Not related, sf or the OS remove it during the download or the decompression. During the compilation the image is there, or at least for me. I talk about Clover logo into Installer 'Background image' (Cloverpackage/Resources/Background.tiff), not Clover icon Link to comment https://www.insanelymac.com/forum/topic/284656-clover-general-discussion/page/767/#findComment-2679155 Share on other sites More sharing options...
mhaeuser Posted June 25, 2019 Share Posted June 25, 2019 @PMheart probably an option similiar to Lilu's Beta bootflag makes sense? 1 Link to comment https://www.insanelymac.com/forum/topic/284656-clover-general-discussion/page/767/#findComment-2679164 Share on other sites More sharing options...
PMheart Posted June 25, 2019 Share Posted June 25, 2019 2 minutes ago, Download-Fritz said: @PMheart probably an option similiar to Lilu's Beta bootflag makes sense? Nope. It's not like the bytes are stable, so better to leave as is. Yet I came up with a tiny function for compatibility check, see the diff please: (@vector sigma) Index: rEFIt_UEFI/Platform/kernel_patcher.c =================================================================== --- rEFIt_UEFI/Platform/kernel_patcher.c (revision 4973) +++ rEFIt_UEFI/Platform/kernel_patcher.c (working copy) @@ -822,6 +822,15 @@ } // +// Global XCPM patches compatibility +// Currently 10.8.5 - 10.15 +// +static inline BOOLEAN IsXCPMOSVersionCompat(UINT64 os_version) +{ + return (os_version >= AsciiOSVersionToUint64("10.8.5")) && (os_version < AsciiOSVersionToUint64("10.16")); +} + +// // Enable Unsupported CPU PowerManagement // // syscl - SandyBridgeEPM(): enable PowerManagement on SandyBridge-E @@ -846,8 +855,8 @@ UINT64 os_version = AsciiOSVersionToUint64(Entry->OSVersion); // check OS version suit for patches - if (os_version < AsciiOSVersionToUint64("10.8.5") || os_version >= AsciiOSVersionToUint64("10.14")) { - DBG("Unsupported macOS.\nHaswell-E requires macOS 10.8.5 - 10.13.x, aborted\n"); + if (!IsXCPMOSVersionCompat(os_version)) { + DBG("HaswellEXCPM(): Unsupported macOS.\n"); DBG("HaswellEXCPM() <===FALSE\n"); return FALSE; } @@ -988,8 +997,8 @@ UINT64 os_version = AsciiOSVersionToUint64(Entry->OSVersion); // check OS version suit for patches - if (os_version < AsciiOSVersionToUint64("10.8.5")) { - DBG("Unsupported macOS.\nBroadwell-E/EP requires macOS at least 10.8.5, aborted\n"); + if (!IsXCPMOSVersionCompat(os_version)) { + DBG("BroadwellEPM(): Unsupported macOS.\n"); DBG("BroadwellEPM() <===FALSE\n"); return FALSE; } @@ -1038,8 +1047,8 @@ CHAR8 *comment; // check OS version suit for patches - if (os_version < AsciiOSVersionToUint64("10.8.5") || os_version >= AsciiOSVersionToUint64("10.14")) { - DBG("Unsupported macOS.\nHaswell Celeron/Pentium requires macOS 10.8.5 - 10.13.x, aborted\n"); + if (!IsXCPMOSVersionCompat(os_version)) { + DBG("Unsupported macOS.\n"); DBG("HaswellLowEndXCPM() <===FALSE\n"); return FALSE; } @@ -1118,9 +1127,8 @@ } // check OS version suit for patches - // PMheart: attempt to add 10.14 compatibility - if (os_version < AsciiOSVersionToUint64("10.8.5") || os_version >= AsciiOSVersionToUint64("10.15")) { - DBG("Unsupported macOS.\nIvy Bridge XCPM requires macOS 10.8.5 - 10.13.x, aborted\n"); + if (!IsXCPMOSVersionCompat(os_version)) { + DBG("Unsupported macOS.\n"); DBG("KernelIvyBridgeXCPM() <===FALSE\n"); return FALSE; } else if (os_version >= AsciiOSVersionToUint64("10.8.5") && os_version < AsciiOSVersionToUint64("10.12")) { @@ -1203,8 +1211,8 @@ // check OS version suit for patches // PMheart: attempt to add 10.14 compatibility - if (os_version < AsciiOSVersionToUint64("10.8.5") || os_version >= AsciiOSVersionToUint64("10.15")) { - DBG("Unsupported macOS.\nIvy Bridge-E XCPM requires macOS 10.8.5 - 10.13.x, aborted\n"); + if (!IsXCPMOSVersionCompat(os_version)) { + DBG("Unsupported macOS.\n"); DBG("KernelIvyE5XCPM() <===FALSE\n"); return FALSE; } Thanks! 4 Link to comment https://www.insanelymac.com/forum/topic/284656-clover-general-discussion/page/767/#findComment-2679167 Share on other sites More sharing options...
Slice Posted June 25, 2019 Share Posted June 25, 2019 Thanks, committed! 1 1 Link to comment https://www.insanelymac.com/forum/topic/284656-clover-general-discussion/page/767/#findComment-2679173 Share on other sites More sharing options...
Slice Posted June 25, 2019 Share Posted June 25, 2019 18 hours ago, gujiangjiang said: When update to latest Clover it show an error or bug? EFI or EF? It shows "EF" in XPS 15 But in my anther laptop it shows well "EFI". It is a bug requiring investigation. Link to comment https://www.insanelymac.com/forum/topic/284656-clover-general-discussion/page/767/#findComment-2679175 Share on other sites More sharing options...
cecekpawon Posted June 25, 2019 Share Posted June 25, 2019 The string length is currently limited to 64 (SMBIOS_STRING_MAX_LENGTH) ? https://github.com/tianocore/edk2/blob/3806e1fd139775610d8f2e7541a916c3a91ad989/MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.c#L196 Howerver, if I force change maxline in "UpdateSmbiosString" to SMBIOS_TABLE_MAX_LENGTH (with SmbiosEpsNew->MinorVersion = 7), "Apple ROM Info" doesnt show up. https://sourceforge.net/p/cloverefiboot/code/HEAD/tree/rEFIt_UEFI/Platform/smbios.c#l303 Hope you will get a clue soon @Slice 4 Link to comment https://www.insanelymac.com/forum/topic/284656-clover-general-discussion/page/767/#findComment-2679183 Share on other sites More sharing options...
Slice Posted June 25, 2019 Share Posted June 25, 2019 Yes, thanks, it should be MAX_OEM_STRING. I will test at evening. 1 Link to comment https://www.insanelymac.com/forum/topic/284656-clover-general-discussion/page/767/#findComment-2679185 Share on other sites More sharing options...
cecekpawon Posted June 25, 2019 Share Posted June 25, 2019 Thanks. Also that unix lineending will produced "0x0D0A" by dmidecode instead of "0x0A" like on real mac dump. 2 Link to comment https://www.insanelymac.com/forum/topic/284656-clover-general-discussion/page/767/#findComment-2679188 Share on other sites More sharing options...
vector sigma Posted June 25, 2019 Share Posted June 25, 2019 (edited) 10 hours ago, Download-Fritz said: @PMheart probably an option similiar to Lilu's Beta bootflag makes sense? Yes! 10 hours ago, PMheart said: Nope. It's not like the bytes are stable, so better to leave as is. Yet I came up with a tiny function for compatibility check, see the diff please: (@vector sigma) Index: rEFIt_UEFI/Platform/kernel_patcher.c =================================================================== --- rEFIt_UEFI/Platform/kernel_patcher.c (revision 4973) +++ rEFIt_UEFI/Platform/kernel_patcher.c (working copy) @@ -822,6 +822,15 @@ } // +// Global XCPM patches compatibility +// Currently 10.8.5 - 10.15 +// +static inline BOOLEAN IsXCPMOSVersionCompat(UINT64 os_version) +{ + return (os_version >= AsciiOSVersionToUint64("10.8.5")) && (os_version < AsciiOSVersionToUint64("10.16")); +} + +// // Enable Unsupported CPU PowerManagement // // syscl - SandyBridgeEPM(): enable PowerManagement on SandyBridge-E @@ -846,8 +855,8 @@ UINT64 os_version = AsciiOSVersionToUint64(Entry->OSVersion); // check OS version suit for patches - if (os_version < AsciiOSVersionToUint64("10.8.5") || os_version >= AsciiOSVersionToUint64("10.14")) { - DBG("Unsupported macOS.\nHaswell-E requires macOS 10.8.5 - 10.13.x, aborted\n"); + if (!IsXCPMOSVersionCompat(os_version)) { + DBG("HaswellEXCPM(): Unsupported macOS.\n"); DBG("HaswellEXCPM() <===FALSE\n"); return FALSE; } @@ -988,8 +997,8 @@ UINT64 os_version = AsciiOSVersionToUint64(Entry->OSVersion); // check OS version suit for patches - if (os_version < AsciiOSVersionToUint64("10.8.5")) { - DBG("Unsupported macOS.\nBroadwell-E/EP requires macOS at least 10.8.5, aborted\n"); + if (!IsXCPMOSVersionCompat(os_version)) { + DBG("BroadwellEPM(): Unsupported macOS.\n"); DBG("BroadwellEPM() <===FALSE\n"); return FALSE; } @@ -1038,8 +1047,8 @@ CHAR8 *comment; // check OS version suit for patches - if (os_version < AsciiOSVersionToUint64("10.8.5") || os_version >= AsciiOSVersionToUint64("10.14")) { - DBG("Unsupported macOS.\nHaswell Celeron/Pentium requires macOS 10.8.5 - 10.13.x, aborted\n"); + if (!IsXCPMOSVersionCompat(os_version)) { + DBG("Unsupported macOS.\n"); DBG("HaswellLowEndXCPM() <===FALSE\n"); return FALSE; } @@ -1118,9 +1127,8 @@ } // check OS version suit for patches - // PMheart: attempt to add 10.14 compatibility - if (os_version < AsciiOSVersionToUint64("10.8.5") || os_version >= AsciiOSVersionToUint64("10.15")) { - DBG("Unsupported macOS.\nIvy Bridge XCPM requires macOS 10.8.5 - 10.13.x, aborted\n"); + if (!IsXCPMOSVersionCompat(os_version)) { + DBG("Unsupported macOS.\n"); DBG("KernelIvyBridgeXCPM() <===FALSE\n"); return FALSE; } else if (os_version >= AsciiOSVersionToUint64("10.8.5") && os_version < AsciiOSVersionToUint64("10.12")) { @@ -1203,8 +1211,8 @@ // check OS version suit for patches // PMheart: attempt to add 10.14 compatibility - if (os_version < AsciiOSVersionToUint64("10.8.5") || os_version >= AsciiOSVersionToUint64("10.15")) { - DBG("Unsupported macOS.\nIvy Bridge-E XCPM requires macOS 10.8.5 - 10.13.x, aborted\n"); + if (!IsXCPMOSVersionCompat(os_version)) { + DBG("Unsupported macOS.\n"); DBG("KernelIvyE5XCPM() <===FALSE\n"); return FALSE; } Thanks! Thanks to you, I'll try it after the job! 13 hours ago, Matgen84 said: I talk about Clover logo into Installer 'Background image' (Cloverpackage/Resources/Background.tiff), not Clover icon O_ops, why that wasn't clear? . I think this will be a bit difficult since this is decided by Installer.app, but let see if I can do something (in the week end). EDIT just too easy Edited June 25, 2019 by vector sigma easy Link to comment https://www.insanelymac.com/forum/topic/284656-clover-general-discussion/page/767/#findComment-2679189 Share on other sites More sharing options...
vector sigma Posted June 25, 2019 Share Posted June 25, 2019 @PMheart, just tried with success. Problem solved, thanks! 18 minutes ago, vector sigma said: Yes! Thanks to you, I'll try it after the job! O_ops, why that wasn't clear? . I think this will a bit difficult since this is decided by Installer.app, but let see if I can do something (in the week end). I think I found the solution in the apple developer portal.... 2 Link to comment https://www.insanelymac.com/forum/topic/284656-clover-general-discussion/page/767/#findComment-2679190 Share on other sites More sharing options...
Slice Posted June 25, 2019 Share Posted June 25, 2019 27 minutes ago, cecekpawon said: Thanks. Also that unix lineending will produced "0x0D0A" by dmidecode instead of "0x0A" like on real mac dump. You means UEFI line ending? Link to comment https://www.insanelymac.com/forum/topic/284656-clover-general-discussion/page/767/#findComment-2679191 Share on other sites More sharing options...
cecekpawon Posted June 25, 2019 Share Posted June 25, 2019 (edited) @Slice Please ignore if you already have similar results like imac dump below. https://sourceforge.net/p/cloverefiboot/code/HEAD/tree/rEFIt_UEFI/Platform/smbios.c#l1083 @Any master: So, there's a chance for my i5-3570K ivy bridge to use xcpm with 10.13? Edited June 25, 2019 by cecekpawon 1 Link to comment https://www.insanelymac.com/forum/topic/284656-clover-general-discussion/page/767/#findComment-2679211 Share on other sites More sharing options...
vector sigma Posted June 25, 2019 Share Posted June 25, 2019 2 hours ago, cecekpawon said: @Any master: So, there's a chance for my i5-3570K ivy bridge to use xcpm with 10.13? I'm not a master, but looks like you can certainly give it a try. 1 Link to comment https://www.insanelymac.com/forum/topic/284656-clover-general-discussion/page/767/#findComment-2679226 Share on other sites More sharing options...
vector sigma Posted June 25, 2019 Share Posted June 25, 2019 12 hours ago, Matgen84 said: I talk about Clover logo into Installer 'Background image' (Cloverpackage/Resources/Background.tiff), not Clover icon Tadan: Clover_v2.4k_r4974.pkg after one year, as soon I understood that you wanted a dark background image and not the logo Lol, here is it: To all, before committing changes I want to know if the package can work in old OSes, e.g. 10.10 or maybe 10.7? Please report! 3 2 Link to comment https://www.insanelymac.com/forum/topic/284656-clover-general-discussion/page/767/#findComment-2679233 Share on other sites More sharing options...
Recommended Posts