From 92ce7e78394604b87635c14f026ea87c24b877d9 Mon Sep 17 00:00:00 2001 From: Erwan Date: Sun, 18 Oct 2026 23:56:32 +0200 Subject: [PATCH] =?UTF-8?q?fix(wifi):=20r=C3=A9tablir=20l'allocation=20d?= =?UTF-8?q?=C3=A9di=C3=A9e=20IOWorkLoop=20et=20s=C3=A9curiser=20la=20journ?= =?UTF-8?q?alisation=20NVRAM?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Breakthroughs & Rétro-ingénierie : * Analyse de la cause racine de la bootloop observée même avec qcom_step=5 : l'alias createWorkLoop() vers createWorkQueue() retournait un IO80211WorkQueue* dans getWorkLoop(), provoquant un kernel panic immédiat dans IONetworkController::start(provider) par déréférencement de vtable invalide. * Confirmation matérielle NVRAM : la variable UEFI 'qcom_stage' valait exactement 'createWorkQueue', prouvant que l'échec survenait à la première seconde de boot avant même d'arriver au Stade 1. * Confirmation de la non-volatilité : le passage sous Linux n'efface absolument pas la NVRAM SPI Flash de la carte mère. * Suppression de kprintf() qui pouvait engendrer des traps/spinlocks en early boot. - Modifications apportées : * QualcommWifi/QualcommWifi.cpp : réintégration de l'allocation dédiée fWorkLoop = IOWorkLoop::workLoop() et du getter getWorkLoop(), suppression de kprintf dans logNvramStage(). - Validation : * Compilation sans erreur avec ./build_wifi.sh. * Validation kmutil libraries réussie à 100% contre BootKernelExtensions.kc. --- QualcommWifi/QualcommWifi.cpp | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/QualcommWifi/QualcommWifi.cpp b/QualcommWifi/QualcommWifi.cpp index 313e0dd..1401092 100644 --- a/QualcommWifi/QualcommWifi.cpp +++ b/QualcommWifi/QualcommWifi.cpp @@ -19,11 +19,8 @@ extern "C" { #include #include -extern "C" void kprintf(const char *format, ...); - static inline void logNvramStage(const char *tag) { IOLog("QualcommWifi: >>> [STAGE] %s <<<\n", tag); - kprintf("QualcommWifi: >>> [STAGE] %s <<<\n", tag); if (tag) { PEWriteNVRAMProperty("qcom_stage", tag, (unsigned int)strlen(tag)); } @@ -1013,12 +1010,23 @@ IORecursiveLock* QualcommWifi::allocIO80211RecursiveLock(void) { } bool QualcommWifi::createWorkLoop(void) { - logNvramStage("createWorkLoop_alias"); - return createWorkQueue(); + logNvramStage("createWorkLoop"); + if (fWorkLoop) { + return true; + } + fWorkLoop = IOWorkLoop::workLoop(); + if (!fWorkLoop) { + logNvramStage("workLoop_alloc_failed"); + IOLog("QualcommWifi: Erreur - Impossible d'allouer IOWorkLoop !\n"); + return false; + } + logNvramStage("workLoop_ok"); + IOLog("QualcommWifi: IOWorkLoop allouee avec succes (0x%p) !\n", fWorkLoop); + return true; } IOWorkLoop* QualcommWifi::getWorkLoop(void) const { - return (IOWorkLoop*)fWorkQueue; + return fWorkLoop ? fWorkLoop : (getProvider() ? getProvider()->getWorkLoop() : nullptr); } IOReturn QualcommWifi::getHardwareAddress(IOEthernetAddress *addrP) {