#
…

2021-07-31

00:15fluffypup[m] has joined #asahi
01:12riker77_ has joined #asahi
01:17riker77 has quit [Ping timeout: 480 seconds]
01:17riker77_ is now known as riker77
01:20Emantor has quit [Quit: ZNC - http://znc.in]
01:20Emantor has joined #asahi
01:39amw sven : More interested to test the exciting new nvme branch :-)
02:06quarkyalice has quit [Quit: Leaving]
02:07quarkyalice has joined #asahi
02:26chadmedfollowing all the interesting development has me REALLY tempted to drop some cash on a mac mini, but at the same time the M1X devices are really just around the corner and i'd also love to wait for those and test whatever quirks exist there vs plain M1
02:27chadmedafaict the only differences should be more Firestorm cores and more pcie/thunderbolt but honestly who knows what else will change
02:28PhilippvK has joined #asahi
02:32phiologe has quit [Ping timeout: 480 seconds]
02:37yuyichao has joined #asahi
03:44quarkyalice_ has joined #asahi
03:45quarkyalice has quit [Ping timeout: 480 seconds]
04:03apetresc has quit [Remote host closed the connection]
06:45apetresc has joined #asahi
07:50svenamw: sure. that's much less stable than the usb though. please don't use it for anything productive :)
08:06svenalso just pushed a new version that hopefully also compiles without CONFIG_PCI and cleans some minor things up
08:09svenkettenis_: so from what i can tell the linux code has no issues with issuing multiple commands in parallel
08:24thunfisch has quit [Quit: frrrp!]
08:26svenhrm, i also wonder if the remoteproc framework is better suited than the mailbox framework for all these coprocessors
08:31pipcet[m]would that give us a standard way to handle the reserved memory regions the IOPs know about?
08:33svennot sure, but it has e.g. rproc_boot which feels less awkward than requesting a fake mailbox in the nvme driver
08:33svenstill trying to wrap my head around how that subsystem works
08:40thunfisch has joined #asahi
08:45kettenis_sven: yeah, pretty sure this is a bug in the OpenBSD code
08:46pipcet[m]"The function can only be called from a process context (for now)." in the documentation for rpmsg_send, though...
08:46kettenis_sven: there still needs to be a way to express that nvme depends on the remoteproc somehow
08:53aleasto has joined #asahi
08:57svenkettenis_: sure, i'm just wondering if all this system endpoint handling really fits into the mailbox framework.
08:57svenpipcet[m]: that just means you can't call it from atomic contexts
08:58sven(i think)
09:00chadmedrproc does seem like a "more correct" way of handling some of this stuff, especially once (if?) we will be getting the kernel to load firmware rather than relying on iboot finding a macos stub and loading fw from that
09:01svenwe can't load firmware for any of the coprocessors (except for the SEP) ourselves
09:01chadmedyeah ik at this stage, but ever at all too?
09:01svenvery likely, yeah
09:02sveni can't claim i tested this, but from what i've seen so far the firmware is loaded by iboot and locked down
09:02chadmeddamn that sucks didnt realise that (though it should have been apparent given how iboot handles things)
09:02svenless work us :)
09:05chadmedthat is true, theres no real harm in terms of ux too i guess, only the requirement of having a fairly chunky macos stub partition on the device which doesnt really matter in the grand scheme of things
09:05svenwe should be able to eventually shrink that partition down a lot
09:07chadmedyeah im hoping so, only just if that requires us repackaging some of apple's proprietary stuff that might give us some legal troubles. the way i see it, allowing the macos installer to do its thing and "hijacking" it after its done is probably the least legally troublesome route
09:09chadmedi might play around with figuring out what exactly iboot needs to see a valid system and write a post-macos-install script that deletes everything else and sets up the partition just to boot m1n1.... at some point ;-P
09:09kettenis_I believe marcan's thinking about having a script run in the 1TR environment that just creates the APFS container/filesystem and populates it with bits downloaded from Apple's MacOS update server
09:12Andalu30 has joined #asahi
09:16chadmedit may be easier (by which i also mean legally less questionable) to have the user BYO "install macos xxx.app
09:17chadmedand from that we can extract the required files from Base System.dmg
09:19chadmedthat is how we did things for hackintosh when we needed specific files for reverting system-breaking updates as it puts the onus onto the user for acquiring those files. its also less likely to be subject to breaking changes. apple could at any time change update urls or encrypt files or whatever, this way we can be sure the user has them (or even a specific version of them)
09:21chadmedits also not exactly a hard thing to acquire if you actually have a mac since the app store will just download it into /Applications
09:22marcanyou can get restore images from Apple's server. it's not like the old macs; ever since T2 they have to support the DFU flow and that means having a publicly accessible API for this
09:23marcanidevicerestore already pulls ipsws from Apple, we'll do exactly the same thing
09:23chadmedohhh right right that makes more sense
09:23marcanin fact I plan to make the installer stream bits of the ipsw, so it doesn't have to download the whole thing
09:23marcanI already have actual professional experience streaming zip files ;)
09:24marcanwe only need the recovery image and firmware bundles; we can skip the actual OS image which is most of it
09:24marcanwhich means no need for any temporary space since this all fits in RAM
09:25marcanI've already tested this, I already did a manual macOS install once, worked fine to the kernel (then exploded due to no sealed OS volume)
09:26marcanI've been designing the installer in my head for a while now :)
09:26marcanI'll probably spend some time on it soon, seeing as alyssa is signing up to do the DCP kernel driver apparently
09:53foxlet has joined #asahi
09:53foxletEven with old Macs you could get recovery images by polling the Software Update catalog, pretty much a plain plist.
09:54foxletGood thing that `partialzip` has been done to death by this point :)
09:55j_eyipsw is an actual zip file?
09:56foxletYeah, it decodes fine as a plain ZIP like any other.
09:59chadmedyeah im playing around with one now
10:00chadmedcould be easy to manipulate in python using byteio
10:01chadmedthe firmwares are near the top of the archive all bundled neatly
10:05Andalu30 has quit [Remote host closed the connection]
10:05Andalu30 has joined #asahi
10:33pipcet[m]what's the status of DCP reverse-engineering? I'm looking at the "wtf" commit of the "dcp-clusterfuck" branch, and those names totally sound like it's production-ready
10:33j_eymarcan just got an image displayed last stream
10:34j_eyand could mess around with the width/height and colours
10:38bradfier_ has quit [Quit: Leaving...]
10:39bradfier has joined #asahi
10:50chadmedyeah so like pipcet says, production ready ;)
10:51kettenis_sven: did you see my message about the USB DARTs not being in bypass mode when m1n1 starts?
10:52svenoh, no, i must've missed that one
10:52svenare they just in translation enabled but without any pagetables configured then?
10:53sveni thought i checked them at one point and they were in bypass mode then :/
10:54kettenis_DART_TCR: 0x00080080
10:55svenhrm, maybe i misremember because i saw that 0x80 (which someone claimed was the bypass offset) and assumed it was in bypass mode then
10:55kettenis_DART_TTBR: 0x0ad7f6bd
10:56kettenis_so translations are enabled but the TTBRs don't have the valid bit set
10:57svenso.. do we still want to set them to bypass mode at the end of m1n1?
10:57kettenis_it would be convenient for u-boot to have them in bypass mode, but for security reasons that may be undesirable
10:58svenhm, not sure how you could exploit anything using the USB darts though
10:58svenpcie would be another story, but those can't do bypass anyway ;)
10:58sveni think it's fine to still set them to bypass
10:58kettenis_probably by design
10:59svenyeah, that would make sense
11:00kettenis_I didn't notice because I was chainloading m1n1 from m1n1
11:00kettenis_but things stopped working when I used m1n1 with u-boot as a payload
11:01svenoh, right. it never reaches the code path to set them "back" to bypass mode then
11:02svenstill makes sense to at least set the usb darts to bypass mode then imho
11:02sveni don't really see any security issues and if it helps u-boot :)
11:03kettenis_I could set them into bypass mode in u-boot of course
11:04kettenis_although I haven't figured out yet how to make the dart driver probe without another device driver explicitly referencing it
11:05svencan't you reference them in the usb nodes?
11:18kettenis_that's what the current code does, but it adds (for now) apple-specific code to the generic dwc3 host driver
11:23DarkShadow44 has joined #asahi
11:28kettenis_ah, I think I could put the DART in bypass mode when the driver's bind function is called
11:45Andalu30 has quit [Ping timeout: 480 seconds]
11:48Andalu30 has joined #asahi
11:56Andalu30 has quit [Read error: No route to host]
11:58Andalu30 has joined #asahi
12:13Andalu30 has quit [Ping timeout: 480 seconds]
12:42marcanpipcet[m]: those names were alyssa's suggestion because she can't wait for me to clean up the code apparently :p
12:43marcanit works fine, I got page flipping to work for RGBA surfaces
12:43pipcet[m]marcan: it's awesome, I approve of the names and can't wait to break things with the code :-)
12:43marcanthat should be enough functionality for a "real" graphics driver (i.e. proper vsync and hardware cursor)
12:44marcanmode switching probably works too but I didn't get around to trying it because I need to decode the structures that enumerate the modes, but that's a 30 min problem
12:44marcanplane scaling works fine too
12:44pipcet[m]lack of vsync is annoying, I'm not noticing the software cursor much, but my usage is hardly typical :-)
12:46kettenis_sven: using the bind function works so I'll just put the DART in bypass mode in u-boot
12:46kettenis_then it doesn't really matter what m1n1 does
12:48kettenis_so I now have a u-boot that uses the proposed DART DT bindings
12:48kettenis_but for some reason u-boot isn't happy about the "dma-ranges" proprty you added to the "soc" node
13:09kettenis_seems that can be fixed by putting a "dma-ranges" property on the root node
13:10kettenis_but I think it means that u-boot is a bit to strict about this
13:21svenhm, i'm not even sure if that thing is required
13:21svenbut sounds good :-)
13:21sveni should also submit v5 of that dart driver
13:22kettenis_I can actually work around it
13:23sventhe dt changes are separate from the rest anyway
13:23kettenis_I no longer need the code that checks the dma-ranges properties in u-boot now that I put the USB DARTs in bypass mode
13:24kettenis_I took the dt changes from the asahilinux dev/dart branch
13:24svenyeah, they're in there for convenience :)
13:24svenbut i'll just submit the first three patches
13:25svenchanges to the dt for the m1 have to go through marcan while the iommu stuff goes through the iommu tree i think
13:25kettenis_that's the idea
13:25kettenis_ is now known as kettenis
13:26svenals, ugh, clocks. we'll need them at some point unless we just turn them all on in m1n1 and keep ignoring them
13:26kettenismight be a viable strategy to get something usable upstreamed
13:28kettenisusb and pcie clocks are already enabled in m1n1 anyway
13:39pipcet[m]sven: ever saw a clock get stuck in 0x...4f state until you write 0xf to it again?
13:40pipcet[m]0x1400024f
13:40pipcet[m]I suspect I messed up clock initialization order, but probably not relevant, just thought I'd mention it.
13:40svendon't think i ever saw that
13:49alyssapipcet[m]: thank you for the kind words re: dcp branch/commit naming
14:01Andalu30 has joined #asahi
14:03kettenisnow has a device tree that should be better aligned with sven's dart stuff
14:08alyssaI guess I should take a look at dcp-clusterfuck now :3
14:08alyssamarcan: thanks <3
14:11alyssamarcan: +/* swap id */
14:11alyssa+ {swapid.val:02x} 00 00 00
14:12alyssaI would guess that's supposed to be 08x little-end without the 0s
14:19xerpi[m]41 52 47 42 is the FourCC for BGRA if I'm not mistaken
14:33xerpi[m]This will make it easier to fuzz for the supported pixel formats/size/stride contraints :)
14:33aleasto has quit [Ping timeout: 480 seconds]
14:45aleasto has joined #asahi
14:52yuyichao has quit [Ping timeout: 480 seconds]
15:03Andalu30 has quit [Quit: Konversation terminated!]
15:06Andalu30 has joined #asahi
15:06Andalu30 has quit []
15:29Andalu30 has joined #asahi
15:40frode_0xa has joined #asahi
16:33marcanalyssa: yes, that was just a quick hack
16:33Andalu30 has quit [Quit: Konversation terminated!]
16:33marcanit's a u32 of course
16:33marcanthis is why I said I wanted to clean it up :p
16:34alyssamarcan: you said i couldn't submt PRs, you didn't say nothing about IRC 😉
16:34marcanxerpi[m]: I'm sure I can `strings` that out :p
16:34marcan/kick alyssa
16:36alyssamarcan: By the way, I assume I need to update macOS on the m1n1/linux/hv partition to sync DCP firmware version with what you have ?
16:37alyssa(I'm admittedly unsure how to do so since my only way of accessing the macOS there is through the hv... I guess I could flash back XNU and then reflash m1n1 after updating)
16:37marcanyes, you need 12.0 beta3
16:37marcanyes, it's not out yet
16:37alyssadelightful
16:38marcanI wanted to get ahead of the changes, no point in being behind in versions
16:38marcanyou can just bputil back into reduced security mode
16:38marcanthat will disable m1n1
16:39alyssawell, i need a test plan in the mean time so there's that.
16:40alyssaTrying to digest the current code
16:41marcanI need to write something to convert the Construct-based type definitions to something like C
16:44alyssawhat's special about D101?
16:44alyssa("UNK_get_some_field")
16:45marcanit's inlined
16:45marcanbut dougall already worked it out in #-re
16:45marcanapparently DisplayPipePlaneBaseAlignment.DefaultStride?
16:46marcanso call it getDefaultStride or whatever
16:46alyssaNope, I'm not alowed to make suggestions to dcp-clusterfuck 😉
16:50alyssathis is so cursed
16:51marcanI did ask about your masochistic tendencies when signing up for this :p
17:07zopieux has quit [Ping timeout: 480 seconds]
17:09zopieux has joined #asahi
17:16roxfan2 is now known as roxfan
17:27Andalu30 has joined #asahi
17:30aleasto has quit [Ping timeout: 480 seconds]
17:31aleasto has joined #asahi
18:00Andalu30 has quit [Ping timeout: 480 seconds]
18:22alyssamarcan: Spent the morning wrapping my head around dcp-clusterfuck, wrote myself a cheat sheet of how the layers of crap fit together https://rosenzweig.io/DCP-Cheatsheet.md
18:22alyssaStepping back, I guess the idea is..
18:23alyssaInput structs packed in shared memory, wrapped in a DCP packet structure with the tag name and lengths. The offset of the packet in shared memory is used as a pointer to send a DCPEp_Msg, which is the actual message sent over the ASC mailbox.
18:24alyssaThe shared memory itself is just a block mapped to the DCP DART and with the dart VA negotiated with the DCPEp_SetShmem packet
18:25alyssastill not clear to me how pointers work, I guess those are DVAs?
19:22roxfan2 has joined #asahi
19:27roxfan has quit [Ping timeout: 480 seconds]
19:27roxfan has joined #asahi
19:30roxfan2 has quit [Ping timeout: 480 seconds]
19:42LeviLynch[m] has joined #asahi
21:26Andalu30 has joined #asahi
21:57pipcet[m]alyssa: thank you for that, I think it makes sense now. I can make m1n1 turn the display backlight to full brightness even when iBoot leaves it at the "very dim" setting that macOS keeps resetting it to! it's very exciting! now I just need a Linux driver so I can play with it from userland...
22:30Andalu30 has quit [Quit: Konversation terminated!]
22:56aleasto has quit [Quit: Konversation terminated!]
23:32quarkyalice_ has quit [Ping timeout: 480 seconds]
…