ChanServ changed the topic of #asahi-gpu to: Asahi Linux: porting Linux to Apple Silicon macs | GPU / 3D graphics stack black-box RE and development (NO binary reversing) | Keep things on topic | GitHub: https://alx.sh/g | Wiki: https://alx.sh/w | Logs: https://alx.sh/l/asahi-gpu
<phire>
oh this is cool, I can see it sending the gpu_va and size of my userspace allocations to the gpu firmware
<phire>
probally a cache flush or memory clear command
m6wiq has quit []
<alyssa>
:'D
<phire>
but this communication protocol is a bit weird
<phire>
it writes the VA to gfx-handoff+0xa0, the size to +0xa8 and then writes 2 to 0x98
<phire>
then somehow the gpu firmware knows to read that shared memory
<phire>
then I think an interupt comes back and the cpu sets gfx-handoff+0x98 back to 0
<phire>
I need to work out how to trace interrupts
<alyssa>
phire: Naively, I would assume Apple uses ASC messages in place of direct interrupts
<alyssa>
(Of course ASC fifo non-empty is an IRQ but Abstraction)
<phire>
there is very little traffic going across the gpu firmware's ASC
<phire>
it's bugging me
<alyssa>
Hmm
<alyssa>
to confirm you're looking both sgx and gfx-asc together?
<phire>
sgx has even less register traffic than gfx-asc
<alyssa>
Curious
<phire>
and it's only reads
<alyssa>
right :|
<alyssa>
we're certain gfx-handoff is ordinary shared memory and not somehow special / MMIO?
<phire>
It's possible the firmware gets an interrupt every time there is a write to it
<phire>
but I do think it's real memory
<alyssa>
Alright
<alyssa>
what is the ASC traffic, then?
<phire>
gpu sometimes sends 0x43 on EP20
<phire>
cpu sometimes sends 0x83 with a 8bit value on EP21
<alyssa>
what endpoints are those?
<phire>
I don't have names for them
<alyssa>
mind pastebinning the output of `ioreg -l`?
<alyssa>
I meant darts being grouped with the handoff
<phire>
there are also carveouts there
baddek has joined #asahi-gpu
<baddek>
` ्बहवDड i डd u` sड a t r डa iड n , & s uड p `pl y i डs ड` i s wi th w e. aड .p o डn s l i k e i t d i d w i t h a. l ड q. a डe d a to j. u sडt i f y c r e a डt i n g w. aड r s C. R Eड A Tड I V E C .H डAO S- d i d cड i` a d i d 9.डड11 . or, i
<baddek>
if . a. l ड q. a डe d a / ` d्i ्d ..it w h y , ` t o k `गi lग l 9 . m i जl` जl i on . i r` a q i s
<baddek>
e e a सs t
<baddek>
t j u डs t l e t ` it h aड pड pड en * .. a m e ड r i c` a n s ne eसd e d someसthiसng l i k e 9.स 1 1 to j /u sस t i f y i nस v `a dस i n g .i सr /a सq ` w h i c h/ has b e e n ...alrसea dy p l a n स n e d as a p art of c rस e/ a t सi v e c hस a` o s p l a n for . m i d सd l
baddek has quit [Excess Flood]
<baddek>
a b o u t 9 m `il तi o n - iहr a ह`q i l o s t ` thल e i r li`ल vलes e i th e r be ca uz . o f di्r e ct ameri`can vi्ol e`nce ` and .. .beca uz /of si ्e`ge . u दs दa ma de . a`g दa iदn s t i दrद aद q t h at pr eदveद nt ed iद r aद qi f or m es se nt ial ` l i v i n g ` ma
bisko has quit [Server closed connection]
bisko has joined #asahi-gpu
PhilippvK has joined #asahi-gpu
phiologe has quit [Ping timeout: 480 seconds]
darkapex has quit [Ping timeout: 480 seconds]
<phire>
Weird... the only interrupt actually in use across both /arm-io/sgx and /arm-io/gfx-asc is the asc interrupt
jbowen has quit [Ping timeout: 480 seconds]
threerik[m] has quit [Server closed connection]
threerik[m] has joined #asahi-gpu
_jannau_ has quit [Server closed connection]
_jannau_ has joined #asahi-gpu
jbowen has joined #asahi-gpu
jbowen has quit [Ping timeout: 480 seconds]
sheepgoose has joined #asahi-gpu
al3xtjames has quit [Quit: al3xtjames]
al3xtjames has joined #asahi-gpu
jbowen has joined #asahi-gpu
mini has quit [Server closed connection]
mini has joined #asahi-gpu
mattmurr[m] has quit [Server closed connection]
mattmurr[m] has joined #asahi-gpu
jbowen has quit [Ping timeout: 480 seconds]
darkapex has joined #asahi-gpu
jbowen has joined #asahi-gpu
jbowen has quit [Ping timeout: 480 seconds]
jbowen has joined #asahi-gpu
jbowen has quit [Ping timeout: 480 seconds]
NotHere[m] has quit [Server closed connection]
NotHere[m] has joined #asahi-gpu
jbowen has joined #asahi-gpu
nsklaus has joined #asahi-gpu
rethematrix[m] has quit [Server closed connection]
Tuff has quit [Read error: Connection reset by peer]
m6wiq has joined #asahi-gpu
jbowen has joined #asahi-gpu
jbowen has quit [Ping timeout: 480 seconds]
m6wiq has quit [Remote host closed the connection]
m6wiq has joined #asahi-gpu
<phire>
Hey, this page table is actually 3 layers deep, and points at real-looking data
Major_Biscuit has joined #asahi-gpu
jbowen has joined #asahi-gpu
blassphemy[m] has joined #asahi-gpu
<phire>
ok... gpu-region is the context table
<phire>
contains pointers to the page table for each context
jbowen has quit [Ping timeout: 480 seconds]
<alyssa>
🎉
<phire>
the other page table (at gfx-shared-region + 0x10) might be for context -1, which shows up in logs
<alyssa>
context -1, hm
<phire>
yeah, we can probally ignore that for now. right now I want to know how userspace command lists get executed
<alyssa>
*nod*
<alyssa>
On Mali it's as easy as "write an address to a register and write the START command to the command register"
<alyssa>
I imagine AGX has a lot more indirection.
<phire>
My current theory is that there is some kind of memory structure with a list of command lists
<phire>
and you send a message via ASC to tell it which one to execute
<alyssa>
that would be guess, yes
<phire>
with the amount of entropy I've got, that's the best susgestion
<phire>
that structure must be global, since the ASC message doesn't have a context id
* alyssa
nods
* alyssa
should get back to coding instead of randomly perusing gitlab idly
<phire>
This 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
<alyssa>
nod
Major_Biscuit has quit [Ping timeout: 480 seconds]
* alyssa
powers the mac back on
jbowen has joined #asahi-gpu
<alyssa>
i must say it'll be nice finally having 3D accel on linux
jbowen has quit [Ping timeout: 480 seconds]
jbowen has joined #asahi-gpu
m6wiq1 has joined #asahi-gpu
jbowen has quit [Ping timeout: 480 seconds]
m6wiq has quit [Ping timeout: 480 seconds]
<alyssa>
okay i swear i'm starting again i'm just real good at not doing things
<phire>
it also maps in some ranges I don't reconise: 0x20e100000, 0x28e494000, 0x204d60000, 0x200000000, 0x201000000, 0x202000000, 0x203000000, 0x204000000, 0x205000000, 0x206000000, 0x207000000, 0x2643c4000, 0x28e3d0000, 0x28e3c0000
Tuff has joined #asahi-gpu
Tuff has quit []
akemin_dayo has joined #asahi-gpu
msinkovics has joined #asahi-gpu
msinkovics has left #asahi-gpu [#asahi-gpu]
user982492 has joined #asahi-gpu
m6wiq has quit []
jbowen has joined #asahi-gpu
<Tramtrist>
i was amazed at everything you were doing there alyssa from the dev environment on up