#
✕ nick:StanfordAppliedCyber[m]
#asahi-dev · 2026-07-02 07:52
StanfordAppliedCyber[m]but it's probably add some stuff to the existing driver with mostly stuff we understand
#asahi-dev · 2026-07-02 07:52
StanfordAppliedCyber[m]it may be slightly custom
#asahi-dev · 2026-07-02 07:52
StanfordAppliedCyber[m]yeah
#asahi-dev · 2026-07-02 07:50
StanfordAppliedCyber[m]yeah my chip already has the driver upstream :)
#asahi-dev · 2026-07-02 07:49
StanfordAppliedCyber[m]oh, nice, what wifi chip?
#asahi-dev · 2026-07-02 07:48
StanfordAppliedCyber[m]this is m3?
#asahi-dev · 2026-07-02 07:45
StanfordAppliedCyber[m]i don't think sptm is at all relevant to understanding hardware (other than the iommus obviously)
#asahi-dev · 2026-07-02 07:45
StanfordAppliedCyber[m]i'm extremely confident of that
#asahi-dev · 2026-07-02 07:45
StanfordAppliedCyber[m]sptm does zero mmio
#asahi-dev · 2026-07-02 07:44
StanfordAppliedCyber[m]hmmmm, well obviously i havent added t8140 support to that file, but i'd imagine that xnu takes care of thta for me
#asahi-dev · 2026-07-02 07:41
StanfordAppliedCyber[m]can you point me to some files in m1n1 or linux?
#asahi-dev · 2026-07-02 07:39
StanfordAppliedCyber[m]what are these configs?
#asahi-dev · 2026-07-02 07:38
StanfordAppliedCyber[m]well for obvious reasons i thought maybe my dart or uat handling wasn't good, ie, one of my endpoints was just messed up, some memory wasn't mapped properly, crash
#asahi-dev · 2026-07-02 07:37
StanfordAppliedCyber[m]sid 1/0
#asahi-dev · 2026-07-02 07:37
StanfordAppliedCyber[m]axi_req 0xe1243
#asahi-dev · 2026-07-02 07:37
StanfordAppliedCyber[m]err_status 0x80000008
#asahi-dev · 2026-07-02 07:36
StanfordAppliedCyber[m]SAPTAccessViolation addr=0x600
#asahi-dev · 2026-07-02 07:36
StanfordAppliedCyber[m]let me grab the exact crash right now so i don't say something wrong
#asahi-dev · 2026-07-02 07:35
StanfordAppliedCyber[m]the gpu firmware is crashing
#asahi-dev · 2026-07-02 07:35
StanfordAppliedCyber[m]this is a hypothesis to be clear
#asahi-dev · 2026-07-02 07:34
StanfordAppliedCyber[m]yes
#asahi-dev · 2026-07-02 07:34
StanfordAppliedCyber[m]here's what i know:
#asahi-dev · 2026-07-02 07:34
StanfordAppliedCyber[m]i don't have great answers here
#asahi-dev · 2026-07-02 07:34
StanfordAppliedCyber[m]no, this isn't something xnu does, i think it's something iboot is NOT doing
#asahi-dev · 2026-07-02 07:30
StanfordAppliedCyber[m]yeah i'll need it
#asahi-dev · 2026-07-02 07:27
StanfordAppliedCyber[m]i'm trying to figure it out right now
#asahi-dev · 2026-07-02 07:27
StanfordAppliedCyber[m]does BtpG or StpG or BlpP or S2xG ring a bell to anyone?
#asahi-dev · 2026-07-02 07:24
StanfordAppliedCyber[m]it appears that on a18 pro there's some sections of the preloaded firmware we have to patch otherwise agx crashes
#asahi-dev · 2026-07-02 01:20
StanfordAppliedCyber[m]i didn't try just accessing a bunch of other pages to try to flush the fabric that way, i suppose i should try that
#asahi-dev · 2026-07-02 01:20
StanfordAppliedCyber[m]also, i did try the dumb thing of just adding a sleep to the retype endpoint and that didn't solve the problem, unsurprisingly
#asahi-dev · 2026-07-02 01:08
StanfordAppliedCyber[m]or use breakpoints on the allocator and for specifically this call return some address, i suppose that also works
#asahi-dev · 2026-07-02 00:59
StanfordAppliedCyber[m]this has obvious risk though, and i'd like to see if anyone else has any better ideas before doing this
#asahi-dev · 2026-07-02 00:56
StanfordAppliedCyber[m]i did have one idea: figure out how xnu allocates pages and specifically where it gets the entropy, patch the entropy to some fixed value so that page allocation becomes deterministic, then in the sptm emulator make sure that page is always mapped NC forever
#asahi-dev · 2026-07-02 00:18
StanfordAppliedCyber[m]specifically the m3 just lacks the entire codepath that the a18 pro sptm binary has
#asahi-dev · 2026-07-02 00:02
StanfordAppliedCyber[m]i havent fully looked into how m3 sptm works, but i'm not optimistic we can just copy the m3 sptm method
#asahi-dev · 2026-07-02 00:00
StanfordAppliedCyber[m]also, i did look at the m3 sptm, and the answewr is that this endpoint just looks very different, the sysreg solution i thought worked earlier does in fact not work (i read the asm wrong)
#asahi-dev · 2026-07-01 23:58
StanfordAppliedCyber[m]also, the instruction meaning is speculative, we can't run it because it doesn't exist on m3 and the locked gxf isue on m4
#asahi-dev · 2026-07-01 23:56
StanfordAppliedCyber[m]for linux this isn't a problem because we'll just map the page nc to start and never change it, but i'm not quite sure how to hanle it here. the page changes every time so it's not like i can just add some hack that says "always mark X page as nc"
#asahi-dev · 2026-07-01 23:55
StanfordAppliedCyber[m]so it sticks around, and nondeterministically the soc fabric sees it and panics
#asahi-dev · 2026-07-01 23:55
StanfordAppliedCyber[m]but the error tells us there's some unexpected attributes. my hypothesis on what's going wrong is that some RW page was remapped to PAGE_TABLE_ALT, but there was some stale tag that's never flushed. this would normally be flushed by the custom gxf op, but we just can't do that
#asahi-dev · 2026-07-01 23:54
StanfordAppliedCyber[m]importantly, after the panic, if we dump the mappings for the faulting page, it's already marked NC (correctly)
#asahi-dev · 2026-07-01 23:53
StanfordAppliedCyber[m]PAGE_TABLE_ALT is the type for iommu owned page tables
#asahi-dev · 2026-07-01 23:53
StanfordAppliedCyber[m]this is nondeterministic, tit doesn't happen every time
#asahi-dev · 2026-07-01 23:52
StanfordAppliedCyber[m]well on about 50% of boots, we hit some error: UNEXP_RT_HIT_DIR from the command ncrdincri coming from the pmgr
#asahi-dev · 2026-07-01 23:51
StanfordAppliedCyber[m]obviously we can't run this on m4
#asahi-dev · 2026-07-01 23:51
StanfordAppliedCyber[m]basically, when SPTM retypes a page to type PAGE_TABLE_ALT, it runs the custom gxf instruction i mentioned earlier, which very likely does some cache maintainence stuff
#asahi-dev · 2026-07-01 23:50
StanfordAppliedCyber[m]i need some advice on how to handle an error involving the custom gxf intructions m4+ sptm added
#asahi-dev · 2026-07-01 01:00
StanfordAppliedCyber[m]yeah, the fix i thought worked earlier does indeed not work, and there's no obvious way to port the m3 solution to m4
#asahi-dev · 2026-07-01 00:14
StanfordAppliedCyber[m]it appears that cache maintainance in m3 vs m4 is extremely different
#asahi-dev · 2026-07-01 00:06
StanfordAppliedCyber[m]and my hypervisor works without it (with some ugly hacks admittedly)

plus ›