#
✕ nick:sven
#asahi-dev · 2022-02-06 11:49
svenYup
#asahi-dev · 2022-02-06 11:45
svenI’ve played with that a while ago and as far as I can tell it only has a cache for mappings but no cache for page faults (which also makes sense)
#asahi-dev · 2022-02-06 11:44
svenno, you only need an invalidate for unmapping pages
#asahi-dev · 2022-02-06 11:21
svenif that’s true this makes everything much easier
#asahi-dev · 2022-02-06 11:21
sveninteresting. So DCP does not try to access any memory when it sleeps?
#asahi-dev · 2022-02-06 09:26
svenI’m about to get uhh… let’s call it breakfast. I’ll take a look afterwards :)
#asahi-dev · 2022-02-06 09:18
svenI think you have some indentation errors, you can use checkpatch.pl and/or clang-format to catch those
#asahi-dev · 2022-02-06 09:17
svenjeffmiw: I’ve left some comments from a brief review on GitHub. Mostly just some minor nits
#asahi-dev · 2022-02-04 13:54
svenlet's move to -re :)
#asahi-dev · 2022-02-04 13:49
svenyes, that's the stub kext that just forwards everything to the real gpu driver
#asahi-dev · 2022-02-04 13:39
sven"AGXSecureGart""
#asahi-dev · 2022-02-04 13:39
svennot sure if that's the correct one but it has some strings about "Gart"
#asahi-dev · 2022-02-04 13:39
svenAGXG13X.kext
#asahi-dev · 2022-02-04 13:27
svenabsolutely not :D
#asahi-dev · 2022-02-04 13:26
svenbut it had strings about GART
#asahi-dev · 2022-02-04 13:26
sventhe agx kext, i'd have to look up its name
#asahi-dev · 2022-02-04 13:25
sveni briefly looked at the strings of the kext and it sounded very different
#asahi-dev · 2022-02-04 13:15
sven*kext
#asahi-dev · 2022-02-04 13:15
sventhe kext that attaches to it just calls back into the main GPU kexy
#asahi-dev · 2022-02-04 13:15
svenyeah, that node is just a hack
#asahi-dev · 2022-02-04 13:14
svenah, could be something mapped through the GPU's IOMMU then
#asahi-dev · 2022-02-04 13:14
sven(though, some DARTs may support >32bit on the Max/Pro)
#asahi-dev · 2022-02-04 13:14
svenwhat are you looking at? it's a bit too large for something mapped through DART
#asahi-dev · 2022-02-04 13:13
sventhat's certainly not a kernel pointer
#asahi-dev · 2022-02-04 08:13
svenif we do that we'd need to adjust iopgtbl to allow walking the pagetable and returning the mappings and then re-create them on every domain attach (which we need for the switch from DMA to UNMANAGED and also if we wanted to support re-probing because that also cycles the iommu domain iirc)
#asahi-dev · 2022-02-04 08:10
sveni'm also fine with apple,inherit-mappings and making sure those mappings don't point to normal RAM fwiw
#asahi-dev · 2022-02-04 08:09
sveniirc his point was that other people have wanted something similar for a while so it would be nice to use this chance to add that feature (see the whole thread jannau linked https://lore.kernel.org/dri-devel/YUIPCxnyRutMS47%2F@orome.fritz.box/)
#asahi-dev · 2022-02-04 07:04
svenhrm, i guess if we do have to fall back to apple,inherit-mappins we could read them out in probe, stash them somewhere and the re-create them when a domain is attached before overwriting the TTBR though
#asahi-dev · 2022-02-04 07:01
svenyeah, I think he then pointed me to that thread on the iommu list that’s been in flight for months now because no one cares enough to see it through ;)
#asahi-dev · 2022-02-04 06:42
svenIt also requires a bit of hacking because for DCP we’ll need to switch from the default dma domain to an unmanaged domain
#asahi-dev · 2022-02-04 06:41
svenI briefly talked with robin who maintains the iopgtbl code and he was not very happy about reading out mappings and iirc called that something like a last resort
#asahi-dev · 2022-02-03 20:26
svenbut that’s also a bit ugly
#asahi-dev · 2022-02-03 20:26
svenwe could just not reset any dart and make sure that all intermediate stages clean them up if required before jumping to the next one.
#asahi-dev · 2022-02-03 20:24
svenyeah :/
#asahi-dev · 2022-02-03 20:11
svenif you want to go back to hacks you could just lock it in m1n1 :P
#asahi-dev · 2022-02-03 14:22
sveni can recommend fastmail :P
#asahi-dev · 2022-02-03 14:20
svenlol, or maybe just switch to a sane mail provider
#asahi-dev · 2022-02-03 09:52
svenhttps://www.theiphonewiki.com/wiki/Kernel_ASLR claims it should be 8 bits i think
#asahi-dev · 2022-02-03 09:51
svener.. wait.. i think the whole thing just managed to confuse me again
#asahi-dev · 2022-02-03 09:49
svenXNU might also relocate itself later, maybe this is just for the bootstrapping code before that can happen
#asahi-dev · 2022-02-03 09:48
sventhough... 5 bits sounds less than i remembered
#asahi-dev · 2022-02-03 09:48
svenyeah, it's not a lot
#asahi-dev · 2022-02-03 08:13
sventhe whole virtual macho address thing confuses me every time I think about it
#asahi-dev · 2022-02-03 08:12
svenmight even be an iboot bug introduced with that raw mode ;)
#asahi-dev · 2022-02-03 08:09
svenphire: yeah, it smells like it’s related to the ASLR iboot does
#asahi-dev · 2022-02-02 18:55
svenjannau: yeah, that sounds reasonable
#asahi-dev · 2022-02-02 18:50
svenI’m much more enthusiastic about not needing that force locked hack anymore :)
#asahi-dev · 2022-02-02 18:49
svenfeels like a sanity check to me tbh. If iboot wants to play nasty games and try to map something else it could also do much more horrible things 🤷🏻‍♂️
#asahi-dev · 2022-02-02 18:44
svennice! not sure what that check would do for us but it feels like that check could be done in m1n1 if we really wanted to
#asahi-dev · 2022-02-02 18:02
sveni guess it’s the codename for that hardware block

plus ›