#
…

2021-08-28

00:02yuyichao has quit [Ping timeout: 480 seconds]
01:19alyssaBUG_ONs be fun
01:20Emantor has quit [Quit: ZNC - http://znc.in]
01:20Emantor has joined #asahi-dev
01:25alyssa oh derp
01:29alyssaokay this next one will take some thought to resolve
01:34DarkShadow44 has quit [Quit: ZNC - https://znc.in]
01:46DarkShadow44 has joined #asahi-dev
01:47DarkShadow44 has quit [Quit: ZNC - https://znc.in]
01:51JTL has quit [Quit: WeeChat 2.9]
01:51JTL has joined #asahi-dev
01:54DarkShadow44 has joined #asahi-dev
02:07Chainsaw has quit [Read error: Connection reset by peer]
02:07Chainsaw has joined #asahi-dev
02:36alyssaOh, nice. DCP should be alive now.
02:36alyssaGuess tomorrow will try to swap my first frame with DCP then.
02:37alyssamarcan: DCP is surprisingly forgiving of questionable input, btw
02:37alyssaw/e, not complaining
02:38alyssabut, e.g. I think the random kernel VA floating around in the DCP shmem are opaque handles for XNU to use later / as debug / something like that.
02:38alyssaat least on my version of dcp fw, zeroing out the addr field in mgr.swap_start works fine
02:39alyssathe userspace<--->kernelspace ABI for IOGPU does this sort of thing (with opaque userspace VAs flying around), could be similar
02:39alyssaalthough there are of course extant security questions regardless of its use, if we allow the possibility of malicious coprocessor firmware
02:39alyssa(and if we don't allow that possibility, why use a DART?)
02:42quarkyalice has quit [Remote host closed the connection]
02:43quarkyalice has joined #asahi-dev
02:50alyssa(I *am* quite curious about Apple's threat model for coprocessors, which necessarily is different from our own.)
03:02PhilippvK has joined #asahi-dev
03:05phiologe has quit [Ping timeout: 480 seconds]
04:47amw has quit [Ping timeout: 480 seconds]
05:28amw has joined #asahi-dev
06:32marcanalyssa: remember all of this is deadline-driven development
06:32marcandon't try to find rational reasons for the design choices
06:32marcanthe answer is always "it was rushed"
06:32marcanthe threat model is obviously that copros shouldn't ever see kernel VAs and the kernel shouldn't ever trust copros
06:32marcan... whether they managed to stick to that is another story
06:33marcanif you look at IOSurface - those 64-bit bools are hidden pointers to the previous embedded fields
06:34marcanthe marshaling code turns them into a bool to signify non-nullness and then on the other side puts back the pointer to the preceding structure
06:34marcanso evidently they don't *intend* to leak kernel pointers
06:35marcanyes, I fully expected the swap_start pointer to be total BS
06:35marcanI only had that in because copypasta :p
06:35marcanit's probably completely ignored
06:35marcanremember this is an API that used to be local that has been shoved across a CPU boundary
06:36marcanleaking kernel VAs breaks kASLR if a copro is compromised, and apple are big on kASLR, so that is definitely not intended
06:48chadmed has quit [Remote host closed the connection]
06:48chadmed has joined #asahi-dev
06:49bisko has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
07:55quarkyalice has quit [Remote host closed the connection]
07:58quarkyalice has joined #asahi-dev
08:12svenmarcan: i think that physical address reply to the crashlog request is a bug as well btw.
08:12sveni can just not reply and crashlogs will still work fine
08:15aleasto has joined #asahi-dev
08:38nico_32 has quit [Ping timeout: 480 seconds]
08:40marcanyeah, it doesn't make much sense does it?
08:40marcanbut I wonder how they managed that, heh
08:41marcanmaybe a path out of a function not returning anything?
08:41marcanor just they translate it in-place then unconditionally return or something
08:41marcankinda weird
08:41pipcet[m]I assume the crashlog location is locked somehow and you can't change it from its locked iova?
08:41marcaneither it's preallocated or it isn't
08:41marcanif it's preallocated there's no function to change it, so you can't
08:43svenyeah, i dunno how the managed to mess that up
08:43svenespecially (well, on SMC at least) the syslog does it correctly: it gets an address and never replies.
08:46nico_32 has joined #asahi-dev
08:48jbowen has joined #asahi-dev
08:56jbowen has quit [Ping timeout: 483 seconds]
10:36j_eyanyone know where to find the kernelcache on macOS? System/Library/Caches/com.apple.kernelcaches/ is empty
10:38j_eyah, /System/Volumes/Preboot has it
10:45j_eyanyone seen this stream error when trying to chainload macOS? https://paste.gg/p/anonymous/349b8a37b7294de380c9db2c4227ec60
10:47svenwhat does file ~/kernelcache report?
10:47svenj_ey: ^--
10:47j_ey'data'
10:47svenshould be dev.kc.macho.development: Mach-O 64-bit filetype=12 arm64e
10:51j_eyi rebooted into macOS, and it also reports 'data' there
10:51svenmaybe it's a kernelcache wrapped in img4 or something like that?
10:52j_ey00000000 30 84 01 64 63 bd 16 04 49 4d 47 34 30 84 01 64 |0..dc...IMG40..d|
10:55svenhrm, i guess i should finally submit that 4k fixes. i just noticed i've been using them for the past month or so with 4k pages and nothing broke :D
10:56j_eysven: ^_^
10:57sventhe good news is that nvme works just fine with 4k pages, but that was kinda expected anyway :D
11:02j_eyusing img4tool.. I extracted the im4p and the im4m, both file says are 'data'
11:03j_eyoh, I had to extract im4p and then extract the payload from that
11:03pipcet[m]extract the payload from the ...right.
11:06j_eywell that got a bit further at least
11:11j_eygot to the login screen!
11:29j_eyis anyone else using m1n1 with an rpi4 connected to the m1?
11:46yuyichao has joined #asahi-dev
11:53gladiac has quit [Quit: k thx bye]
13:53alyssasven: I wonder if locked DARTs do too with my patches
13:54svendo what too?
13:54svenoh, work on 4k kernels?
13:54sveni don't see why they wouldn't
13:54sventhe changes are outside of the dart driver
13:59svenwill probably send them later today and make sure to cc you. then you can even try yourself ;)
15:47svenalyssa: just submitted it, you should've gotten it as well :)
15:48svennow.. mailbox next i guess
15:54alyssaholy bananas that's a lot of email
15:55sventhe most interesting changes happen in two commits
15:55alyssasven: I can't believe I'm suggesting this but it might be worth seeing if you can do a frankenkernel smashing together your IOMMU patches with corellium's repo to see if thunderbolt 4k pages works
15:55svennope, won't work
15:55svenor at least not without much effort
15:56sventhe thunderbolt darts aren't even supported by my code right now
15:56alyssaare they special darts?
15:56svensmall variant of the current one
15:56sventhey support 64 streams instead of 16
15:56alyssaright ok
15:57svenand their pcie driver might also break because m1n1 already did the tunables
15:57alyssa"Pretend that iommu_dma_get_sgtable is not implemented since I can neither test this function right now nor do I fully understand how it is used."
15:57alyssathis is a mark of quality right here 🙃
15:57svenrobin suggested to do it that way *shrug*
16:00j_eywell that's a scary comment!
16:01sven"The whole dma_get_sgtable() idea is fundamentally unsafe" is already a good start, yes :D
16:02svenhah, and the commit message that introduced (well, move it there) mentions "The comments are spot on and should be near the central API"
16:15alyssaHow... delightful
16:19svenso i *think* that function actually doesn't need any change, but i'd rather wait until something runs into that and fails in an obvious way than just hoping it's correct
16:30tophevich[m]It's not a good example, but it might help in the future, you can mark line ranges: https://github.com/torvalds/linux/blob/master/drivers/gpu/drm/drm_gem_cma_helper.c#L407-L408
16:50svenhrm, now that i'm reading the swiotlb code again it seems that the untrusted stuff won't work correctly
16:50sventhat code only aligns allocations to a PAGE_SIZE boundary afaict
16:50sven... ofc i only figure this out just after i submitted the series
16:51marcansounds about right
16:56svenurgh.. this is gonna be even more complicated now :(
16:58j_eymarcan: "m1n1.fw.asc: Handle DARTless ASCs" nice! I had started to try hack that to get it working
16:58marcanit's a bit partial, I think ioreporting needs changes too
16:58marcanI was just testing SMC
16:58marcanbut it should be a start
17:00j_eymore complete than what I got :D
17:01alyssasven: uhhh
18:15pipcet[m]marcan: piodma sid is in the adt, i've only ever seen 4.
18:16pipcet[m]and I can switch my framebuffer to 4k@60hz now, with ugly hacks which I hope you guys can avoid :-)
18:24peerp[m] has joined #asahi-dev
18:37alyssapipcet[m]: hackless DCP driver incoming
18:38pipcet[m]alyssa: awesome :-)
18:39sven(*may still include hacks in the RTKit part)
18:40pipcet[m]alyssa: anything I can test/review/comment on?
18:42pipcet[m]alyssa: (sorry for working in parallel, this was an "if I can't get 4k out of this mini I better return it quick" thing)
18:43alyssano, these things take time
18:43alyssathat's life
18:44pipcet[m]I'm not sure I understand?
18:44pipcet[m]I wasn't expecting a working driver anytime soon, but I'm confident now that we can have one, so time to think of a name for the mini ;)
19:01nesnass has joined #asahi-dev
19:03j_eypipcet[m]: you can look here for the No Warranties branches https://github.com/mu-one/linux/branches
19:16nesnass has quit [Quit: Igloo IRC: https://iglooirc.com]
19:25nesnass has joined #asahi-dev
19:34nesnass has quit [Ping timeout: 480 seconds]
20:16quarkyalice has quit [Remote host closed the connection]
20:17quarkyalice has joined #asahi-dev
21:08quarkyalice has quit [Remote host closed the connection]
21:09quarkyalice has joined #asahi-dev
22:02JTL has quit [Quit: WeeChat 2.9]
22:02JTL has joined #asahi-dev
22:02JTL has quit []
22:02JTL has joined #asahi-dev
22:03JTL has quit []
22:03JTL has joined #asahi-dev
22:24marcanpipcet[m]: the question is whether UPPipe2::map_buf() always is supposed to go to piodma or not
22:42aleasto has quit [Quit: Konversation terminated!]
22:51alyssa(do we understnad what piodma is yet?)
23:05kendfinger has quit [Read error: Connection reset by peer]
23:06kendfinger has joined #asahi-dev
23:07alyssawhy cant i spell
23:51alyssaJust swapped my first frame with DCP
23:51alyssafrom linux
23:54alyssaneed to sort out some IOMMU stuff to get 4k properly
23:57alyssa 2 files changed, 333 insertions(+), 8 deletions(-)
23:57alyssa^ versus yesterday's push
23:58alyssaNeeds a metric tonne of cleanup and then wiring into KMS
23:59alyssa(Goal for today was swap a frame, tomorrow is wire into KMS, monday is 4k, tuesday is cursors/overlay planes.)
…