#asahi-gpu · 2023-09-08 17:27
lina(That's never going to work on 4K...)#asahi-gpu · 2023-09-08 17:27
linaYeah, userptr... as long as you're on a 16K kernel ^^#asahi-gpu · 2023-09-08 17:27
karolherbstI have a prototype for that against iris, I just have to fix it#asahi-gpu · 2023-09-08 17:26
karolherbstand that's all you need for basic SVM#asahi-gpu · 2023-09-08 17:26
karolherbstbut anyway.. userspace needs a way to map arbitrary host memory into the GPU AS, which is generally called "userptr"#asahi-gpu · 2023-09-08 17:26
karolherbsthave a good rest!#asahi-gpu · 2023-09-08 17:26
karolherbstheh#asahi-gpu · 2023-09-08 17:26
karolherbstyeah.. me neither :D#asahi-gpu · 2023-09-08 17:25
linaI should sleep ^^#asahi-gpu · 2023-09-08 17:25
karolherbstI don't have a solution for that, but luckly nothing yet requires it#asahi-gpu · 2023-09-08 17:25
linaAnyway I don't know how this really works, I just want to make sure I understand what we can do ^^#asahi-gpu · 2023-09-08 17:25
linaYeah...#asahi-gpu · 2023-09-08 17:25
karolherbstand then you'd have to careveout all invalid regions#asahi-gpu · 2023-09-08 17:25
karolherbstlina: yeah....#asahi-gpu · 2023-09-08 17:25
karolherbstyeah, the carveout needs to happen, but as long as you don't use mmu_notifiers to mirror arbitrary CPU memory, having the address spaces be a different size isn't a problem#asahi-gpu · 2023-09-08 17:24
linaBut I mean, we could have an SVM mode which syncs the CPU page tables like I think nouveau has?#asahi-gpu · 2023-09-08 17:24
karolherbstright...#asahi-gpu · 2023-09-08 17:24
linaIt's the VM_BIND thing#asahi-gpu · 2023-09-08 17:23
linakarolherbst: Userspace, except the carveout for kernel BOs#asahi-gpu · 2023-09-08 16:19
karolherbstI still have to write a proper protototype for all of this, but I'm kinda having a plan#asahi-gpu · 2023-09-08 16:18
karolherbstmemory used for SVM needs to be allocated manually and you can just use mmap instead of malloc and restrict the area from where to allocate#asahi-gpu · 2023-09-08 16:18
karolherbstand anyway, as long as you don't do full system SVM the address space size doesn't matter#asahi-gpu · 2023-09-08 16:17
karolherbstare you managing the VM in userspace or kernel space?#asahi-gpu · 2023-09-08 14:17
linaWhich is the best we can do for SVM#asahi-gpu · 2023-09-08 14:16
linaI guess we should move the magic page to the top at 0x7fffff8000 and then just say we "almost" have 40 bits of address space for userspace to allocate however it wants#asahi-gpu · 2023-09-08 14:16
linaI don't think any of the others are used for anything, so we can probably ignore those globals and let userspace define those addresses#asahi-gpu · 2023-09-08 14:16
linaOK, the "magic page" address at 0x6fffff8000 is written to a hardware register, so that one does something...#asahi-gpu · 2023-09-08 14:06
alyssafun#asahi-gpu · 2023-09-08 14:06
alyssaapple doesn't do SVM on macOS do they?#asahi-gpu · 2023-09-08 13:59
linaI guess I should grep the firmware a bit, see if I can confirm or deny any of it#asahi-gpu · 2023-09-08 13:59
linaThe globals that mention these addresses annoy me, but for all we know the firmware never uses them...#asahi-gpu · 2023-09-08 13:58
linaWe probably want some code in mesa to rand() the carveouts to an extent, to prove this actually works#asahi-gpu · 2023-09-08 13:57
linaThis will be another UAPI break once I flip it around#asahi-gpu · 2023-09-08 13:55
alyssa:+1:#asahi-gpu · 2023-09-08 13:55
lina*reason#asahi-gpu · 2023-09-08 13:55
lina(I donÂ't know how they deal with that but if they do, no raeason not to try here too)#asahi-gpu · 2023-09-08 13:55
alyssa(I didn't really follow that conversation)#asahi-gpu · 2023-09-08 13:55
lina(with GPU AS < CPU AS)#asahi-gpu · 2023-09-08 13:55
alyssaoh, ok#asahi-gpu · 2023-09-08 13:55
linaNo, that's what this is for. Apparently Nvidia has the same problem and somehow they make it work?#asahi-gpu · 2023-09-08 13:54
alyssalina: relatedly, did we decide that SVM is hard-impossible on current-gen AGX?#asahi-gpu · 2023-09-08 13:54
linaFrom what I heard we want to try to de-hardcode most of this address space stuff, so eventually it might be closer to the full 512GiB lower half (full AS is 40 bits / 1 TiB but half is kernel land)#asahi-gpu · 2023-09-08 13:53
linaUser address space right now is 256GiB (half of the 512GiB half since the rest is reserved for other purposes) and Apple don't sell machines with that much RAM, so something based on RAM size probably makes more sense if you want a "useful" value#asahi-gpu · 2023-09-08 13:51
linaYeah#asahi-gpu · 2023-09-08 13:51
i509vcbNo idea, I think it's either max memory allocation size or UINT64_MAX#asahi-gpu · 2023-09-08 13:51
linaWhat's the value right now?#asahi-gpu · 2023-09-08 13:50
i509vcbOkay then I guess I just ignore the above #asahi-gpu · 2023-09-08 13:50
linaNot "any buffer"#asahi-gpu · 2023-09-08 13:50
linaThis is a very specific mesh/geom emu buffer thing