#
✕ nick:phire
#asahi-gpu · 2022-02-07 23:21
phireI'm supicious the comunication channel is simply not listed in ADT
#asahi-gpu · 2022-02-07 23:20
phiremarcan: how would you feel if I had to RE the AGXG13X kext? Because I'm really lost and not finding the communication channel that gpu work is submitted over
#asahi-gpu · 2022-02-07 23:12
phireyes, I raised my eyebrows when I realised that. The pagetages controlling the 0xffffff8000000000 range get mapped into UAT too
#asahi-gpu · 2022-02-07 23:09
phiremarcan: yeah, the UAT iommu is "unified" and covers the ASC stuff (at 0xffffff8000000000) and the gpu allocations from userspace (useally at around 0x1500000000)
#asahi-gpu · 2022-02-07 09:31
phireoh, it's the firmware from iboot
#asahi-gpu · 2022-02-07 09:07
phirequite a few of them, actually
#asahi-gpu · 2022-02-07 09:07
phireIf so, the gpu firmware has already initilized a bunch of page tables. Some of them point into phyisical memory
#asahi-gpu · 2022-02-07 09:04
phirewith only two entries in L0
#asahi-gpu · 2022-02-07 09:04
phirewait... this might actually be single four level page table
#asahi-gpu · 2022-02-07 07:43
phireslightly annoying for writing a driver, we will have to understand and recreate this initilzation struct to make the firmware happy
#asahi-gpu · 2022-02-07 07:15
phirewell, something is responding to ASC messages on boot, I assume that's the firmware
#asahi-gpu · 2022-02-07 07:15
phirehow do I decode segment ranges?
#asahi-gpu · 2022-02-07 07:14
phireI think it's actually CPU controlled
#asahi-gpu · 2022-02-07 07:14
phireThis is an address that has been mapped in via UAT
#asahi-gpu · 2022-02-07 07:12
phirebig 0x88000 byte region
#asahi-gpu · 2022-02-07 07:12
phireI think this area that I'm seeing changing is the firmware's heep, or stack
#asahi-gpu · 2022-02-07 07:05
phireWARNING: Waiting for space to add statistics! Consider resizing buffer or adjust interrupt heuristics
#asahi-gpu · 2022-02-07 07:03
phireBuild version: B0
#asahi-gpu · 2022-02-07 07:03
phireBuild variant: X
#asahi-gpu · 2022-02-07 07:03
phireG13 Firmware initializing
#asahi-gpu · 2022-02-07 07:03
phireGFX Tempest-ASC4.1 FW cold booted! (Jan 11 2022 20:36:18)
#asahi-gpu · 2022-02-07 05:56
phireThats RTKSTACK repeated
#asahi-gpu · 2022-02-07 05:55
phireffffffa000031f00 00000001 00000001 00000000 00000000 00000000 4b430000 534b5452 4b434154
#asahi-gpu · 2022-02-07 05:55
phireffffffa000031f20 534b5452 4b434154 534b5452 4b434154 534b5452 4b434154 00000001 00000002
#asahi-gpu · 2022-02-07 05:55
phireOr... I should expand the monitoring area
#asahi-gpu · 2022-02-07 05:26
phireI might have to monitor all changes to the entire (mapped) gpu va space
#asahi-gpu · 2022-02-07 05:25
phire(16kb aligned)
#asahi-gpu · 2022-02-07 05:24
phirean 8bit value that counts up, and what might be the lower 32bits of a VA address
#asahi-gpu · 2022-02-07 05:23
phirebad news: The amount of infomation changing in this control stuct is still a bit limited
#asahi-gpu · 2022-02-07 05:23
phiregood news: I have the "control struct", I can easily read memory, I can monitor changes to it
#asahi-gpu · 2022-02-06 21:55
phireit also maps in some ranges I don't reconise: 0x20e100000, 0x28e494000, 0x204d60000, 0x200000000, 0x201000000, 0x202000000, 0x203000000, 0x204000000, 0x205000000, 0x206000000, 0x207000000, 0x2643c4000, 0x28e3d0000, 0x28e3c0000
#asahi-gpu · 2022-02-06 21:49
phirethat is the sgx's register range
#asahi-gpu · 2022-02-06 21:48
phire0xffffffa010000000-0xffffffa010003fff -> 0x404d00000
#asahi-gpu · 2022-02-06 21:48
phirethis pagetable also maps IO registers into it
#asahi-gpu · 2022-02-06 21:46
phireand the only address that gets sent over ASC (which must be our control structure) is 0xfa0000b0000
#asahi-gpu · 2022-02-06 21:45
phirethe gfx-shared-region + 0x10 page table is actually a L2 leaf, that gets inserted to cover the range starting at 0xffffffa000000000
#asahi-gpu · 2022-02-06 18:13
phireThis is probally another thing where there are registers on the sgx interface that control all this, but there is an ASC firmware in the middle
#asahi-gpu · 2022-02-06 18:06
phirethat structure must be global, since the ASC message doesn't have a context id
#asahi-gpu · 2022-02-06 18:02
phirewith the amount of entropy I've got, that's the best susgestion
#asahi-gpu · 2022-02-06 18:00
phireand you send a message via ASC to tell it which one to execute
#asahi-gpu · 2022-02-06 18:00
phireMy current theory is that there is some kind of memory structure with a list of command lists
#asahi-gpu · 2022-02-06 17:55
phireyeah, we can probally ignore that for now. right now I want to know how userspace command lists get executed
#asahi-gpu · 2022-02-06 17:45
phirethe other page table (at gfx-shared-region + 0x10) might be for context -1, which shows up in logs
#asahi-gpu · 2022-02-06 17:27
phirecontains pointers to the page table for each context
#asahi-gpu · 2022-02-06 17:26
phireok... gpu-region is the context table
#asahi-gpu · 2022-02-06 17:09
phireHey, this page table is actually 3 layers deep, and points at real-looking data
#asahi-gpu · 2022-02-06 04:42
phireWeird... the only interrupt actually in use across both /arm-io/sgx and /arm-io/gfx-asc is the asc interrupt
#asahi-gpu · 2022-02-06 02:10
phirethere are also carveouts there
#asahi-gpu · 2022-02-06 02:09
phireI think that just comes from ADT
#asahi-gpu · 2022-02-06 02:07
phirethe cache coherrency protocol could theortically tell the gpu firmware that memory has been updated, but that's a really janky hack

plus ›