2021-08-14
01:20Emantor has quit [Quit: ZNC - http://znc.in]
01:20Emantor has joined #asahi
01:55riker77_ has joined #asahi
01:59riker77 has quit [Ping timeout: 480 seconds]
01:59riker77_ is now known as riker77
02:38PhilippvK has joined #asahi
02:42phiologe has quit [Ping timeout: 480 seconds]
03:21apetresc has joined #asahi
03:26kov has quit [Quit: Coyote finally caught me]
03:47apetresc has quit [Quit: ZNC 1.8.2 - https://znc.in]
03:51marvin24 has joined #asahi
03:54marvin24_ has quit [Ping timeout: 480 seconds]
04:47OrganicPumpkin[m] has joined #asahi
06:05DarkShadow44 has quit [Quit: ZNC - https://znc.in]
06:06DarkShadow44 has joined #asahi
06:17pipcet[m]yes, I think that's the layout of those weird "function" nodes: the first four bytes are the phandle, then the fourcc code, then any arguments.
08:04j_eypipcet[m]: "can't" I assume you mean. It's just corelliums with a few tweaks to the APIs used, nothing major :-)
08:15coin3x[m] has joined #asahi
08:17phire has joined #asahi
09:40riker77 has quit [Quit: Quitting IRC - gone for good...]
09:41riker77 has joined #asahi
10:00pipcet[m]hmm, what's a good way of crashing the ANS coprocessor so it writes something other than 0xefefefef to the crashlog?
10:06marcananyone want to proofread https://asahilinux.org/2021/08/progress-report-august-2021/ before I send it to everyone? :)
10:10chadmedThe second sentence after the May 27 tweet should be split into two sentences for better readability. "Effectively, the Python host can 'puppeteer' the M1 and its guest OS remotely. The hypervisor itself is even partially written in Python!"
10:12tophevich[m]I'm not a native speaker, and my duckduckgo foo level didn't help me confirming it, but in the first paragraph you have the "so strap on for a biger update this time". I feel like the phrase is "so strap in" instead of "so strap on"
10:16j_ey"to the main CPU at any time, even during another options" i suppose that should be 'during another operation'?
10:19chadmedi must say that i am always extremely impressed and delighted when i see very technically proficient people prove themselves as competent communicators. its a very rare skill to be both and you should be proud of your writing marcan
10:20chadmedmy real life job is medicine and the number of medical professionals and researchers who simply could not write a clear english passage to save their lives is quite shocking
10:21opticron has quit [Ping timeout: 480 seconds]
10:21tophevich[m]"This has also gotten members of the kernel community interested in our project; having a good relationionship" the transition there feels akward to me, I felt I missed a step, maybe "This has also gotten members of the kernel community interested in our project, and as mentioned previously having a good relationionship"
10:22chadmedi would replace the colon with a fullstop and start a new sentence, "This is important, as having a good relationship..."
10:23opticron has joined #asahi
10:30tophevich[m]"Since the hypervisor is built on m1n1, it works together with Python code running on a separate host machine. Effectively, the Python host can “puppeteer” the M1 and its guest OS remotely, and the hypervisor itself is partially written in Python! This allows us to have a very fast test cycle, even updating parts of the hypervisor itself live during guest execution, without a reboot."
10:30tophevich[m]I would move the partially written in python part to the second sentenace. -> "Since the hypervisor is built on m1n1, it works together with Python code running on a separate host machine. Effectively, the Python host can “puppeteer” the M1 and its guest OS remotely. To allow us a very fast test cycle, the hypervisor itself is partially written in Python, which allowes even updating parts of the hypervisor itself live during guest
10:30tophevich[m]execution, without a reboot."
10:31tophevich[m](hm ... looks like I should proof read my proposals)
10:38tophevich[m]"Apple decided to throw a twist into it" feels like two phrases merged, i think a simple "Apple decided to give it a twist" sounds more "native". You can throw a wrench into "the gears" but a you can't trhow a twist, the twist itself is the action.
10:47tophevich[m]At some points you go into explaining some of the acronyms, but for others you do not. It always depends on what you have in mind for your target audience, but you could do it more often at the first mention or just add a glossary?
10:47chadmedi think the problem is that we do not know for sure what some of the acronyms actually mean. DCP, for example, may simply mean Display Control Processor but we simply dont know
10:48tophevich[m]One example is "Sven has been dutifully working on the Linux driver for DART, the M1’s IOMMU (I/O Memory Management Unit)"
10:49AkihikoOdaki[m]"On top of this, the DCP implements multiple endpoints, one of which serves as the “main” inteface." *interface
10:51svendart = device address resolution table fwiw, not sure if anyone actually cares about that though
10:51tophevich[m]"and initalizing endpoints" -> initializing
10:52tophevich[m]sven: I know that but if you don't know IOMMU, do you know DART?
10:52AkihikoOdaki[m]"the DCP can send asynchronous messages to the main CPU at any time, even during another options." options -> operations?
10:52tophevich[m]"directory structuers and files" -> structures
10:53sventophevich[m]: if you don't know IOMMU will "I/O Memory Management Unit" be helpful? i'd probably just put a link to a wikipedia page or something there
10:54tophevich[m]"and metadata fles" -> files
10:57tophevich[m]:j_ey ok, I guess it would be a good idea to link to it as part of the article. And it matches realy nicely as IOMMU is not in the glossary but is "expanded" in the article :D
10:58tophevich[m]only the glossary mentions the IOMMU without expanding on it :D
11:00sorearBut what most people think of as a “GPU” is actually two completely distinct pieces of hardware: the GPU proper, which is in charge of rendering images, and the display controller, which is in charge of sending those rendered images to the display. <-- this is a little clumsy both for the "most people think" bit and the vagueness of "rendered images"
11:01sorearthinking something like: But what most people think of as a “GPU” is actually two completely distinct pieces of hardware: the GPU proper, which is in charge of rendering images to pixels in memory, and the display controller, which is in charge of sending those pixels from memory to the display.
11:02sorearthere might be a small lie in the first bit because an informal "GPU" also includes video codecs, which I don't think are part of DCP or AGX, but I'm not sure what the best way around that is
11:03chadmedyeah but i dont think it particularly matters for this text. its a conversational piece describing what the developers have been up to over the last couple of months, not a set of specifications or technical documentation
11:04chadmedthe important takeaway from that passage is that the DCP is a distinct coprocessor with its own firmware
11:09sorear"However, we do have access to the raw display controller registers too" not an editing comment but I'm wondering how we found this out, given that we can't trace DCP
11:09tophevich[m](updated the wiki as a direct result of the article glossary discussion, hope that's ok)
11:30tophevich[m]/!\ /!\ /!\ the deep-links in the article to github files could become a problem in the not too distant future. I think it would be a good idea to use a commit specific link, otherwise they could become obsolete in "next weeks" refactoring and you'd get a 404.
11:38sorearoverall very nice piece, my desire for a clear statement of the current status of usb/pcie/spi/nvme etc remains unsated but that's not on any of you
11:39chadmedi think the problem there is that its all at a "well it kinda works but not really" level so theres no point reporting that we have progress on it, then have a bunch of people think that means they can just use brcmfmac and have a working desktop
11:41chadmedits the same principle as not cluttering the install instructions with technical documentation, someone or many someones _will_ misinterpret what is written and then come complaining that we misrepresented what you can do. "you said that usb works so how come i cant use my HOTAS system as an input device >:("
11:45soreari think the same argument could be used to suppress all of the discussion of DCP progress
11:47chadmedeh not really since its a very obvious state of affairs. we can manually package up a frame and push it to the screen and really not much else. with the other controller drivers, we have had a couple of instances of silent data corruption, some usb hubs not working properly, usb-pd not working, the nvme controller preventing the system from shutting down cleanly etc
11:48marcansorear: initially corellium, since they patch up the framebuffer format directly in their preloader
11:48marcanbut recently I scanned the entire MMIO range around that and DCP and found a lot of fun registers
11:50marcantophevich[m]: I think I already did the relevant refactor this time around, but I can always update the article if they break again
11:50marcanI'm a bit reluctant to pin the revisions right now since that code will probably change a lot and I don't want to send people to outdated versions
11:51tophevich[m]marcan: hm, ok but shouldn't be the explanation and the source be in sync. I wouldn't expect ppl using those to gather them only from the article but to check out the repo.
11:52marcanchadmed, tophevich[m], j_ey, sorear: thanks for the review! Just pushed a bunch of changes
12:03landscape15[m] has joined #asahi
12:12duckworld has joined #asahi
12:12svensorear: pcie (and with that ethernet and usb a) requires gpio/pinctrl, ~100 lines of magic register pokes and some thinking about how to handle the rid2sid iommu mapping. that's maybe a day or so of work now that DART is done.
12:13svenusb-c requires the usb phy driver (ugh...) and some way to get an interrupt when a new device is connected (usb-pd is a good guess, but there might also be a SMC event). otherwise it already works with an upstream kernel in bypass mode, but now also with an iommu since DART is done for now
12:14svennvme requires me to take nvme/pci.c, strip off all the PCI-specific stuff and create apple-ans.c. it also needs a simple hv tracer to figure out some details (how does the nvmmu actually work + how to shutdown the controller) and then ofc asc/rtkit
12:15svenand broadcom wifi needs some patches to the upstream driver. might be possible to take corellium's patches and just submit them as-is
12:15duckworld is now known as jmyers
12:16sveni think the most important stuff right now are clocks, gpio, pinctrl and then spi and i2c. they're all relatively simple but are required for a lot of the fun stuff later on
12:17jmyers is now known as duckworld
12:19duckworld has quit [Remote host closed the connection]
12:19duckworld has joined #asahi
12:20j_eysven: I hope my changes on top of corelliums patches come in handy, but if not its a good learning experience :D
12:22duckworld has left #asahi [#asahi]
12:30tophevich[m]marcan: depending on what you decide you can use or close this one: https://github.com/AsahiLinux/AsahiLinux.github.io/pull/16
12:37duckworld has joined #asahi
12:51j_eykettenis_: so do we think there's only 2 functions in pinctrl? gpio/periph, and periph is basically fixed to something depending on what its connected to?
13:01yuyichao has joined #asahi
13:22robinp has joined #asahi
13:47jelly has joined #asahi
14:05yuyichao has quit [Ping timeout: 480 seconds]
14:36kwilczynski has joined #asahi
14:45dung[m] is now known as parabola[m]
14:47bps2 has joined #asahi
14:59zopieux has quit [Ping timeout: 480 seconds]
15:01zopieux has joined #asahi
15:17jeffmiw has joined #asahi
15:32mini_just finished reading the progress update, thanks for posting it :) great progress being made!
15:32mini_ is now known as mini
15:52awal has joined #asahi
16:35cptcobalt has quit [Read error: Connection reset by peer]
16:35cptcobalt has joined #asahi
16:58everslick has joined #asahi
17:21awal has quit [Quit: bye]
17:31alyssa(which in turn is based on the corellium driver, so that was a funny way to round trip back to linux)
17:31roxfan2 has joined #asahi
17:32tophevich[m]gz to all :)
17:35alyssathe other big hack here is sven's "enable all clocks" hack in m1n1 and the "clk_keep_unused" kernel arg since there's some isssues with clocks, but I figured I'd deal with the reg pokes first.
17:36alyssagoal for the weekend is to get this all cleaned up, get an RFC on the LKML, and get a tree that y'all can actually try which has PCIe/USB/Ethernet/SMP working properly
17:36roxfan has quit [Ping timeout: 480 seconds]
17:37alyssa(for the last 2 days of last week, I was using the m1 for real work but pushing everything over a usb-c hub. which is... not great ;-p)
17:41alyssa(There are two indepnendent NVMe drivers right now -- the asahi/nvme branch and the corellium nvme driver -- and it's my understanding both are giant hacks. TO be fair to everyone involved, it's also my understand the M1 ANS stuff is wild.)
17:42svenasahi/nvme is actually close to how the final driver will look. just with cp pci.c apple-ans.c and lots of removed code
17:43pipcet[m]sven: I got it to work here, found some (very) minor things but it seems to be working (and yes, I realize it'll eat all my data)
17:48Andalu30 has joined #asahi
17:51svenand one of the nvme maintainers found my WIP branch and essentially said that we should copy pci.c, remove all stuff that isn't supported/used by apple's chip and just keep a duplicate copy of the shared code
17:53sven(asahi/nvme essentially is arnd's platform work with like 3 lines changes + patches to the nvme core to support apple's new queue format and their nvme-iommu)
18:06pipcet[m]kettenis: well, without getting into the "accept hardware in any reasonable state it is in" argument, I really don't see the benefit. DTs are perfectly happy expressing the relationship, and it's legitimate to open a mailbox channel you might never use..
18:08pipcet[m]and I think endpoints are stopped by the reset sequence that we need to perform on the ANS so it won't write to random memory...
18:08svenwe can do all the rtkit stuff inside mailbox (see nvme/dev) but i kinda expect that will get shot down rather quickly on LKML
18:09kettenis_but if folks don't want to rely on u-boot then you run into the qiestion what state linux expects the copro to be in
18:10kettenis_u-boot will reserve the memory it gives to the copro for logging so there is no overwrite risk
18:11svenwe need to handle the exact same thing for other processors anyway inside linux (dcp, smc and who knows what else)
18:13svenuh, i've mentioned the sequence and i think there's even code in the nvme/dev branch for that
18:15svenyou can also just crash either processor early on while mac os boots and it will happily print the mailbox log with the messages iboot sent to shut them down fwiw
18:31kettenis_sven, fwiw handling the SART in the mailbox driver instead of the nvme driver makes sense to me
18:48svenkettenis_: yeah, i think whatever end up handling the rtkit endpoints should also handle SART
18:49svenalyssa: so "shutdown" really means "put into hibernation/low-power mode". there's a possibility to restart them, but that hasn't worked for ANS or SMC and i doubt it works for DCP
18:50DarkShadow44 has quit [Quit: ZNC - https://znc.in]
18:52svensome combination of (first write32(asc_base + 0x10004, 0x11) then write32(asc_base + 0x10004 + 0x20, 0x1)), (clear that bit in asc_base+0x44 that's used to start them) and (set bit 31 in the clock gate register, delay for a bit, clear that bit again)
18:53ZLSA has quit [Read error: Connection reset by peer]
18:53mindfreeze has quit [Remote host closed the connection]
18:55WhyNotHugo has quit [Ping timeout: 480 seconds]
18:55austriancoder has quit [Ping timeout: 480 seconds]
18:56ovf has quit [Ping timeout: 480 seconds]
18:57rann has quit [Ping timeout: 480 seconds]
18:57enomem has quit [Remote host closed the connection]
18:58kwilczynski has quit [Ping timeout: 480 seconds]
18:59arnd has quit [Ping timeout: 480 seconds]
18:59enomem has joined #asahi
18:59esden has quit [Ping timeout: 480 seconds]
19:00austriancoder has joined #asahi
19:00kwilczynski has joined #asahi
19:01arnd has joined #asahi
19:01awal has joined #asahi
19:05DarkShadow44 has joined #asahi
19:05WhyNotHugo has joined #asahi
19:06ovf has joined #asahi
19:06mindfreeze has joined #asahi
19:06ZLSA has joined #asahi
19:06esden has joined #asahi
19:07roxfan2 has quit [Remote host closed the connection]
19:07rann has joined #asahi
19:12roxfan has joined #asahi
19:25Andalu30 has quit [Ping timeout: 480 seconds]
19:33alyssasven: the corellium reboot driver looks pretty self-contained, might be a good candidate to send off to the LKML almost as-is
19:36pipcet[m]well, the corellium reboot driver does the same thing as the WDT driver so I'm stumped.
19:53izica[m] has joined #asahi
19:55izica[m] is now known as izica
20:02aralyssa: I don't participate in kernel development, especially around here, but github's always been terribad for code reviews
20:14yuyichao has joined #asahi
20:47Andalu30 has joined #asahi
21:07jnalyssa: regarding ar's comments, which features are you going to use? just git hosting and code browsing, or also review, issues, etc.?
21:15Andalu30 has quit [Ping timeout: 480 seconds]
22:09TellowKrinkle[m]GitHub also has an issue where forks and non-default branches aren't searchable, which annoys me
22:09TellowKrinkle[m]Also GH search is surprisingly terrible at actually finding things, can't comment on GitLab here though
22:10JTLmeh. I just git clone and grep when I what to search for something other than a known string
22:10jnTellowKrinkle[m]: oh yes. it searches for words at best. searching for exact syntax (an unsurprising task for a *code search engine*) absolutely doesn't work
22:11TellowKrinkle[m]JTL: When I say terrible, even searching for known strings doesn't work half the time
22:12alyssaTellowKrinkle[m]: On the other hand, searching all of GitHub is an excellent reverse-engineering technique 😋
22:15TellowKrinkle[m]alyssa: lol that's true, it is good for that
22:15i509vcb[m]Github stopped accepting passwords recently
22:15i509vcb[m]You need to use ssh now
22:15i509vcb[m]If that is the thing
22:16i509vcb[m]No idea then
22:16TellowKrinkle[m]i509vcb: no, you just need to generate application-specific passwords
22:16TellowKrinkle[m]It's no different than if you had 2fa on, which you should anyways
22:34j_eySO suggests that git repack -d might fix it https://stackoverflow.com/questions/63878612/git-fatal-error-in-object-unshallow-sha-1
22:44alyssaj_ey: speaking of, what's the status of the pinctrl patches (your cleanup of corellium's)?
22:47j_eyI dont know really, this was mostly just a learning exercise for me. I certainly think my changes are correct.
22:51j_eyI'm actually a bit unsure why the pcie stuff works, I dont think the pinctrl handles these pins properly https://github.com/mu-one/linux/commit/3ccb29cbd63c523188c880e1a9d266ea792fae25#diff-845c07f30f0f94856b22d7b50c0ff3d27a961abeffefcdfab01f2e8cd64569ccR269
23:01alyssam1n1 does tunable stuff, there's more needed that u-boot does-- or that linux does itself on that branch
23:02bdju has quit [Read error: Connection reset by peer]
23:02bdju has joined #asahi
23:07j_eywell something sets those regs I linked to, cos that's what I was trying to work on today, the format in that dt isn't parsed currently
23:23jeffmiw has quit [Ping timeout: 480 seconds]
23:26alyssasven: yep. tweaked my port initialization code to skip the radios, dropped the IOP/SMC patches, and ethernet+usb still work fine 👍
23:49akemin_dayo has quit [Ping timeout: 480 seconds]