2022-07-17
00:11Catyre has joined #asahi-re
00:11Catyre has quit [Remote host closed the connection]
00:29doggkruse has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
01:45L1Q has quit [Ping timeout: 480 seconds]
02:55phiologe has joined #asahi-re
02:58PhilippvK has quit [Ping timeout: 480 seconds]
03:18RevHelix has quit [Quit: I am going to make my own channel, with blackjack and hookers!]
04:31chadmedrqou_: i gave up on touchid (mesa) if you wanna have a crack at that. it has a private interface to SEP that i _think_ might be impossible to snoop on from the HV and im not skilled enough to really go beyond what ive already pushed into m1n1 :/
04:33chadmedthe only data that is trafficked between it and the APs seems to be an encrypted command buffer of some kind to bring it up and tell it to wait for a fingerprint. everything else goes to the SEP
04:35chadmedand to really rub salt in the wound, tracing the SEP is too slow to reliably get anything useful. mesa seems to time out waiting for the SEP to tell it something which invalidates the input data and makes macos refuse to accept it
05:38nicolas17I always thought it was AP <-> SEP <-> mesa sensor, and no AP <-> mesa connection at all
05:38chadmedthe only repeatable and intelligible data is a bringup sequence (which seems to just be the APs asking if its awake)
05:39chadmedafter that the data is encrypted and changes on every boot (the format/packet size stays the same though which is why i think its an encrypted command buffer)
05:42nicolas17well how does the AP come up with that encrypted buffer? either it has some plaintext and encrypts it, or it gets encrypted data from (say) the SEP and forwards it
05:43chadmedtheres a few functions in one of the mesa drivers associated with encrypting and transmitting a command buffer
05:43chadmedBUT, theres also a much much smaller driver which is just a shim for the SEP interface and i think thats the one these machines use
05:45chadmedi could probably check without dicking around in m1n1 too but im like ~80% sure that its not the full fat driver
05:45chadmedand i say that because after the power on pings early in boot, theres no more data sent across the interface for a while then all of a sudden there is just encrypted commands
05:46chadmedand these are the only two DMA channels associated with mesa on the SPI bus so it _must_ be talking to the SEP over a private interface
05:49chadmedto effectively trace mesa i think we need to know a) the endpoint in the SEP the APs use to talk to it about mesa, and b) whatever interface mesa talks to the SEP over which might even just be staight up impossible idk
05:55chadmedif we sort of do the same thing apple does (use the SEP to mediate authentication) then we might not need to, but then touchid support is effectively blocked until we have SEP support
05:56chadmedwell my initial plan was to see if we could get fingerprint data out of mesa directly somehow and do it like that until the SEP works
05:57chadmedit does send some silly amount of data over SIO when your finger is on it, which i originally thought might be fingerprint data
06:01nicolas17rather the AP has to forward the data between them, but it's encrypted and the AP can't see what it is
06:01nicolas17https://support.apple.com/guide/security/face-id-and-touch-id-security-sec067eb0c9e/web
06:02nicolas17I'm not entirely sure, there's some ambiguity in the way this is written, or I'm too tired to read it confidently
06:04nicolas17if that's right, then you should see the encrypted garbage being sent to mesa actually came verbatim from the SEP, and viceversa, and the AP is just forwarding ciphertext back and forth
06:10nicolas17so in hardware/wiring it's not AP <-> SEP <-> mesa as I said earlier, rather it's SEP <-> AP <-> mesa; *but* it's encrypted end-to-end
06:19chadmedyeah there is some sort of negotiation sequence but ofc its encrypted. xnu seems to only load the sep shim driver too
06:21nicolas17so yeah I think if you're not seeing encrypted data coming from mesa and then immediately the *same* encrypted data going to the SEP, then the SEP trace is incomplete :)
06:23chadmedlike i said, tracing the sep at all results in it not working properly so yes i cannot see the data on the SEP <-> AP leg
06:26chadmedbecause the SEP is involved in basically everything and tracing it at all results in everything just slowing to an absolute crawl
06:26chadmedthe system takes about 15 or 20 minutes to get to a login screen then an equal amount of time to settle down after logging in until you can click anything
06:27chadmedthen you have the problem of getting into system settings to the touchid module and trying to get it to enrol a fingerprint
06:28chadmedi didnt even bother logging with the SEP tracer enabled, the volume of output is about on par with lina's gpu logs, probably worse
06:29chadmedi was still trying to figure out which EP is even mesa's so there was no point logging a bunch of undocumented garbage data
06:29chadmedi would hazard a guess that it is 0x18 since some XNU logs relating to AppleMesaSEPDriver appear just before EP 0x18 is announced as being enabled but that doesnt necessarily mean anything
06:45nicolas17 has quit [Ping timeout: 480 seconds]
06:56the_lanetly_052 has joined #asahi-re
07:59bisko has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
08:29marcanSEP can't possibly be quite as bad as lina's logs... she's logging *every single memory access from CPU to GPU-mapped memory*
08:36chadmedeither way i had a poke earlier and there were some messages on the sbio endpoint of SEP but _only_ immediately after taking your finger off the sensor and they had no data so there's still something missing somewhere
08:46svenyou probably want to disable SKS at least and there’s even a allowlist for endpoints already
08:55chadmedyeah i turned off SKS and its fast enough to interact with the sensor and macos is happy with it so thats cool
09:01rqou_is there a way to get m1n1 to break into the shell (and disassemble code) when a mmio register is written?
09:01rqou_i'm taking a look at avd, half of its regs overlap something mapped in pmgr for some reason, and i cannot for the life of me figure out where any of these registers are being written from
09:23bisko has joined #asahi-re
09:27the_lanetly_052 has quit [Ping timeout: 480 seconds]
09:35bisko has quit [Ping timeout: 480 seconds]
09:38bisko has joined #asahi-re
09:44bisko has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
09:48bisko has joined #asahi-re
10:01bisko has quit [Ping timeout: 480 seconds]
10:03bisko has joined #asahi-re
10:27Catyre has joined #asahi-re
10:27bisko has quit [Read error: Connection reset by peer]
10:33bisko has joined #asahi-re
10:35Catyre has quit [Ping timeout: 480 seconds]
10:42bisko has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
10:46MajorBiscuit has joined #asahi-re
11:15nehsou^ has joined #asahi-re
12:07MajorBiscuit has quit [Ping timeout: 480 seconds]
14:42nehsou^ has quit [Ping timeout: 480 seconds]
14:42Misthios has quit [Quit: Misthios]
14:43Misthios has joined #asahi-re
16:04marcanentirely possible that the first half is just pmgr stuff shoved into that driver for no good reason
16:26rqou_marcan: after some more poking, i think the thing is a "axi2af" block, with a bunch of tunables. unfortunately i can't seem to actually get the tunable data from the PMGR kext, because every tool i've tried chokes on what i assume is the macho chained fixup data (but might be a different problem)
16:29marcanyou could fake the read data as 000 and fff to get the masks, but tbh it probably doesn't matter much
16:30rqou_not sure if this can be handled in m1n1, the tunables might get lost when the device is power/clock gated?
16:31rqou_or maybe none of this is actually needed, i haven't tried actually poking the hardware yet
16:34rqou_the AVD kext definitely also makes calls into the AMCC driver to tune some caching behavior (do we understand any of that yet?)
16:36svenfwiw, sone atc tunables stick around even through a atc reset, but others have to be reapplied again and again
16:37svenand yet macOS applies them all again and again (and my driver too because if I have to apply some tunables I might as well apply them all)
16:41rqou_on a different topic, i didn't see anything whatsoever touch btcoex in the "converged ipc" kexts, so if that's the issue it's either a command sent from macos userspace or a problem on the wifi side
17:37rqou_ has quit [Ping timeout: 480 seconds]
17:53nicolas17 has joined #asahi-re
18:02nicolas17 has quit [Ping timeout: 480 seconds]
18:12svenafaict most of the fancy stuff happens inside BlueTool anyway (like firmware selection or sending the right calibration data)
18:12nicolas17 has joined #asahi-re
18:28MajorBiscuit has joined #asahi-re
18:28MajorBiscuit has quit []
18:37bisko has joined #asahi-re
18:50rqou_ has joined #asahi-re
21:04Catyre has joined #asahi-re
21:16Catyre has quit [Ping timeout: 480 seconds]
21:26Catyre has joined #asahi-re
22:00yrlf has quit [Quit: The Lounge - https://thelounge.chat]
22:16yrlf has joined #asahi-re
23:00Catyre has quit [Ping timeout: 480 seconds]