#asahi-re · 2022-04-06 15:13
marcantechnically that would also include leaked schematics, but I make an exception for those because facts are not copyrightable, they are widely available, considered critical for repair, practically useless for evil purposes, and it is almost impossible for us to end up infringing their copyright by merely looking things up in them and using the learned information#asahi-re · 2022-04-06 15:11
marcanwhen I say leaks I mean things like that iBoot source code leak, or internal tooling, and things like that#asahi-re · 2022-04-06 15:09
marcancorrect#asahi-re · 2022-04-06 15:08
marcan"leaks" means stolen or similar in the context of the policy; anything officially published does not count, accidental or not#asahi-re · 2022-04-06 14:51
marcanxARTS requires a very limited set of operations, namely in-place overwrites of a single file, though with the CoW nature of APFS I'm not sure how overcomplicated even that could turn out to be#asahi-re · 2022-04-06 14:50
marcanso a prereq here is a bunch of audit/lockdown work on linux-apfs to convince ourselves that either 1) it's stable enough it'll *never* break the iSC, or 2) we can mount it with some kind of restriction option that disables enough things we can consider it stable#asahi-re · 2022-04-06 14:49
marcanit's systemwide and not practical to replace/duplicate#asahi-re · 2022-04-06 14:49
marcanand iBoot, yes#asahi-re · 2022-04-06 14:49
marcanand xart depends on linux-apfs#asahi-re · 2022-04-06 14:48
marcanthat wouldn't go in the driver#asahi-re · 2022-04-06 14:48
marcanxart is something to be handled in userspace by sepd#asahi-re · 2022-04-06 14:07
marcanmight be useful, yeah :)#asahi-re · 2022-04-06 13:51
marcanI think alyssa can better answer that question :-)#asahi-re · 2022-04-06 13:49
marcanbut also we don't really understand the GPU well enough yet to start working on vulkan#asahi-re · 2022-04-06 13:49
marcanyeah, there's nobody working on vulkan yet#asahi-re · 2022-04-06 13:48
marcan(the userspace side is tested on macos, with the ABI compat caveats of course; we already had to forward-port it once)#asahi-re · 2022-04-06 13:48
marcanon the kernel side we have nothing, but that's starting now :-)#asahi-re · 2022-04-06 13:48
marcanon the userspace side, GLES2 compliance is at 95% or something#asahi-re · 2022-04-06 13:47
marcanthe firmware is packaged with the OS and our installer installs the full 12.3 set#asahi-re · 2022-04-06 13:47
marcaniBoot loads the firmware for us#asahi-re · 2022-04-06 13:46
marcanand we will stick with that until we have a good reason to support another one (e.g. new hardware or a critical bugfix)#asahi-re · 2022-04-06 13:46
marcanwe currently support only one firmware set for linux, 12.3#asahi-re · 2022-04-06 13:46
marcanno, firmware is *per OS*#asahi-re · 2022-04-06 13:45
marcannot the same way, because we can choose what firmware versions we support#asahi-re · 2022-04-06 13:45
marcanindeed macos updates all come with their own GPU firmware#asahi-re · 2022-04-06 13:44
marcanit's not happening#asahi-re · 2022-04-06 13:44
marcanbasically, forget about it#asahi-re · 2022-04-06 13:44
marcannevermind that messing with kernel drivers like this one means putting the system into permissive security mode and manually loading your own kernels, which is terrible UX for normal macOS users and can't even be done without the KDK and you can't redistribute that#asahi-re · 2022-04-06 13:44
marcanI mean the GPU firmware#asahi-re · 2022-04-06 13:43
marcanthis isn't going to work stably, ever#asahi-re · 2022-04-06 13:43
marcanit isn't even clear if the *firmware* ABI is stable, and Apple internal kernel magic also definitely isn't stable, so no#asahi-re · 2022-04-06 13:41
marcanthe only stable graphics APIs on macOS are Metal and OpenGL, so basically anything else is impossible to make forward-compatible#asahi-re · 2022-04-06 13:40
marcanthey gave up on that idea and now just call libc like everyone else#asahi-re · 2022-04-06 13:37
marcanso yeah#asahi-re · 2022-04-06 13:37
marcanGo tried it with boring old UNIX syscalls and a macOS upgrade broke all Go apps; and obviously the GPU API is much, much less stable than that#asahi-re · 2022-04-06 13:36
marcanso any random macOS upgrade can and likely will break your code#asahi-re · 2022-04-06 13:36
marcanby the way, you're probably going to have a bad time trying to make this work and maintain it on macOS, because Apple makes no kernel<->userspace ABI guarantees#asahi-re · 2022-04-06 13:34
marcanright, and I'm saying that's not on Linux#asahi-re · 2022-04-06 13:34
marcanwith the same VA#asahi-re · 2022-04-06 13:34
marcanyes, but the point is your userspace pages are automatically GPU pages in the context of your process#asahi-re · 2022-04-06 13:33
marcanAIUI on some consoles the GPU and CPU share page tables, so no explicit GPU map operations are necessary#asahi-re · 2022-04-06 13:31
marcanAFAIK the only notable difference is the memory management as I said, i.e. with Linux you do need to ask the kernel to GPU-map buffers since the page tables are maintained separately for GPU and CPU#asahi-re · 2022-04-06 13:30
marcanthat's pretty much already how it works in every sane graphics driver, yes#asahi-re · 2022-04-06 13:17
marcaneither way as far as reverse engineering, please read this: https://asahilinux.org/copyright/#asahi-re · 2022-04-06 13:17
marcanI don't know whether Linux supports unified GPU/CPU page tables, but if it doesn't and the M1 can do it, that'd be a good thing to work on a general solution for, since I think some other architectures can too#asahi-re · 2022-04-06 13:12
marcanso basically it sounds like what you actually want is to just not use mesa or talk directly to lower layers of mesa, and keep the same kernel interface#asahi-re · 2022-04-06 13:12
marcan... that'd have to be discussed with upstream#asahi-re · 2022-04-06 13:12
marcaneither way the kernel interface is intended to be as low level as possible while maintaining security and multitasking guarantees, so the chances you can improve upon whatever we come up with there aren't terribly high; memory management is another question but it's also not something you can just rip out, and if you want to propose something radically different from what DRM supports today, ...#asahi-re · 2022-04-06 13:09
marcanalso some consoles may share page tables between apps and the GPU, which may or may not be possible on Linux#asahi-re · 2022-04-06 13:09
marcanusually the draw command buffer is filled by userspace but submission will go through the kernel, and the kernel maintains the main command ring buffer