Add XCPM disabling

This commit is contained in:
Mykola Grymalyuk
2022-03-02 09:19:41 -07:00
parent ba82b41cbd
commit 1393db72dd
7 changed files with 66 additions and 14 deletions
+8 -5
View File
@@ -174,14 +174,17 @@ class BuildOpenCore:
print(f"- Adding additional FeatureUnlock args: {self.constants.fu_arguments}")
self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["boot-args"] += self.constants.fu_arguments
if smbios_data.smbios_dictionary[self.model]["CPU Generation"] <= cpu_data.cpu_data.sandy_bridge.value:
if smbios_data.smbios_dictionary[self.model]["CPU Generation"] <= cpu_data.cpu_data.sandy_bridge.value or self.constants.disable_xcpm is True:
# With macOS 12.3 Beta 1, Apple dropped the 'plugin-type' check within X86PlatformPlugin
# Because of this, X86PP will match onto the CPU instead of ACPI_SMC_PlatformPlugin
# This causes power management to break on pre-Ivy Bridge CPUs as they don't have correct
# power management tables provided.
# This patch will simply increase ASPP's 'IOProbeScore' to outmatch X86PP
print("- Fixing ACPI SMC Power Management support")
print("- Overriding ACPI SMC matching")
self.enable_kext("ASPP-Override.kext", self.constants.aspp_override_version, self.constants.aspp_override_path)
if self.constants.disable_xcpm is True:
# Only inject on older OSes if user requests
self.get_item_by_kv(self.config["Kernel"]["Add"], "BundlePath", "ASPP-Override.kext")["MinKernel"] = ""
if self.model in ["MacBookPro6,1", "MacBookPro6,2", "MacBookPro9,1", "MacBookPro10,1"]:
# Modded RestrictEvents with displaypolicyd blocked to fix dGPU switching
@@ -926,10 +929,10 @@ class BuildOpenCore:
self.get_item_by_kv(self.config["Kernel"]["Patch"], "Identifier", "com.apple.filesystems.apfs")["Enabled"] = True
# Lets us check in sys_patch.py if config supports FileVault
self.config["NVRAM"]["Add"]["4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102"]["OCLP-Settings"] += " -allow_fv"
if self.constants.disable_msr_power_ctl is True and self.model.startswith("MacBook"):
print("- Disabling Battery Throttling")
if self.constants.disable_msr_power_ctl is True:
print("- Disabling Firmware Throttling")
if smbios_data.smbios_dictionary[self.model]["CPU Generation"] >= cpu_data.cpu_data.nehalem.value:
# Nehalem and newer MacBooks force firmware throttling via MSR_POWER_CTL
# Nehalem and newer systems force firmware throttling via MSR_POWER_CTL
self.enable_kext("SimpleMSR.kext", self.constants.simplemsr_version, self.constants.simplemsr_path)
if self.constants.disable_connectdrivers is True:
print("- Disabling ConnectDrivers")
+31 -4
View File
@@ -807,16 +807,16 @@ https://dortania.github.io/OpenCore-Legacy-Patcher/ACCEL.html#unable-to-switch-g
print(
"""
By default on Nehalem and newer Macs, the firmware will throttle if
the battery is either dead or missing. The firmware will set
the battery or Display is either dead or missing. The firmware will set
'BD PROCHOT' to notify the OS the machine needs to run in an extreme
low power mode.
Enabling this option will patch 'MSR_POWER_CTL' to be unset allowing
proper CPU behaviour as if battery is present. Note that this can cause
proper CPU behaviour as if hardware is present. Note that this can cause
instability in situations where the CPU is being taxed and pulls more
power than the PSU can supply.
power than the laptop's PSU can supply.
Note: Only supported on Nehalem and newer MacBooks (2010+)
Note: Only supported on Nehalem and newer Macs (2010+)
"""
)
@@ -830,6 +830,32 @@ Note: Only supported on Nehalem and newer MacBooks (2010+)
else:
self.set_battery_throttle()
def set_xcpm(self):
utilities.cls()
utilities.header(["Disable XCPM"])
print(
"""
By default on Ivy Bridge EP and newer Macs, the system will throttle if
the battery or Display is either dead or missing. Apple's XCPM will set
'BD PROCHOT' to avoid damage to the system.
Enabling this option will disable Apple's XNU CPU Power Management (XCPM)
and fall back onto the older ACPI_SMC_PlatformPlugin.kext.
Note: Only supported on Ivy Bridge EP and newer Macs (2013+)
"""
)
change_menu = input("Disable XCPM?(y/n/q): ")
if change_menu in {"y", "Y", "yes", "Yes"}:
self.constants.disable_xcpm = True
elif change_menu in {"n", "N", "no", "No"}:
self.constants.disable_xcpm = False
elif change_menu in {"q", "Q", "Quit", "quit"}:
print("Returning to previous menu")
else:
self.set_xcpm()
def set_surplus(self):
utilities.cls()
utilities.header(["Override SurPlus MaxKernel"])
@@ -1236,6 +1262,7 @@ system_profiler SPHardwareDataType | grep 'Model Identifier'
],
[f"Set Hibernation Workaround:\tCurrently {self.constants.disable_connectdrivers}", MenuOptions(self.constants.custom_model or self.constants.computer.real_model, self.constants).set_hibernation_workaround],
[f"Disable Battery Throttling:\tCurrently {self.constants.disable_msr_power_ctl}", MenuOptions(self.constants.custom_model or self.constants.computer.real_model, self.constants).set_battery_throttle],
[f"Disable XCPM:\t\tCurrently {self.constants.disable_xcpm}", MenuOptions(self.constants.custom_model or self.constants.computer.real_model, self.constants).set_xcpm],
[f"Set Software Demux:\tCurrently {self.constants.software_demux}", MenuOptions(self.constants.custom_model or self.constants.computer.real_model, self.constants).set_software_demux],
[f"Set 3rd Party SSD Support:\tCurrently {self.constants.allow_3rd_party_drives}", MenuOptions(self.constants.custom_model or self.constants.computer.real_model, self.constants).set_3rd_party_drices],
[f"Set FeatureUnlock: \tCurrently {self.constants.fu_status}", MenuOptions(self.constants.custom_model or self.constants.computer.real_model, self.constants).set_fu_settings],
+2 -1
View File
@@ -70,7 +70,7 @@ class Constants:
self.smcspoof_version = "1.0.0" # SMC-Spoof
self.mce_version = "1.0.0" # AppleMCEReporterDisabler
self.btspoof_version = "1.0.0" # Bluetooth-Spoof
self.aspp_override_version = "1.0.0" # ACPI_SMC_PlatformPlugin Override
self.aspp_override_version = "1.0.1" # ACPI_SMC_PlatformPlugin Override
## Syncretic
## https://forums.macrumors.com/members/syncretic.1173816/
@@ -187,6 +187,7 @@ class Constants:
self.allow_3rd_party_drives = True # Allow ThridPartyDrives quirk
self.set_content_caching = False # Set Content Caching
self.allow_nvme_fixing = True # Allow NVMe Kernel Space Patches
self.disable_xcpm = False # Disable XCPM (X86PlatformPlugin.kext)
self.legacy_accel_support = [
os_data.os_data.mojave,