2022-04-06
00:04alcazar has quit [Ping timeout: 480 seconds]
00:15alcazar has joined #asahi-re
00:23alcazar has quit [Ping timeout: 480 seconds]
00:31alcazar has joined #asahi-re
00:39alcazar has quit [Ping timeout: 480 seconds]
00:49alcazar has joined #asahi-re
00:57alcazar has quit [Ping timeout: 480 seconds]
01:02doggkruse has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
01:05alcazar has joined #asahi-re
01:10yuyichao has quit [Ping timeout: 480 seconds]
01:14alcazar has quit [Ping timeout: 480 seconds]
01:22alcazar has joined #asahi-re
01:30alcazar has quit [Ping timeout: 480 seconds]
01:39alcazar has joined #asahi-re
01:47alcazar has quit [Ping timeout: 480 seconds]
01:58alcazar has joined #asahi-re
02:02yuyichao has joined #asahi-re
02:06doggkruse has joined #asahi-re
02:07alcazar has quit [Ping timeout: 480 seconds]
02:16alcazar has joined #asahi-re
02:24alcazar has quit [Ping timeout: 480 seconds]
02:31alcazar has joined #asahi-re
02:40alcazar has quit [Ping timeout: 480 seconds]
02:50alcazar has joined #asahi-re
02:57phiologe has joined #asahi-re
02:58alcazar has quit [Ping timeout: 480 seconds]
03:00PhilippvK has quit [Ping timeout: 480 seconds]
03:02doggkruse has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
03:08alcazar has joined #asahi-re
03:16alcazar has quit [Ping timeout: 480 seconds]
03:24alcazar has joined #asahi-re
03:32alcazar has quit [Ping timeout: 480 seconds]
03:41alcazar has joined #asahi-re
03:50alcazar has quit [Ping timeout: 480 seconds]
04:00alcazar has joined #asahi-re
04:08alcazar has quit [Ping timeout: 480 seconds]
04:18alcazar has joined #asahi-re
04:26alcazar has quit [Ping timeout: 480 seconds]
04:34alcazar has joined #asahi-re
04:42alcazar has quit [Ping timeout: 480 seconds]
04:43nicolas17 has quit [Quit: Konversation terminated!]
04:50alcazar has joined #asahi-re
04:58alcazar has quit [Ping timeout: 480 seconds]
05:08alcazar has joined #asahi-re
05:15doggkruse has joined #asahi-re
05:16alcazar has quit [Ping timeout: 480 seconds]
05:24the_lanetly_052 has joined #asahi-re
05:25alcazar has joined #asahi-re
05:33alcazar has quit [Ping timeout: 480 seconds]
05:43alcazar has joined #asahi-re
05:51alcazar has quit [Ping timeout: 480 seconds]
05:59alcazar has joined #asahi-re
06:07alcazar has quit [Ping timeout: 480 seconds]
06:12alexsv has joined #asahi-re
06:16alcazar has joined #asahi-re
06:24alcazar has quit [Ping timeout: 480 seconds]
06:29doggkruse has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
06:33alcazar has joined #asahi-re
06:42alcazar has quit [Ping timeout: 480 seconds]
06:50alcazar has joined #asahi-re
06:59alcazar has quit [Ping timeout: 480 seconds]
07:09alcazar has joined #asahi-re
07:17alcazar has quit [Ping timeout: 480 seconds]
07:21MajorBiscuit has joined #asahi-re
07:27alcazar has joined #asahi-re
07:44alcazar has quit [Ping timeout: 480 seconds]
07:54alcazar has joined #asahi-re
08:02alcazar has quit [Ping timeout: 480 seconds]
08:11alcazar has joined #asahi-re
08:18Major_Biscuit has joined #asahi-re
08:19alcazar has quit [Ping timeout: 480 seconds]
08:19MajorBiscuit has quit [Ping timeout: 480 seconds]
08:22Guest325 has quit []
08:23foxtrot has joined #asahi-re
08:24foxtrot is now known as Guest1315
08:29kit_ty_kate has quit [Remote host closed the connection]
08:29Guest1315 has quit []
08:29kit_ty_kate1 has joined #asahi-re
08:29alcazar has joined #asahi-re
08:29southey has joined #asahi-re
08:38alcazar has quit [Ping timeout: 480 seconds]
08:46alcazar has joined #asahi-re
08:54alcazar has quit [Ping timeout: 480 seconds]
08:59alcazar has joined #asahi-re
09:00Major_Biscuit has quit []
09:01MajorBiscuit has joined #asahi-re
09:08alcazar has quit [Ping timeout: 480 seconds]
09:16alcazar has joined #asahi-re
09:25alcazar has quit [Ping timeout: 480 seconds]
09:33alcazar has joined #asahi-re
09:42alcazar has quit [Ping timeout: 480 seconds]
09:48kameks has joined #asahi-re
09:48the_lanetly_052 has quit [Remote host closed the connection]
09:49alcazar has joined #asahi-re
09:49the_lanetly_052 has joined #asahi-re
09:58the_lanetly_052 has quit [Ping timeout: 480 seconds]
10:02alcazar has quit [Ping timeout: 480 seconds]
10:13alcazar has joined #asahi-re
10:21alcazar has quit [Ping timeout: 480 seconds]
10:29alcazar has joined #asahi-re
10:37alcazar has quit [Ping timeout: 480 seconds]
10:45alcazar has joined #asahi-re
10:59alcazar has quit [Ping timeout: 480 seconds]
11:09alcazar has joined #asahi-re
11:17alcazar has quit [Ping timeout: 480 seconds]
11:25alcazar has joined #asahi-re
11:34alcazar has quit [Ping timeout: 480 seconds]
11:42kameksI bought a mac to develop an iOS app, but at the same time, as a graphics programmer I'm very much interested to tinker with GPU RE
11:42kameksone thing I'm wondering, is whether I risk being banned from access to iOS sdk by doing so
11:44kameksI mean, the iOS SDK license forbid RE, but does it also apply to mac as well ? Or do you think Apple would be more relax about it ?
11:44alcazar has joined #asahi-re
11:53alcazar has quit [Ping timeout: 480 seconds]
11:54dottedmagkameks: This is so country-specific that any opinion will be at best worthless and at worst harmful
12:01alcazar has joined #asahi-re
12:05kameksI live in Japan, and from what I understand, so does the lead of the Asahi Linux project. My concern is not so much about being sued, but more about Apple's openness to this, provided we do follow the RE best practices
12:06kameksas even if I do not break any law, Apple still has the right to terminate my access to the iOS SDK for whatever reason.
12:08kameksFor instance, they haven't locked down boot on M1 macs. So my understanding is that they expect people will try to run other software, and eventually need to RE to get proper drivers
12:09kamekseven if they won't help, because they don't want to spend resources, and want macos to be the os of choice
12:09alcazar has quit [Ping timeout: 480 seconds]
12:12kameksis there stance something like "we don't want to help linux run, we don't want to publish our internal documentations because it also contains trade secrets and we don't want to spend time for a shippable documentation. but if people are going to do the work for us for free, sure why not?" or do you think I really risk being kicked out of the access to iOS SDK and should refrain from participating?
12:17alcazar has joined #asahi-re
12:19amarioguy has joined #asahi-re
12:24chadmedit really is country specific but RE is not illegal and generally clauses in EULAs saying that they will ban/sue/kill you or remotely brick your device for doing it are wholly unenforceable
12:24chadmedif youre really worred about your apple developer account, use a pseudonym when contributing RE
12:25alcazar has quit [Ping timeout: 480 seconds]
12:27amarioguy has quit [Ping timeout: 480 seconds]
12:27amarioguy has joined #asahi-re
12:33chadmedsven: if you really, really, really cared about access to your apple id, you could take them to court in most common law countries over this. if you can prove they nixed your account because of RE you have a case
12:34chadmedthe US is very permissive about this actually, the EU and Australia not so much but if you can demonstrate that you were REing the for the purposes of "interoperability" (in this instance, interfacing one piece of software/hardware with another) then youre clear
12:35alcazar has joined #asahi-re
12:35kameksto be clear, I don't want to get involved with a lawsuit with Apple. Even if I have a case, I don't have time, money and courage to fight one of the biggest corporate
12:36chadmedi mean idk why anyone would take apple to court over losing access to an apple id, but hey you could do it and (assuming you have unlimited money) may even win
12:36kameksit's really about do you think apple cares or not so much as long as we don't do anything harmful to their IP
12:36chadmedyeah ok my point is merely that its not really "illegal" to do it, and the risk of them actually taking any action against you is probably extremely low
12:37chadmedunless youre outright copying code and implementations and publishing it all in your capacity as an apple-associated developer
12:37chadmedwhich, of course, doing the former will just get you banned from here and also probably sent to jail anyway
12:37kameks"i mean idk why anyone would take apple to court over losing access to an apple id" -> Epic did, but that's a whole other story, and Apple will fight tooth and nails for iOS
12:40chadmedi believe our current apple psychoanalys on this goes like: a) we want to sell apple silicon macs. b) we do not want to spend money porting linux to the macs. c) a non-trivial minority of people find these machines highly desirable, IFF they can run linux. d) there are people willing to port linux to our machines for free. e) this will sell more macs. f) let these people have their fun so we sell more macs
12:40kameks"unless youre outright copying code and implementations" -> that's copyright infringement, so yeah, definitely not okay
12:41chadmedwell yeah we dont want anything to do with that regardless (its also not fun and not rewarding so why do it :P)
12:43alcazar has quit [Ping timeout: 480 seconds]
12:45kameksI read Alyssa's blog posts about GPU RE, I'm not sure what's the exact status as of today. What I'd like to do is write a raw-level API for M1 GPU, similar to what we have on certain game consoles
12:45alcazar has joined #asahi-re
12:46chadmedalyssa's mesa driver is only the userspace half, so the part that takes the opengl shaders and compiles them into AGX instructions. we still rely on the macos kernel to submit those to the gpu via the firmware. Asahi Lina is working on reverse engineering the interface for that so we can do it in Linux
12:47kameksOn these consoles, they also have a higher level API, built on top of the low level API. That higher level API is fully open source (to licensed developers), and it is a bliss to work with something with no hidden pieces
12:48kameksbasically, we allocate memory, map it for GPU access, and memcopy precompiled shader code
12:50chadmedAIUI we have to submit work via the RTKit firmware the GPU runs anyway, so your raw command submission API will probably look pretty similar to the linux kernel driver
12:53kamekson console API, a command buffer is a void*. we create a command encoder, give it a range of preallocated memory, and a callback for when it runs out of memory. The encode writes command to the memory we control as we go. We are then responsible to submit all the buffers at once.
12:53alcazar has quit [Ping timeout: 480 seconds]
12:55kameksa texture descriptor is just a raw struct where we put pointers and properties, we don't have to register and destroy them with the driver
12:58kameksthe only things which are going into kernel is initializing the GPU, opening the video port, and command submission. The rest is just memory we allocate on our own heap, and we fill with the help of low level functions
13:01chadmedintel's mesa stuff creates the buffer batches and then flicks them off to the kernel driver for submission
13:01kameksbut even if the platform were to not support a high level API such as Vulkan, we could implement it ourselves if we had the time for it. we got all the tools
13:03alcazar has joined #asahi-re
13:09marcankameks: on consoles there are different security considerations than on Linux, and very different multitasking requirements. how this works or can be made to work varies from platform to platform.
13:09marcanusually the draw command buffer is filled by userspace but submission will go through the kernel, and the kernel maintains the main command ring buffer
13:09marcanalso some consoles may share page tables between apps and the GPU, which may or may not be possible on Linux
13:12marcaneither 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, ...
13:12alcazar has quit [Ping timeout: 480 seconds]
13:12marcanso 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
13:17marcanI 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
13:17marcaneither way as far as reverse engineering, please read this: https://asahilinux.org/copyright/
13:21alcazar has joined #asahi-re
13:24kameksWhat'd like to have/do is a user-space driver, that ideally also run on mac. So I wouldn't be responsible for page allocation and protection or the ring buffer. But mostly raw command encoding, helpers to tile textures, find memory footprints (where to put mips) and so on. If that's more or less already what the kernel is doing, that's all the better
13:29alcazar has quit [Ping timeout: 480 seconds]
13:30alcazar has joined #asahi-re
13:31marcanAFAIK 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
13:32kamekson console as well, we ask the kernel for GPU map. some of them have unified memory space, some of them don't. but the kernel still keeps proper permission to avoid privilege escalation using the GPU
13:33marcanAIUI on some consoles the GPU and CPU share page tables, so no explicit GPU map operations are necessary
13:33kameksright, but the mapping still go through the OS, you can't just randomly change permission for kernel owned pages
13:34marcanyes, but the point is your userspace pages are automatically GPU pages in the context of your process
13:34amarioguy has quit [Remote host closed the connection]
13:34kamekswell I think the 360 was exploited because the GPU could write any address, including kernel
13:34amarioguy has joined #asahi-re
13:36marcanby 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
13:37marcanGo 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
13:38alcazar has quit [Ping timeout: 480 seconds]
13:39yuyichao has quit [Ping timeout: 480 seconds]
13:41marcanthe only stable graphics APIs on macOS are Metal and OpenGL, so basically anything else is impossible to make forward-compatible
13:42kameksI see. so the only way on mac is to completely replace the kernel driver and reimplement metal as well (assuming it is possible)
13:43marcanit isn't even clear if the *firmware* ABI is stable, and Apple internal kernel magic also definitely isn't stable, so no
13:44marcannevermind 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
13:46marcanand we will stick with that until we have a good reason to support another one (e.g. new hardware or a critical bugfix)
13:46kameksso during boot, you upload the firmware? or somehow you have the guarantee that it will not be impacted by macos
13:48alcazar has joined #asahi-re
13:48marcan(the userspace side is tested on macos, with the ABI compat caveats of course; we already had to forward-port it once)
13:51kameksfair enough. I guess it also better belong to gpu channel too. Sorry I drifted the conversation a lot
13:57alcazar has quit [Ping timeout: 480 seconds]
13:58amarioguy has quit [Ping timeout: 480 seconds]
14:03amarioguy has joined #asahi-re
14:05kameksone last thing, I saw documentation about the GPU shader assembly, but I didn't find much documentation about the driver itself (how packets are encoded, descriptors, texture tiling and so on). Maybe I could start reading the mesa driver and improve the documentation to familiarize myself if that's useful
14:07alcazar has joined #asahi-re
14:15alcazar has quit [Ping timeout: 480 seconds]
14:22amarioguykinda thinking about SEP for a second here, but what are the goals we have in mind for using the SEP?
14:23svenhttps://github.com/AsahiLinux/m1n1/pull/85/files don't remember why I never followed up, but that was a very early tracer
14:25alcazar has joined #asahi-re
14:26the_lanetly_052 has joined #asahi-re
14:28amarioguyfrom stuff i've read, iirc the xART stuff and booting sepOS is handled by iBoot before it hands off execution?
14:34alcazar has quit [Ping timeout: 480 seconds]
14:37amarioguyso the flow i'm seeing here is: handle xART EP and send that to SEP, set up TZ0 again (since SEP is shut down), send boot TZ0, then set up remaining endpoints for things like the key store and such?
14:41sveni also remember having worked out how the hashes for the actual SEP communication works but that doesn't seem to be in there as well
14:42alcazar has joined #asahi-re
14:45yuyichao has joined #asahi-re
14:50marcanso 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
14:51alcazar has quit [Ping timeout: 480 seconds]
14:51marcanxARTS 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
14:55amarioguymarcan: i see, so any SEP works relies on the APFS driver not crashing and burning first right?
14:57amarioguysven: right right. any major SEP changes between t8101 and t600x platforms i should be aware of? have a t8101, still waiting on a t6002
15:01alcazar has joined #asahi-re
15:06amarioguymarcan: want some clarification on the RE policy since this is kind of an edge case here: with the 12.3 and 12.3.1 IPSWs (all 12.3.x seeds actually), complete dev kernelcaches accidentally ended up shipping with these (the difference between these and the KDK stuff is a number of kexts are shipped as development versions, including apfs)
15:06amarioguydo we treat this as a leak and therefore offlimits since it was an accident (in all 12.3 seeds) or is this development kernelcache fair game for something like m1n1 tracing (definitely not binary RE) since other than the development kexts, it's identical to what the KDK would give and it's in an official IPSW
15:08marcan"leaks" means stolen or similar in the context of the policy; anything officially published does not count, accidental or not
15:09amarioguygotcha, so sounds like it's fair game since these are in official, final released seeds just accidental releases
15:09alcazar has quit [Ping timeout: 480 seconds]
15:11marcanwhen I say leaks I mean things like that iBoot source code leak, or internal tooling, and things like that
15:11kameks has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
15:12nicolas17 has joined #asahi-re
15:13marcantechnically 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
15:16marcan(of course, as with other kinds of RE in general, whether you're okay getting ahold of them or not in the first place is a personal decision; I'm strictly talking about the project stance here, not individual liability)
15:17marcanin what sense? haven't really done much since the release, too busy working around Apple bugs and catching up on everything I slacked off on
15:17nicolas17amarioguy: not the first time things ended up in ipsws that weren't supposed to be there >.>
15:18alcazar has joined #asahi-re
15:29alcazar has quit [Ping timeout: 480 seconds]
15:31roxfan2 has joined #asahi-re
15:35amarioguy has quit [Remote host closed the connection]
15:36roxfan has quit [Ping timeout: 480 seconds]
15:36alcazar has joined #asahi-re
15:45alcazar has quit [Ping timeout: 480 seconds]
15:49alcazar has joined #asahi-re
16:04alcazar has quit [Ping timeout: 480 seconds]
16:12alcazar has joined #asahi-re
16:18marcanon the short term list are figuring out how to make sleep work for brcmfmac, whether we can power down/up the PCIe controllers sanely, doing the PSCI-over-UEFI thing for CPU deep idle, shutdown/startup, and deep sleep
16:20alcazar has quit [Ping timeout: 480 seconds]
16:29alcazar has joined #asahi-re
16:30doggkruse has joined #asahi-re
16:37alcazar has quit [Ping timeout: 480 seconds]
16:41MajorBiscuit has quit [Ping timeout: 480 seconds]
16:47alcazar has joined #asahi-re
16:56alcazar has quit [Ping timeout: 480 seconds]
16:58caef^ has joined #asahi-re
17:06alcazar has joined #asahi-re
17:09MajorBiscuit has joined #asahi-re
17:14alcazar has quit [Ping timeout: 480 seconds]
17:18yamii has joined #asahi-re
17:19MajorBiscuit has quit [Ping timeout: 480 seconds]
17:22the_lanetly_052 has quit [Ping timeout: 480 seconds]
17:23alcazar has joined #asahi-re
17:31alcazar has quit [Ping timeout: 480 seconds]
17:41alcazar has joined #asahi-re
17:49alcazar has quit [Ping timeout: 480 seconds]
17:51caef^ has quit [Ping timeout: 480 seconds]
18:00nyx_o has quit [Quit: WeeChat 3.5]
18:00alcazar has joined #asahi-re
18:00roxfan2 is now known as roxfan
18:08alcazar has quit [Ping timeout: 480 seconds]
18:17alcazar has joined #asahi-re
18:18chengsun has quit [Quit: Quit]
18:18chengsun has joined #asahi-re
18:23nyx_o has joined #asahi-re
18:26alcazar has quit [Ping timeout: 480 seconds]
18:27the_lanetly_052 has joined #asahi-re
18:35alcazar has joined #asahi-re
18:43alcazar has quit [Ping timeout: 480 seconds]
18:53alcazar has joined #asahi-re
19:00doggkruse has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
19:01alcazar has quit [Ping timeout: 480 seconds]
19:09alcazar has joined #asahi-re
19:17alcazar has quit [Ping timeout: 480 seconds]
19:26alcazar has joined #asahi-re
19:31the_lanetly_052__ has joined #asahi-re
19:34alcazar has quit [Ping timeout: 480 seconds]
19:37the_lanetly_052 has quit [Ping timeout: 480 seconds]
19:42alcazar has joined #asahi-re
19:50alcazar has quit [Ping timeout: 480 seconds]
19:59alcazar has joined #asahi-re
20:07alcazar has quit [Ping timeout: 480 seconds]
20:17alcazar has joined #asahi-re
20:25alcazar has quit [Ping timeout: 480 seconds]
20:33alcazar has joined #asahi-re
20:41alcazar has quit [Ping timeout: 480 seconds]
20:50alcazar has joined #asahi-re
20:59alcazar has quit [Ping timeout: 480 seconds]
21:08alcazar has joined #asahi-re
21:17alcazar has quit [Ping timeout: 480 seconds]
21:26alcazar has joined #asahi-re
21:39alcazar has quit [Ping timeout: 480 seconds]
21:40alcazar has joined #asahi-re
21:49_whitelogger has joined #asahi-re
21:51phire_ has joined #asahi-re
21:51sirn has joined #asahi-re
21:51the_lanetly_052___ has joined #asahi-re
21:51jakebot has joined #asahi-re
21:51ChaosPrincess has joined #asahi-re
21:51riatre has joined #asahi-re
21:51lethalbit has joined #asahi-re
21:51robinp_ has joined #asahi-re
21:51dougall has joined #asahi-re
21:53abrasive has joined #asahi-re
21:57alcazar has joined #asahi-re
22:01MajorBiscuit has quit [Quit: WeeChat 3.4]
22:05alcazar has quit [Ping timeout: 480 seconds]
22:11alcazar has joined #asahi-re
22:19alcazar has quit [Ping timeout: 480 seconds]
22:27alcazar has joined #asahi-re
22:46caef^ has joined #asahi-re
22:49alcazar has quit [Ping timeout: 480 seconds]
22:57alcazar has joined #asahi-re
23:05alcazar has quit [Ping timeout: 480 seconds]
23:07atsalyuk has quit [Ping timeout: 480 seconds]
23:15alcazar has joined #asahi-re
23:23alcazar has quit [Ping timeout: 480 seconds]
23:29alcazar has joined #asahi-re
23:29alcazar has quit [Remote host closed the connection]