Skip to content

Commit

Permalink
OcAppleKernelLib: Enable MSR_MISC_PWR_MGMT patch back on macOS 12+
Browse files Browse the repository at this point in the history
This partially reverts #545.
  • Loading branch information
PMheart committed Sep 24, 2024
1 parent f4f4e88 commit 5afe3a6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ OpenCore Changelog
- Fixed error in macrecovery when running headless, thx @mkorje
- Added support for `AMD_CPU_EXT_FAMILY_1AH`, thx @Shaneee
- Updated builtin firmware versions for SMBIOS and the rest
- Enabled `XcpmExtraMsrs MSR_MISC_PWR_MGMT` patch back on macOS 12+

#### v1.0.1
- Updated code and added progress bar to macrecovery, thx @soyeonswife63
Expand Down
19 changes: 9 additions & 10 deletions Library/OcAppleKernelLib/CommonPatches.c
Original file line number Diff line number Diff line change
Expand Up @@ -446,18 +446,17 @@ PatchAppleXcpmExtraMsrs (

//
// Now patch writes to MSR_MISC_PWR_MGMT.
// On macOS Monterey (12) and above, this no longer exists.
// On macOS Monterey (12) and above, in theory this no longer exists in XNU,
// yet without it macOS will not boot correctly on certain X299 builds.
//
if (OcMatchDarwinVersion (KernelVersion, KERNEL_VERSION_MONTEREY_MIN, 0)) {
DEBUG ((DEBUG_INFO, "OCAK: Skipping XcpmExtraMsrs MSR_MISC_PWR_MGMT patch on %u\n", KernelVersion));
} else {
Status = PatcherApplyGenericPatch (Patcher, &mMiscPwrMgmtRelPatch);
// Ref: https://github.com/acidanthera/bugtracker/issues/2410#issuecomment-2368925597
//
Status = PatcherApplyGenericPatch (Patcher, &mMiscPwrMgmtRelPatch);
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_INFO, "OCAK: Failed to patch writes to XcpmExtraMsrs MSR_MISC_PWR_MGMT - %r, trying dbg\n", Status));
Status = PatcherApplyGenericPatch (Patcher, &mMiscPwrMgmtDbgPatch);
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_INFO, "OCAK: Failed to patch writes to XcpmExtraMsrs MSR_MISC_PWR_MGMT - %r, trying dbg\n", Status));
Status = PatcherApplyGenericPatch (Patcher, &mMiscPwrMgmtDbgPatch);
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_WARN, "OCAK: Failed to patch writes to XcpmExtraMsrs MSR_MISC_PWR_MGMT - %r\n", Status));
}
DEBUG ((DEBUG_WARN, "OCAK: Failed to patch writes to XcpmExtraMsrs MSR_MISC_PWR_MGMT - %r\n", Status));
}
}

Expand Down

0 comments on commit 5afe3a6

Please sign in to comment.