From 6d19576520e3cbcc933f07f2ed271dcfb6c34a01 Mon Sep 17 00:00:00 2001 From: Sherlocks Date: Mon, 30 Mar 2020 23:11:18 +0900 Subject: [PATCH] Update KernelXCPM for 10.15.4 --- rEFIt_UEFI/Platform/kernel_patcher.cpp | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/rEFIt_UEFI/Platform/kernel_patcher.cpp b/rEFIt_UEFI/Platform/kernel_patcher.cpp index d55c56ee5..e4edca444 100644 --- a/rEFIt_UEFI/Platform/kernel_patcher.cpp +++ b/rEFIt_UEFI/Platform/kernel_patcher.cpp @@ -982,10 +982,14 @@ BOOLEAN HaswellEXCPM(VOID *kernelData, LOADER_ENTRY *Entry, BOOLEAN use_xcpm_idl STATIC UINT8 repl[] = { 0x89, 0xD8, 0x04, 0xC1, 0x3C, 0x22 }; applyKernPatch(kern, find, sizeof(find), repl, comment); // PMheart: attempt to add 10.15 compatibility - } else if (os_version < AsciiOSVersionToUint64("10.16")) { + } else if (os_version < AsciiOSVersionToUint64("10.15.4")) { STATIC UINT8 find[] = { 0x8D, 0x43, 0xC4, 0x3C, 0x22 }; STATIC UINT8 repl[] = { 0x8D, 0x43, 0xC1, 0x3C, 0x22 }; applyKernPatch(kern, find, sizeof(find), repl, comment); + } else if (os_version < AsciiOSVersionToUint64("10.16")) { + STATIC UINT8 find[] = { 0x80, 0xC3, 0xC4, 0x80, 0xFB, 0x42 }; + STATIC UINT8 repl[] = { 0x80, 0xC3, 0xC1, 0x80, 0xFB, 0x42 }; + applyKernPatch(kern, find, sizeof(find), repl, comment); } DBG("Searching _xcpm_pkg_scope_msr ...\n"); @@ -1142,10 +1146,14 @@ BOOLEAN HaswellLowEndXCPM(VOID *kernelData, LOADER_ENTRY *Entry, BOOLEAN use_xcp 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")) { + } else if (os_version < AsciiOSVersionToUint64("10.15.4")) { STATIC UINT8 find[] = { 0x8D, 0x43, 0xC4, 0x3C, 0x22 }; STATIC UINT8 repl[] = { 0x8D, 0x43, 0xC6, 0x3C, 0x22 }; applyKernPatch(kern, find, sizeof(find), repl, comment); + } else if (os_version < AsciiOSVersionToUint64("10.16")) { + STATIC UINT8 find[] = { 0x80, 0xC3, 0xC4, 0x80, 0xFB, 0x42 }; + STATIC UINT8 repl[] = { 0x80, 0xC3, 0xC6, 0x80, 0xFB, 0x42 }; + applyKernPatch(kern, find, sizeof(find), repl, comment); } comment = "_cpuid_set_info_rdmsr"; @@ -1234,10 +1242,14 @@ BOOLEAN KernelIvyBridgeXCPM(VOID *kernelData, LOADER_ENTRY *Entry, BOOLEAN use_x 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")) { + } else if (os_version < AsciiOSVersionToUint64("10.15.4")) { STATIC UINT8 find[] = { 0x8D, 0x43, 0xC4, 0x3C, 0x22 }; STATIC UINT8 repl[] = { 0x8D, 0x43, 0xC6, 0x3C, 0x22 }; applyKernPatch(kern, find, sizeof(find), repl, comment); + } else if (os_version < AsciiOSVersionToUint64("10.16")) { + STATIC UINT8 find[] = { 0x80, 0xC3, 0xC4, 0x80, 0xFB, 0x42 }; + STATIC UINT8 repl[] = { 0x80, 0xC3, 0xC6, 0x80, 0xFB, 0x42 }; + applyKernPatch(kern, find, sizeof(find), repl, comment); } DBG("KernelIvyBridgeXCPM() <===\n"); @@ -1382,10 +1394,14 @@ BOOLEAN KernelIvyE5XCPM(VOID *kernelData, LOADER_ENTRY *Entry, BOOLEAN use_xcpm_ STATIC UINT8 repl[] = { 0x89, 0xD8, 0x04, 0xC1, 0x3C, 0x22 }; applyKernPatch(kern, find, sizeof(find), repl, comment); // PMheart: attempt to add 10.15 compatibility - } else if (os_version < AsciiOSVersionToUint64("10.16")) { + } else if (os_version < AsciiOSVersionToUint64("10.15.4")) { STATIC UINT8 find[] = { 0x8D, 0x43, 0xC4, 0x3C, 0x22 }; STATIC UINT8 repl[] = { 0x8D, 0x43, 0xC1, 0x3C, 0x22 }; applyKernPatch(kern, find, sizeof(find), repl, comment); + } else if (os_version < AsciiOSVersionToUint64("10.16")) { + STATIC UINT8 find[] = { 0x80, 0xC3, 0xC4, 0x80, 0xFB, 0x42 }; + STATIC UINT8 repl[] = { 0x80, 0xC3, 0xC1, 0x80, 0xFB, 0x42 }; + applyKernPatch(kern, find, sizeof(find), repl, comment); } DBG("KernelIvyE5XCPM() <===\n");