-
Notifications
You must be signed in to change notification settings - Fork 630
Fix sticking at KernelCache validating on Tahoe #126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 2 commits
0a855d3
4094786
cdad012
660e9f6
dcebbbe
1d74eed
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,6 +28,7 @@ static const char *pathRadeonX4200[] { "/System/Library/Extensions/AMDRad | |
| static const char *pathRadeonX4250[] { "/System/Library/Extensions/AMDRadeonX4250.kext/Contents/MacOS/AMDRadeonX4250" }; | ||
| static const char *pathRadeonX5000[] { "/System/Library/Extensions/AMDRadeonX5000.kext/Contents/MacOS/AMDRadeonX5000" }; | ||
| static const char *pathRadeonX6000[] { "/System/Library/Extensions/AMDRadeonX6000.kext/Contents/MacOS/AMDRadeonX6000" }; | ||
| static const char *pathAMDRadeonServiceManager[] { "/System/Library/Extensions/AMDRadeonServiceManager.kext/Contents/MacOS/AMDRadeonServiceManager" }; | ||
| static const char *patchPolarisController[] { "/System/Library/Extensions/AMD9500Controller.kext/Contents/MacOS/AMD9500Controller" }; | ||
|
|
||
| static const char *idRadeonX3000New {"com.apple.kext.AMDRadeonX3000"}; | ||
|
|
@@ -51,6 +52,8 @@ static KernelPatcher::KextInfo kextRadeonLegacySupport | |
| { "com.apple.kext.AMDLegacySupport", pathLegacySupport, 1, {}, {}, KernelPatcher::KextInfo::Unloaded }; | ||
| static KernelPatcher::KextInfo kextPolarisController | ||
| { "com.apple.kext.AMD9500Controller", patchPolarisController, 1, {}, {}, KernelPatcher::KextInfo::Unloaded }; | ||
| static KernelPatcher::KextInfo kextRadeonServiceManager | ||
| { "com.apple.kext.AMDRadeonServiceManager", pathAMDRadeonServiceManager, 1, {}, {}, KernelPatcher::KextInfo::Unloaded }; | ||
| static KernelPatcher::KextInfo kextRadeonX6000Framebuffer | ||
| { "com.apple.kext.AMDRadeonX6000Framebuffer", pathRedeonX6000Framebuffer, arrsize(pathRedeonX6000Framebuffer), {}, {}, KernelPatcher::KextInfo::Unloaded }; | ||
|
|
||
|
|
@@ -125,6 +128,8 @@ void RAD::init(bool enableNavi10Bkl) { | |
| lilu.onKextLoadForce(&kextRadeonLegacySupport); | ||
| else | ||
| lilu.onKextLoadForce(&kextPolarisController); | ||
| // Try loading RadeonServiceManager to save loadIndex status in memory. | ||
| lilu.onKextLoad(&kextRadeonServiceManager); | ||
|
|
||
| initHardwareKextMods(); | ||
|
|
||
|
|
@@ -302,6 +307,21 @@ IOReturn RAD::wrapAMDRadeonX6000AmdRadeonFramebufferGetAttribute(IOService *fram | |
| return ret; | ||
| } | ||
|
|
||
| bool RAD::ifNeedOverrideConnector(KernelPatcher &patcher, size_t index, mach_vm_address_t address, size_t size) { | ||
| // No need to overwrite the connector when booting BaseSystem on macOS Tahoe. | ||
| // This step is unnecessary and will cause macOS Tahoe recovery mode to freeze when booting. | ||
| // Committed by laobamac | ||
| if (getKernelVersion() >= KernelVersion::Tahoe) { | ||
| if (kextRadeonServiceManager.loadIndex != index) { | ||
| return false; | ||
| } | ||
| else | ||
| return true; | ||
| } | ||
| else | ||
| return true; | ||
| } | ||
|
|
||
| bool RAD::processKext(KernelPatcher &patcher, size_t index, mach_vm_address_t address, size_t size) { | ||
| if (kextRadeonX6000Framebuffer.loadIndex == index) { | ||
| KernelPatcher::RouteRequest requests[] = { | ||
|
|
@@ -333,7 +353,10 @@ bool RAD::processKext(KernelPatcher &patcher, size_t index, mach_vm_address_t ad | |
| } | ||
|
|
||
| if (kextRadeonSupport.loadIndex == index) { | ||
| processConnectorOverrides(patcher, address, size, true); | ||
| // The abnormal start-up system does not cover the connector on Tahoe. | ||
| if (ifNeedOverrideConnector(patcher, index, address, size) != false) { | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. After we fix Lilu to correctly detect normal mode I believe the change here should look as follows: if (getKernelVersion() < KernelVersion::Tahoe
|| checkKernelArgument("-radconnector")
|| lilu.getRunMode() == LiluAPI::RunningNormal) {
processConnectorOverrides(patcher, address, size, true);
DBGLOG("rad", "processing override connector");
} else {
DBGLOG("rad", "skipping override connector");
}No other changes should be necessary.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I understand, do you mean to put the method that recognizes BaseSystemKernelExtendes.kc into Lilu's getRunMode?
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well, we could go this way if no better is found. Please make sure we guard it with macOS 26, so that we definitely do not regress on older operating systems. Ideally we want a lighter approach.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
But when Lilu.kext checks the running status, the root file system may not have been loaded yet, and using vfs_lookup at this time will cause a panic.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In this case I think we should find some other approach. Do you have an
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Unfortunately, ioreg only recorded BootKernelExtensions.kc. And there is no other obvious difference except BaseSystemKernelExtendes.kc.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmmm, could you upload one for me to think about it as well? If it contains private data, you could also e-mail me to vit9696 at pm dot me ^^
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
OK, Wait for me a moment, I will restart into Recovery and save one |
||
| processConnectorOverrides(patcher, address, size, true); | ||
| } | ||
|
|
||
| if (getKernelVersion() > KernelVersion::Mojave || | ||
| (getKernelVersion() == KernelVersion::Mojave && getKernelMinorVersion() >= 5)) { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ifNeedOverrideConnector is only ever called when index == kextRadeonSupport.loadIndex. Does this not have the affect of removing all connector patches in all Tahoe versions?