#asahi-dev · 2026-04-20 16:02
wilfredorunderstood, dropping the prose, observable result only, those AP MMIO writes fail from m1n1 stage1 with a stable L2C_ERR_STS signature; pmp_sram and 0x70000 remains writable via the same proxy; the alternatives I tested did not change that, ""fabric firewall” was shorthand for the observed filtering behavior, not a proven label#asahi-dev · 2026-04-20 15:56
wilfredorI've been discussing this previously and used something mentioned by chaos_princess, sven, and others in past comments as well#asahi-dev · 2026-04-20 15:55
wilfredoryou can check my username on google#asahi-dev · 2026-04-20 15:55
wilfredoronce you have gone through dozens of reboot cycles trying to outrun the five-second stage1 proxy window with tight-loop grabbers, watched every plausible register read back as zero, seen every alternate memory type get dropped, and had every guarded-el attempt collapse into the same L2C_ERR_STS signature#asahi-dev · 2026-04-20 15:53
wilfredorAfter spending weeks on this, on and off, I do not think the dead ends here are subtle anymore#asahi-dev · 2026-04-20 15:45
wilfredorsigned custom XNU in Permissive Security, which inherits that tag, or booting real macOS under m1n1 HV with a working rootfs so ApplePMPv2 can program the dashboard before control is taken back.#asahi-dev · 2026-04-20 15:45
wilfredorsame as our p.write64, with no MSR or MRS anywhere in the chain. The reason the kernel store works is that it carries an iBoot/SecureROM-assigned source tag that the fabric firewall accepts, and that tag cannot be changed from any reachable system register or execution level available in m1n1 stage1. So if the goal is T8103 deep sleep from m1n1 alone, these paths are dead ends; the only options that still make sense are a #asahi-dev · 2026-04-20 15:45
wilfredore filter; DAPF-PMP at 0x23b304000, which is unprogrammed and would not be able to block AP-originated MMIO stores anyway because DAPF filters DMA masters; and any “PMP, write this for me” path on endpoint 0x20, because a Capstone disassembly of _pmpWriteDashBoardSetDeviceState → _writePTD → regmap_write_u64 shows the kernel doing nothing more than a plain str x21, [mmio + 0x10000 + idx*8], byte-for-byte the #asahi-dev · 2026-04-20 15:45
wilfredorend ranges. We also ruled out a number of other explanations: writes from EL1, GL1, and GL2 via m1n1’s gxf primitives; all four memory-attribute aliases, Device-GRE, Device-nGRE, Device-nGnRnE, and Device-nGnRE; SPRR, GXF, SPR_LOCKDOWN, and CTRR as the gating mechanism, since all of them read back disabled or unlocked; AMCC KTRR RORGN at mcc reg[0] + 0x7e4/7e8/7ec, which reads as zero on T8103 and therefore is not th#asahi-dev · 2026-04-20 15:45
wilfredorver changes: L2C_ERR_STS=0x11000ffc00000080, with L2C_ERR_ADR showing a top nibble of 0x28100… for strongly ordered accesses, which raise a synchronous SError, and 0x30000… for everything else, which gets a silent NACK. This is not a blanket AP block on the whole PMP region, because pmp_sram + 0x70000, which is PMP __DATA, is writable through the same proxy, so the filter is clearly programmed with explicit base/#asahi-dev · 2026-04-20 15:45
wilfredorAs of April 2026, our negative results on the T8103 PMP-MMIO write gate are straightforward: direct AP writes from m1n1 stage1 to /arm-io/pmp reg[1] — the dashboard at 0x23b850000 + 0x10000 + idx*8 — as well as to pwrgate-regs at 0x23b71c010, 0x23b71c310, 0x23b71c610, and 0x23d29c010, and to PMGR main at 0x23b78c000+, do not land; they are silently dropped by a fabric firewall below L2. The failure signature ne#asahi-dev · 2026-04-16 14:25
wilfredorsee you#asahi-dev · 2026-04-16 14:25
wilfredorwhat I find, but first I need a break#asahi-dev · 2026-04-16 14:25
wilfredoroh ok ok so the register sequence is right.. and the reconfig engine is probably already set up by iboot, then I'll run the HV trace but focus on what PMGR writes happen during early boot (reconfig engine setup and lock), and what else macOS does around sleep beyond ACC_OVRD CYC_OVRD, if iBoot already handles the reconfig engine and the cpu-side sequence is correct, something in between is still missing. I'll report back with #asahi-dev · 2026-04-16 14:21
wilfredorchaos_princess: that changes things, if iBoot already programs the reconfig engine and locks it, then maybe the issue isn't the reconfig engine at all. mmm something else in my sleep entry is wrong or missing that prevents a proper wake, would it help to compare my ACC_OVRD CYC_OVRD setup against what xnu does in arm64_prepare_for_sleeep? or is there something else beyond those registers that i'm liikely missing?#asahi-dev · 2026-04-16 14:17
wilfredorthanks again chaos_princess! , i'll run it and share what I find#asahi-dev · 2026-04-16 14:16
wilfredorchaos_princess: so the missing piece is programming the reconfig engine before sleep, i already have an HV trace script ready to capture macOS sleep sequence, that should show the MMIO writes that program it. Also have the kernelcache extracted. Should I focus on the HV trace first, or is there a faster way, do you know where the reconfig engine registers live on T8103?#asahi-dev · 2026-04-16 14:14
wilfredorreconfig engine needs to be programmed with register write sequences BEFORE sleep and that code is likely in AppleARMPlatform.kext (btw not open-source XNU)#asahi-dev · 2026-04-16 14:12
wilfredorM1 wakes directly to RVBAR via reconfig engine#asahi-dev · 2026-04-16 14:11
wilfredorI found it in cpu.c, you are absolutely right#asahi-dev · 2026-04-16 14:06
wilfredorany specific file or subsyystem i should start with, or just grep for "reconfig"? #asahi-dev · 2026-04-16 14:05
wilfredorsorry i'm tired#asahi-dev · 2026-04-16 14:04
wilfredorisn't a normal ARM#asahi-dev · 2026-04-16 14:04
wilfredori didn't look into the reconfig engine at all. So what I observed was probably not a real wake, just a reset that I mistook for wake. Do you know where the reconfig engine is documented or where to find its registers on T8103? i need to understand what state it needs before sleep entry so cores actually resume at RVBAR, i spent severals hours tracing this assuming standard ARM wake behavior and Apple keeps #$@$# me, this #asahi-dev · 2026-04-16 13:58
wilfredorjannau: DRAM does stay powered in my tests (framebuffer survived across wake), so it is sleep, not hibernate, the issue is iBoot still runs full cold boot init on wake even though DRAM is preserved. macOS must signal iBoot somehow to take a resume path instead of reinit#asahi-dev · 2026-04-16 13:56
wilfredoryes you're right, it's effectively a reset, iBoot does full cold boot on wake, but DRAM does stay powered (framebuffer survived), so the hardware can preserve state, but without telling iBoot to resume instead of cold boot, it just reinits everything, that's why I want to HV-trace macOS sleep, to see how it signals iBoot to take the resume path instead of cold boot#asahi-dev · 2026-04-16 13:54
wilfredorT8103 addresses ARE different from T600x (M1 Pro/Max) #asahi-dev · 2026-04-16 13:53
wilfredortested deep sleep on T8103. Key finding, wake doesn't go through RVBAR. iBoot runs full cold boot reinit on power button wake, DRAM overwritten, all scratch cleared, PMGR state identical to cold boot. So trampoline approach can't work. Wake path has to go through iBoot, like macOS does with hibernate image. Planning to HV-trace macOS sleep to understand how iBoot detects wake vs cold boot internally#asahi-dev · 2026-04-16 13:51
wilfredorchaos_princess: one concrete T8103 difference — those wake event mask registers you write at 0x292004008-0x29200401c on T600x don't exist on T8103. Scanned full PMGR range, found 70 events but all performance/thermal counters, none writable as wake masks. Wake source filtering on T8103 seems entirely internal to SMC. Working on HV-tracing macOS sleep to confirm#asahi-dev · 2026-04-14 19:20
wilfredorI underestand, sorry about that, I have a M1 and a second machine for USB serial, I'll set up the HV, trace myself and capture the T8103 wake masks from macOS sleep, will post results when I have them#asahi-dev · 2026-04-14 19:16
wilfredorclaude is your friend (not google)#asahi-dev · 2026-04-14 19:15
wilfredorsven or chaos_princess, has anyone traced the T8103 PMGR wake event mask registers? On T600x they're at 0x292004008-0x292004020, but i need the T8103 equivalents to complete full system sleep (MBSE path), btw i have an HV trace script ready but wanted to check if this has already been captured, repo with the scripts: https://github.com/wilfredor/m1-deepsleep#asahi-dev · 2026-04-14 17:43
wilfredoron Fedora 43 Asahi Remix, kernel 6.18.15, Apple M1 16GB RAM#asahi-dev · 2026-04-14 17:39
wilfredor ▎ is garbage after reset). Repo if useful: https://github.com/wilfredor/m1-deepsleep it was tested manually #asahi-dev · 2026-04-14 17:39
wilfredor ▎ after MBSE — writes to gated MMIO stall the bus on Apple Silicon, which matches the silent freeze. I adapted the scripts for T8103 with a trampoline that writes to #asahi-dev · 2026-04-14 17:39
wilfredor ▎ mini-PMGR scratch (always-on domain) before touching UART, so after a failed wake you can reboot and check if the core actually reached RVBAR. Also fixed the ret (LR#asahi-dev · 2026-04-14 17:39
wilfredorchaos_princess, I went through your sleep scripts and traced the wake path in m1n1 (smp.c, pmgr.c, cpu_regs.h). I think the trampoline at RVBAR hangs because UART is clock-gated #asahi-dev · 2026-04-13 23:10
wilfredorok, I'm done for today#asahi-dev · 2026-04-13 23:09
wilfredorm1n1/src/smp.c - deep_wfi() loop with SYS_IMP_APL_IPI_SR_EL1 handling, and aic.c MASK_SET/MASK_CLR interrupt configuration. The register at 0x292004018 controls interrupt masking#asahi-dev · 2026-04-13 23:04
wilfredorI used research tools for investigation and logical deduction, but the analysis is mine, saves a lot of time on tests#asahi-dev · 2026-04-13 23:00
wilfredorlet RTKit stay in default state while CPU goes deep#asahi-dev · 2026-04-13 22:59
wilfredorRTKit driver shows apple_rtkit_wake() requires active RTKit firmware, the wake path is mailbox-based, not interrupt-based#asahi-dev · 2026-04-13 22:57
wilfredor*try#asahi-dev · 2026-04-13 22:57
wilfredor0x29200401c is the wake-source control, writing 0xffffffff blocks all wake paths, please ry leaving ONE bit open (0xfffffffe, 0xfffffffb, 0xfffffff7, etc.) to allow SMC wake while keeping deep sleep#asahi-dev · 2026-04-13 22:51
wilfredorjust delete this line orr x1, x1, #CYC_OVRD_DISABLE_WFI_RET #asahi-dev · 2026-04-13 22:49
wilfredorinstead of interrupt-based, use the actual macOS mechanism (SMC RTKit Mailbox Protocol )#asahi-dev · 2026-04-13 22:47
wilfredoryour register sequence matches macos, but you're missing the power-gate override register setup and AIC interrupt masking configuration, full power-down (DISABLE_WFI_RET) won't wake interrupt-style, you need retention mode and interrupt routing#asahi-dev · 2026-04-13 22:18
wilfredorIs there a different wake mechanism (not interrupt-based) that works with DISABLE_WFI_RET?#asahi-dev · 2026-04-13 22:17
wilfredorIMHO the flow should be CPU enters WFI → Interrupt arrives → CPU EXITS WFI → Executes wake_handler → wake_handler restores ACC_OVRD registers to normal state → CPU works again#asahi-dev · 2026-04-13 22:17
wilfredorhttps://pastebin.com/raw/PQSzwUAa