Skip to content

Commit 6ca4473

Browse files
committed
Dropped broken AppleIntelMCEReporter prevention support
1 parent 083471c commit 6ca4473

File tree

6 files changed

+8
-28
lines changed

6 files changed

+8
-28
lines changed

CPUFriend.xcodeproj/project.pbxproj

+3-3
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@
171171
1C748C1E1C21952C0024EED2 /* Project object */ = {
172172
isa = PBXProject;
173173
attributes = {
174-
LastUpgradeCheck = 1100;
174+
LastUpgradeCheck = 1120;
175175
ORGANIZATIONNAME = Vanilla;
176176
TargetAttributes = {
177177
1C748C261C21952C0024EED2 = {
@@ -342,7 +342,7 @@
342342
MODULE_NAME = org.vanilla.driver.CPUFriend;
343343
MODULE_START = "$(PRODUCT_NAME)_kern_start";
344344
MODULE_STOP = "$(PRODUCT_NAME)_kern_stop";
345-
MODULE_VERSION = 1.1.9;
345+
MODULE_VERSION = 1.2.0;
346346
OTHER_CFLAGS = (
347347
"-mmmx",
348348
"-msse",
@@ -388,7 +388,7 @@
388388
MODULE_NAME = org.vanilla.driver.CPUFriend;
389389
MODULE_START = "$(PRODUCT_NAME)_kern_start";
390390
MODULE_STOP = "$(PRODUCT_NAME)_kern_stop";
391-
MODULE_VERSION = 1.1.9;
391+
MODULE_VERSION = 1.2.0;
392392
OTHER_CFLAGS = (
393393
"-mmmx",
394394
"-msse",

CPUFriend/CPUFriend.cpp

-21
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,15 @@
1111

1212
static const char *kextACPISMC[] { "/System/Library/Extensions/IOPlatformPluginFamily.kext/Contents/PlugIns/ACPI_SMC_PlatformPlugin.kext/Contents/MacOS/ACPI_SMC_PlatformPlugin" };
1313
static const char *kextX86PP[] { "/System/Library/Extensions/IOPlatformPluginFamily.kext/Contents/PlugIns/X86PlatformPlugin.kext/Contents/MacOS/X86PlatformPlugin" };
14-
static const char *kextMCEReporter[] { "/System/Library/Extensions/AppleIntelMCEReporter.kext/Contents/MacOS/AppleIntelMCEReporter" };
1514

1615
enum : size_t {
1716
KextACPISMC,
1817
KextX86PP,
19-
KextMCEReporter
2018
};
2119

2220
static KernelPatcher::KextInfo kextList[] {
2321
{ "com.apple.driver.ACPI_SMC_PlatformPlugin", kextACPISMC, arrsize(kextACPISMC), {}, {}, KernelPatcher::KextInfo::Unloaded },
2422
{ "com.apple.driver.X86PlatformPlugin", kextX86PP, arrsize(kextX86PP), {}, {}, KernelPatcher::KextInfo::Unloaded },
25-
{ "com.apple.driver.AppleIntelMCEReporter", kextMCEReporter, arrsize(kextMCEReporter), {}, {}, KernelPatcher::KextInfo::Unloaded }
2623
};
2724

2825
static constexpr size_t kextListSize = arrsize(kextList);
@@ -116,14 +113,6 @@ void CPUFriendPlugin::myX86PPConfigResourceCallback(uint32_t requestTag, kern_re
116113
FunctionCast(myX86PPConfigResourceCallback, callbackCpuf->orgX86PPConfigLoadCallback)(requestTag, result, resourceData, resourceDataLength, context);
117114
}
118115

119-
IOService *CPUFriendPlugin::myAppleIntelMCEReporterProbe(IOService *, IOService *, SInt32 *)
120-
{
121-
DBGLOG("cpuf", "killing AppleIntelMCEReporter");
122-
123-
// always return nullptr for prevention of AppleIntelMCEReporter.
124-
return nullptr;
125-
}
126-
127116
void CPUFriendPlugin::processKext(KernelPatcher &patcher, size_t index, mach_vm_address_t address, size_t size)
128117
{
129118
if (kextList[KextACPISMC].loadIndex == index) {
@@ -143,14 +132,4 @@ void CPUFriendPlugin::processKext(KernelPatcher &patcher, size_t index, mach_vm_
143132
);
144133
patcher.routeMultiple(index, &request, 1, address, size);
145134
}
146-
147-
if (kextList[KextMCEReporter].loadIndex == index) {
148-
DBGLOG("cpuf", "patching AppleIntelMCEReporter");
149-
KernelPatcher::RouteRequest request(
150-
"__ZN21AppleIntelMCEReporter5probeEP9IOServicePi",
151-
myAppleIntelMCEReporterProbe
152-
);
153-
patcher.routeMultiple(index, &request, 1, address, size);
154-
}
155-
156135
}

CPUFriend/CPUFriend.hpp

-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ class CPUFriendPlugin {
5252
*/
5353
static void myACPISMCConfigResourceCallback(uint32_t requestTag, kern_return_t result, const void *resourceData, uint32_t resourceDataLength, void *context);
5454
static void myX86PPConfigResourceCallback(uint32_t requestTag, kern_return_t result, const void *resourceData, uint32_t resourceDataLength, void *context);
55-
static IOService *myAppleIntelMCEReporterProbe(IOService *, IOService *, SInt32 *);
5655

5756
/**
5857
* Patch kext if needed and prepare other patches

Changelog.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
CPUFriend Changelog
22
===================
3+
#### v1.2.0
4+
- Dropped broken AppleIntelMCEReporter prevention support
5+
36
#### v1.1.9
47
- Unified release archive names
58
- Added support for prevention of AppleIntelMCEReporter, details can be found [here](https://github.com/acidanthera/bugtracker/issues/424#issuecomment-512596034)

Instructions.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ Add `-cpufbeta` to enable CPUFriend on unsupported OS versions.
1717

1818
#### Technical background
1919
- Function `configResourceCallback()` from `ACPI_SMC_PlatformPlugin` or `X86PlatformPlugin` is hooked for CPU power management data customization, nothing will be handled without data received from user.
20-
- Function `AppleIntelMCEReporter::probe()` is hooked for prevention of AppleIntelMCEReporter, enabled mandatorily at the moment.
2120

2221
#### Configuration
2322
Use `Tools/ResourceConverter.sh` to generate a working copy of either `CPUFriendDataProvider.kext` (Convenience preferred) or `ssdt_data.dsl` (Performance preferred).
@@ -32,7 +31,7 @@ Where there is another SSDT generated by [ssdtPRGen.sh](https://github.com/Piker
3231

3332
NOTE:
3433
- The created kext/ssdt is located in the current working directory that can be revealed with `pwd`.
35-
- `file` should be a ***complete plist*** from `Recources` inside `ACPI_SMC_PlatformPlugin` or `X86PlatformPlugin` ***with certain modifications*** (Otherwise why is CPUFriend even required other than the prevention of AppleIntelMCEReporter?) instead of something like a raw `FrequencyVectors` entry.
34+
- `file` should be a ***complete plist*** from `Recources` inside `ACPI_SMC_PlatformPlugin` or `X86PlatformPlugin` ***with certain modifications*** (Otherwise why is CPUFriend even required?) instead of something like a raw `FrequencyVectors` entry.
3635

3736
#### Data Combination
3837
1. Generate a correct copy of `ssdt_data.dsl` with `./ResourceConverter.sh --acpi /path/to/file`.

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ CPUFriend
33

44
[![Build Status](https://travis-ci.com/acidanthera/CPUFriend.svg?branch=master)](https://travis-ci.com/acidanthera/CPUFriend) [![Scan Status](https://scan.coverity.com/projects/16841/badge.svg?flat=1)](https://scan.coverity.com/projects/16841)
55

6-
A [Lilu](https://github.com/vit9696/Lilu) plug-in for dynamic power management data injection and prevention of AppleIntelMCEReporter, details can be found [here](https://github.com/acidanthera/bugtracker/issues/424#issuecomment-512596034).
6+
A [Lilu](https://github.com/vit9696/Lilu) plug-in for dynamic power management data injection.
77

88
#### Notes
99
This repository should be compiled with latest [Lilu](https://github.com/vit9696/Lilu), otherwise the compilation will fail!

0 commit comments

Comments
 (0)