From 7dea96d7753f49da81a1fde769fda2f65aca0654 Mon Sep 17 00:00:00 2001 From: Hoang Hong Quan Date: Sun, 18 Aug 2024 22:54:57 +0700 Subject: [PATCH] Fix issues caused by CpuTopologyRebuild with Intel CPUs that lack E-cores --- Scripts/config_prodigy.py | 7 ++++--- Scripts/efi_builder.py | 1 + Scripts/kext_maestro.py | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) mode change 100755 => 100644 Scripts/efi_builder.py mode change 100755 => 100644 Scripts/kext_maestro.py diff --git a/Scripts/config_prodigy.py b/Scripts/config_prodigy.py index 24aa8dc..5fb1650 100644 --- a/Scripts/config_prodigy.py +++ b/Scripts/config_prodigy.py @@ -115,7 +115,7 @@ class ConfigProdigy: elif tsc_sync: kernel_patch.extend(self.g.get_amd_kernel_patches()[-6:-4]) - if self.utils.contains_any(cpu_data.IntelCPUGenerations, cpu_codename, start=13): + if self.utils.contains_any(cpu_data.IntelCPUGenerations, cpu_codename, start=13) and int(cpu_cores) > 6: kernel_patch.append({ "Arch": "Any", "Base": "_cpu_thread_alloc", @@ -160,7 +160,7 @@ class ConfigProdigy: return kernel_patch - def boot_args(self, motherboard_name, platform, cpu_manufacturer, cpu_codename, discrete_gpu_codename, discrete_gpu_id, integrated_gpu_name, codec_id, touchpad_communication, unsupported_devices, custom_cpu_name, macos_version): + def boot_args(self, motherboard_name, platform, cpu_manufacturer, cpu_codename, cpu_cores, discrete_gpu_codename, discrete_gpu_id, integrated_gpu_name, codec_id, touchpad_communication, unsupported_devices, custom_cpu_name, macos_version): boot_args = [ "-v", "debug=0x100", @@ -176,7 +176,7 @@ class ConfigProdigy: if macos_version > 22: boot_args.append("revpatch=sbvmm{}".format(",cpuname" if custom_cpu_name else "")) - if self.utils.contains_any(cpu_data.IntelCPUGenerations, cpu_codename, start=13): + if self.utils.contains_any(cpu_data.IntelCPUGenerations, cpu_codename, start=13) and int(cpu_cores) > 6: boot_args.append("-ctrsmt") if "Intel" in cpu_manufacturer: @@ -320,6 +320,7 @@ class ConfigProdigy: hardware.get("Platform"), hardware.get("CPU Manufacturer"), hardware.get("CPU Codename"), + hardware.get("CPU Cores"), hardware.get("Discrete GPU").get("GPU Codename", ""), hardware.get("Discrete GPU").get("Device ID", ""), hardware.get("Integrated GPU Name"), diff --git a/Scripts/efi_builder.py b/Scripts/efi_builder.py old mode 100755 new mode 100644 index 21d041b..bb352a4 --- a/Scripts/efi_builder.py +++ b/Scripts/efi_builder.py @@ -456,6 +456,7 @@ class builder: hardware_shorc["CPU Configuration"], hardware_shorc["CPU Manufacturer"], hardware_shorc["CPU Codename"], + hardware_shorc["CPU Cores"], hardware_shorc["Discrete GPU"].get("GPU Codename", ""), hardware_shorc["Integrated GPU"], hardware_shorc.get("Network"), diff --git a/Scripts/kext_maestro.py b/Scripts/kext_maestro.py old mode 100755 new mode 100644 index 29e32b9..51984b0 --- a/Scripts/kext_maestro.py +++ b/Scripts/kext_maestro.py @@ -584,7 +584,7 @@ class KextMaestro: return pci_ids - def gathering_kexts(self, motherboard_name, platform, cpu_configuration, cpu_manufacturer, cpu_codename, discrete_gpu_codename, integrated_gpu, network, bluetooth, codec_id, input, sd_controller, storage_controllers, usb_controllers, smbios, custom_cpu_name, tsc_sync, acpi, macos_version): + def gathering_kexts(self, motherboard_name, platform, cpu_configuration, cpu_manufacturer, cpu_codename, cpu_cores, discrete_gpu_codename, integrated_gpu, network, bluetooth, codec_id, input, sd_controller, storage_controllers, usb_controllers, smbios, custom_cpu_name, tsc_sync, acpi, macos_version): kexts = [ "Lilu", "VirtualSMC", @@ -603,7 +603,7 @@ class KextMaestro: if macos_version > 21 and self.utils.contains_any(cpu_data.IntelCPUGenerations, cpu_codename, end=2): kexts.append("CryptexFixup") - if self.utils.contains_any(cpu_data.IntelCPUGenerations, cpu_codename, start=13): + if self.utils.contains_any(cpu_data.IntelCPUGenerations, cpu_codename, start=13) and int(cpu_cores) > 6: kexts.append("CpuTopologyRebuild") if tsc_sync: