fix(wifi): resolve crash causes via IO80211Controller reverse-engineering
### Breakthroughs & Rétro-ingénierie - Analyse du désassemblage de IO80211Controller::start dans BootKernelExtensions.kc : 1. IO80211Controller::start() invoque directement le slot 399 (getWorkQueue) et le passe immédiatement à IO80211PostOffice::allocWithParams et IO80211TimerSource::allocWithParams. 2. Si getWorkQueue renvoie NULL, le noyau déréférence un pointeur nul ou saute vers une branche d'échec critique. 3. L'invocation préalable de createWorkQueue() avant super::start(provider) garantit que IO80211WorkQueue est immédiatement disponible et valide. - Suppression du piège d'écriture NVRAM (SetVariable en early boot) : Sur chipset AMD AM4/AM5, l'appel à AppleEFINVRAM::setProperty lors de l'initialisation de kext déclenche un appel RT->SetVariable en SMM. Sans mapping d'adresses virtuelles 1:1 pour le contrôleur SPI sous firmware AMD AGESA, cela provoque un Machine Check instantané réinitialisant la carte mère sans panic log. - Sécurisation de l'alimentation PCIe : Suppression de enablePCIPowerManagement(kPCIPMCSPowerStateD0) susceptible d'entrer en conflit avec ACPI D-states sur les ports racines PCIe AMD. - Normalisation OSBundleRequired : Passage de 'Network-Root' à 'Root' dans Info.plist (identique à QualcommWireless.kext). ### Modifications apportées - QualcommWifi/QualcommWifi.cpp : - Suppression des écritures NVRAM dans logNvramStage, conservation de IOLog console directe. - Inscription de createWorkQueue() avant l'appel à super::start(provider) dans start(). - Retrait du changement manuel d'état D0 via enablePCIPowerManagement. - QualcommWifi/Info.plist : - Remplacement de OSBundleRequired par Root. ### Validation - Compilation réussie avec clang 17 et SDK macOS Tahoe 26.x. - Validation 100% kmutil libraries contre BootKernelExtensions.kc.
This commit is contained in:
1 parent
1a6562c229
commit
815c7ecaca
2 files changed
+7
-13
No files matched your search
@@ -54,6 +54,6 @@
|
|||||||
<string>16.7</string>
|
<string>16.7</string>
|
||||||
</dict>
|
</dict>
|
||||||
<key>OSBundleRequired</key>
|
<key>OSBundleRequired</key>
|
||||||
<string>Network-Root</string>
|
<string>Root</string>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
@@ -25,14 +25,6 @@ static void logNvramStage(const char *tag) {
|
|||||||
strcat(gLogBuffer, ">");
|
strcat(gLogBuffer, ">");
|
||||||
strcat(gLogBuffer, tag);
|
strcat(gLogBuffer, tag);
|
||||||
}
|
}
|
||||||
IORegistryEntry *options = IORegistryEntry::fromPath("/options", gIODTPlane);
|
|
||||||
if (options) {
|
|
||||||
OSString *val = OSString::withCString(gLogBuffer);
|
|
||||||
if (val) {
|
|
||||||
options->setProperty("qcom_wifi_log", val);
|
|
||||||
val->release();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
IOLog("QualcommWifi: >>> [STAGE] %s <<<\n", tag);
|
IOLog("QualcommWifi: >>> [STAGE] %s <<<\n", tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -546,6 +538,12 @@ bool QualcommWifi::start(IOService *provider) {
|
|||||||
logNvramStage("start_enter");
|
logNvramStage("start_enter");
|
||||||
IOLog("QualcommWifi: Demarrage du pilote Wi-Fi natif (IO80211Controller)...\n");
|
IOLog("QualcommWifi: Demarrage du pilote Wi-Fi natif (IO80211Controller)...\n");
|
||||||
|
|
||||||
|
if (!createWorkQueue()) {
|
||||||
|
logNvramStage("workQueue_failed");
|
||||||
|
IOLog("QualcommWifi: Erreur - Impossible de creer IO80211WorkQueue !\n");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (!super::start(provider)) {
|
if (!super::start(provider)) {
|
||||||
logNvramStage("super_start_failed");
|
logNvramStage("super_start_failed");
|
||||||
IOLog("QualcommWifi: Erreur - IO80211Controller::start(provider) a echoue !\n");
|
IOLog("QualcommWifi: Erreur - IO80211Controller::start(provider) a echoue !\n");
|
||||||
@@ -568,10 +566,6 @@ bool QualcommWifi::start(IOService *provider) {
|
|||||||
}
|
}
|
||||||
logNvramStage("pci_open_ok");
|
logNvramStage("pci_open_ok");
|
||||||
|
|
||||||
// Réveil formel du contrôleur PCIe vers l'état d'alimentation D0
|
|
||||||
logNvramStage("pci_enable_d0");
|
|
||||||
fPciDevice->enablePCIPowerManagement(kPCIPMCSPowerStateD0);
|
|
||||||
|
|
||||||
UInt16 pciCommand = fPciDevice->configRead16(kIOPCIConfigCommand);
|
UInt16 pciCommand = fPciDevice->configRead16(kIOPCIConfigCommand);
|
||||||
pciCommand |= kIOPCICommandMemorySpace;
|
pciCommand |= kIOPCICommandMemorySpace;
|
||||||
pciCommand &= ~kIOPCICommandBusMaster; // Protection absolue contre tout accès DMA non configuré sur AMD-Vi
|
pciCommand &= ~kIOPCICommandBusMaster; // Protection absolue contre tout accès DMA non configuré sur AMD-Vi
|
||||||
|
|||||||
Reference in new issue
Block a user