#
…

2021-06-04

00:09tsida has joined #asahi
01:28bgb_ has joined #asahi
01:45brent has joined #asahi
01:46brentjust testing irssi
01:47brent has left #asahi [asahi]
01:47brentr123[m]so used to the client called element, wanted to try something else
02:17PhilippvK has joined #asahi
02:20phiologe has quit [Ping timeout: 480 seconds]
03:06marvin24_ has joined #asahi
03:10marvin24 has quit [Ping timeout: 483 seconds]
04:03bgb_ has quit [Quit: WeeChat 3.0.1]
04:06Graypup_ has quit [Quit: meow]
04:08Graypup_ has joined #asahi
04:30bgb has joined #asahi
04:31bgbmarcan: how about the "Flexible USB-PD Debug Interface" mentioned in doc?
05:08marcanbgb: it's kind of back burnered now that the dwc support in m1n1 and hypervisor make it largely unnecessary for people
05:09marcanit'll happen, but I want to prioritize getting the gpu and other kernel drivers on track
05:33SocioProphet[m] has joined #asahi
05:33VinDuv has joined #asahi
05:39jannaurebooting by command is very convenient compared to pressing the power button
05:54SocioProphet[m]I concur doctor
05:57marcanjannau: with the hv you can reboot by command (or it reboots itself if it crashes, with the wdt)
05:58marcanclearly I need to make a script to automatically run linux.py under the hv and clean up the vuart so it works with the linux driver and then y'all have no excuse to just always run linux virtualized :) (okay I also should make SMP work)
05:59marcanactually wait, I don't actually have a proper reboot command do I
06:01Dementor[m]<marcan "actually wait, I don't actually "> It's ok we'll forgive you
06:01marcanit's like 2 lines of code! you need to ask for these things!
06:10marcanpushed; `reboot` at the hypervisor console will now do a hard reboot and exit the script
06:12marcanjannau: btw, have you tried the "turn on on power failure" thing in the macos settings? it might make for a simpler hard reboot by momentarily removing power, instead of having to hold down the power button for a while
06:25VinDuv has quit [Quit: Leaving.]
06:36_jannau_marcan: I have a fusb302 breakout board and vdmtool
06:40marcanah, fair :)
06:45bgbI am running m1n1 proxyclient on Macos(M1), successfully boot to virtualized macos if I disable all mmiotrace. however, if enable one of them, python client will fail due to lack of "aarch64-linux-gnu-gcc ...".
06:46marcanyou need a crosscompiler for the disassembler to work
06:46marcando you have a stack trace? that shouldn't happen unless you get an exception
06:47bgbforget one thing: also commented "self.u.print_exception(code, ctx)" in hv.py
06:48_jannau_I saw occasionally PMC irq quite early in the boot process
06:48marcanquite likely
06:48marcanbut those shouldn't end up in python?
06:48marcanoh wait, they do
06:48marcanyeah we should just handle the PMC IRQs properly
06:49_jannau_already done
06:49marcan_jannau_: does that actually work? the reason I originally wanted to do it disabling FIQs was that I thought if you just cleared IACT it would come back unless the counters were cleared too, and then you'd end up in a fiq storm
06:50_jannau_I thought so too but it does work
06:50marcanyou also need to actually deliver the FIQ
06:51marcanin hv_update_fiq
06:51marcanalso the comment is out of date :)
06:53marcanI guess right now it works because whenever the guest gets a timer irq it'll handle the pmc stuff too anyway
06:57bgbmarcan: I think there is not an aarch64-xxx cross compiler for macos(m1), right?
06:58alessandrorzz[m]There is a vm with arch precompiled
06:58marcana native gcc/binutils will work, but you need to pass ARCH= (empty) so it doesn't use the prefix if you don't have the prefixed tools in your PATH
06:59marcanI should just figure out some other way of doing this than the current shellout hack...
07:00marcanmaybe Keystone?
07:03marcan(and Capstone)
07:05bgbwell, beyond cognition, again...
07:11norwoodites has joined #asahi
07:11pinskia has quit [Remote host closed the connection]
07:13bgbdo you mean the openstack component?
07:13jannauI think I have to reset counters. clearing IACT probably does not work. macos seems to be fast enough to reset them so I get only a single irq no matter what I do
07:20marcanjannau: so just turn off irq delivery instead
07:20marcanand shadow that
07:20marcanyou can reenable it as soon as macos clears IACT
07:20marcanthen the logic for update_fiq is IACT in the real register && macos has enabled FIQs
07:32bisko has joined #asahi
07:37mazkettenis: yup, I'll try and get to it.
07:39bgb has quit [Ping timeout: 480 seconds]
07:43bgb has joined #asahi
08:05pugguu has joined #asahi
08:10norwoodites is now known as pinskia
08:26bgb_ has joined #asahi
08:27bgb has quit [Ping timeout: 480 seconds]
08:50marvin24_ is now known as marvin24
09:07bisko has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
09:46EER has joined #asahi
10:07choozy has joined #asahi
10:13choozy has quit [Remote host closed the connection]
10:16pugguu has quit [Read error: Connection reset by peer]
10:18pugguu has joined #asahi
10:47bgb_ has quit [Ping timeout: 480 seconds]
11:05bisko has joined #asahi
11:33pugguu has quit [Ping timeout: 480 seconds]
11:47pugguu has joined #asahi
11:48choozy has joined #asahi
11:51d18n has joined #asahi
11:55pugguu has quit [Ping timeout: 481 seconds]
11:56pugguu has joined #asahi
11:58EER_ has joined #asahi
12:02EER has quit [Ping timeout: 480 seconds]
12:09pugguu has quit [Remote host closed the connection]
12:09pugguu has joined #asahi
12:22bgb_ has joined #asahi
12:30bgb_ has quit [Ping timeout: 480 seconds]
12:34choozy has quit [Ping timeout: 480 seconds]
12:51pugguu has quit [Remote host closed the connection]
12:51pugguu has joined #asahi
12:54yuyichao_marcan: does the HV in m1n1 allows running linux with a usable console without special hardware setup? (and any document on using it?)
12:54bgb_ has joined #asahi
12:57marcanyuyichao_: it will once I improve the vuart to support what linux needs
12:57marcanright now it's kinda dumb
13:02bgb_ has quit [Ping timeout: 480 seconds]
13:07ave has quit [Quit: sayonara o/]
13:07ave has joined #asahi
13:08ave has quit []
13:08ave has joined #asahi
13:18pugguu has quit [Ping timeout: 480 seconds]
13:21pugguu has joined #asahi
13:24hspak3 has joined #asahi
13:25bgb_ has joined #asahi
13:28hspak has quit [Ping timeout: 480 seconds]
13:28hspak3 is now known as hspak
13:36bgb_ has quit [Ping timeout: 480 seconds]
13:59_whitelogger has joined #asahi
14:00choozy has joined #asahi
14:00bgb_ has joined #asahi
14:04bisko has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
14:04pugguu has quit [Remote host closed the connection]
14:06pugguu has joined #asahi
14:06bisko has joined #asahi
14:10pugguu has quit [Read error: Connection reset by peer]
14:10bgb_ has quit [Ping timeout: 480 seconds]
14:12pugguu has joined #asahi
14:24bgb_ has joined #asahi
14:27hspak1 has joined #asahi
14:27hspak has quit [Read error: Connection reset by peer]
14:27hspak1 is now known as hspak
14:32bgb_ has quit [Ping timeout: 480 seconds]
14:32pugguu has quit [Read error: No route to host]
14:33bisko has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
14:33pugguu has joined #asahi
14:36pugguu has quit [Read error: Connection reset by peer]
14:37pugguu has joined #asahi
14:37pugguu has quit [Read error: Connection reset by peer]
14:38pugguu has joined #asahi
14:46pugguu has quit [Ping timeout: 484 seconds]
14:51pugguu has joined #asahi
14:54bgb_ has joined #asahi
15:02bgb_ has quit [Ping timeout: 480 seconds]
15:06artemist has joined #asahi
15:10Izumoo has joined #asahi
15:21choozy has quit [Ping timeout: 483 seconds]
15:25bgb_ has joined #asahi
15:28pugguu has quit [Ping timeout: 480 seconds]
15:30pugguu has joined #asahi
15:33bgb_ has quit [Ping timeout: 480 seconds]
15:40bgb_ has joined #asahi
15:47pugguu has quit [Ping timeout: 480 seconds]
15:49bgb_ has quit [Ping timeout: 480 seconds]
15:51pugguu has joined #asahi
15:55pugguu has quit [Read error: Connection reset by peer]
15:55pugguu has joined #asahi
16:11pugguu has quit [Ping timeout: 481 seconds]
16:14bgb_ has joined #asahi
16:22bgb_ has quit [Ping timeout: 480 seconds]
16:36VinDuv has joined #asahi
16:37d18n has quit [Ping timeout: 480 seconds]
16:47bgb_ has joined #asahi
16:55choozy has joined #asahi
16:55bgb_ has quit [Ping timeout: 480 seconds]
16:56skoobasteeve_ has joined #asahi
16:57skoobasteeve has quit [Ping timeout: 480 seconds]
17:01EER has joined #asahi
17:06EER_ has quit [Ping timeout: 480 seconds]
17:20bgb_ has joined #asahi
17:28bgb_ has quit [Ping timeout: 480 seconds]
17:42klaus has quit [Quit: WeeChat 3.1]
17:43klaus has joined #asahi
17:45Emantormarcan: reboot is very handy, thanks :-)
17:51bgb_ has joined #asahi
17:59bgb_ has quit [Ping timeout: 480 seconds]
18:18pastly-antispam has quit [Quit: time for a tune up]
18:25pugguu has joined #asahi
18:27bgb_ has joined #asahi
18:29pastly-antispam has joined #asahi
18:33zopieux has quit [Ping timeout: 480 seconds]
18:35bgb_ has quit [Ping timeout: 480 seconds]
18:35zopieux has joined #asahi
19:01bgb_ has joined #asahi
19:02Emantor> barebox@Apple M1 Mac Mini (J274):/ (with only some slight modifications to the cache functions to run within the hypervisor, have not UART otherwise.)
19:06bisko has joined #asahi
19:09bgb_ has quit [Ping timeout: 480 seconds]
19:14bloombareox?
19:16svenalright, looks i can extract the bypass configuration from dma-ranges and i can also use def_domain_type to enforce bypass mode from within the DART driver if booting a 4k pagesize kernel :)
19:17svenfeels much less like a hack now
19:18bloomwhat's the tradeoff for bypass mode again?
19:18bloomno thunderbolt?
19:19svenyeah, thunderbolt with bypass mode is a very bad idea
19:19blooms/with bypass mode //
19:19bloomtype-C or bust
19:19j_eywhy sven?
19:19svenit should actually been *without :D
19:19Emantor[m]Wee for Thunderbolt hardware messing with your gpu memory \o/
19:20sveneither way, we can be confident now that the dart bindings work with way and will continue to work if we can teach the kernel to handle 16k iommu pages with 4k cpu pages
19:20sven*this way
19:22sven<sven> it should actually been *without :D <-- scratch that. i'm just confused.
19:22svenj_ey: just google thunderbolt dma attack or something like that
19:23svenessentially any device attached to thunderbolt would have access to all memory
19:24j_eythat seems reasonable to want behind an IOMMU
19:24brentr123[m]You have to have physical access for malicious intent using that
19:24svenyes, still not something i'd comfortably enable in production
19:25svenbtw. did anyone check if you can unplug devices on the usb-c ports when using the corellium kernel?
19:26svenwell, unplug and then reattach
19:33bgb_ has joined #asahi
19:34pipcet[m]sven: I'm using something based on the Corellium kernel (at https://github.com/pipcet/pearl), so it's possible I broke it somehow, but no, doesn't work. It does if I manually unbind/rebind the driver.
19:34svenhm, ok. so it's probably no the usb pd chip then
19:36pipcet[m]can we work around it by resetting the device whenever connection status changes?
19:36sveni'd rather just figure out how to do it properly
19:38pipcet[m]of course, but having a fallback plan doesn't hurt.
19:41bgb_ has quit [Ping timeout: 480 seconds]
19:42pipcet[m]okay, that doesn't appear to trigger in all cases, either.
19:49pugguu has quit [Read error: Connection reset by peer]
19:50pugguu has joined #asahi
19:52marcansounds like a good first mmiotrace handler; i2c dumps
19:52marcanshould be easy enough
19:52svenyeah, i just need to make it work
19:52svenfirst time i tried i hit some weird pmgr panic
19:53svennot sure if i used the right kernel version though
19:54pugguu has quit [Read error: Connection reset by peer]
19:54pugguu has joined #asahi
19:58pugguu has quit [Read error: Connection reset by peer]
19:58pugguu has joined #asahi
20:04bloompipcet[m]: oh, this is the frist i'm hearing of pearl, looks nice :o
20:05bgb_ has joined #asahi
20:05pastly-antispam has quit [Remote host closed the connection]
20:08bloomhow are you finding that for day-to-day use?
20:08pugguu has quit [Read error: Connection reset by peer]
20:08pugguu has joined #asahi
20:09pipcet[m]more usable than macos, but I don't think that's saying much ;-)
20:09bloomI getcha ;-)
20:09bloomi admit i'm really not convinced about the whole kexec thing, seems newfangled for me
20:12pipcet[m]it's been around for 20 years or so
20:12pugguu has quit [Read error: Connection reset by peer]
20:12pugguu has joined #asahi
20:13bgb_ has quit [Ping timeout: 480 seconds]
20:17pipcet[m]do you see problems with it apart from being newfangled? I admit it is still unusual, but it is very nice to be able to do the ADT->FDT transformation in userspace (or maybe I'm just horrible at writing code that runs without debugging in the murky depths of prebootland)
20:20bloomI'd have to look more closely at your architecture
20:21bloomThe showstopper for me for these types of repos (and I've been through a lot of them for Chromebook linux) is the difficulty in auditing the source
20:29choozy has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
20:29pugguu has quit [Remote host closed the connection]
20:29pugguu has joined #asahi
20:31jannaumarcan: except that we currently hide both usb-c ports and need one for mmiotrace
20:33marcanjannau: you can try hiding just one, if that's broken it shouldn't be too hard to fix
20:34EER has quit [Remote host closed the connection]
20:37bgb_ has joined #asahi
20:38marcanjannau: fyi, “We shouldn’t support dual-booting because iBoot does” isn't a philosophical issue, it's a "your stuff is going to break SEP usage once we start supporting that properly" issue
20:38marcantwo OSes using the same SEP storage/context is not a good idea
20:38marcanbut hey, whatever floats your boat :p
20:39pastly-antispam has joined #asahi
20:44marcanthe correct way to support dual-booting without the "hold down the power button" issue is to have whatever boot picker you want to have, but actually clean reboot into the new OS (via nvram var) the same way 1TR does
20:45jannaumarcan: you mean pipcet[m] re dual booting
20:45marcaner, yeah, sorry
20:45marcanjust woke up
20:45marcanpipcet[m]: ^
20:45bgb_ has quit [Ping timeout: 480 seconds]
20:48VinDuv has quit [Quit: Leaving.]
20:49jannaujust hiding one usb-c seems to work but my current PM irq changes seem to cause a FIQ storm in mac os
20:49svenwould be lovely if you could figure out that usb replug issue. i suspect it's either the i2c chip or possibly one of the other interrupts in the drd node
20:50sven(well, that or some magic bit that needs to be poked somewhere in the phy regs)
20:52svenprobably the first four are just the "normal" interrupts but the last one looks supicious
20:54jannauthe hook for 0x23d280090 made it slow
20:56pipcet[m]marcan: thanks for pointing that out
21:01jannausecond usb-c port is useable in mac os but my perf monitor irq handling is broken
21:08bgb_ has joined #asahi
21:11bisko has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
21:16bgb_ has quit [Ping timeout: 480 seconds]
21:18jannaubug fixed but we probably have to account for cycles spent in the hypervisor
21:19jannauthe guest is noticable slower now that I deliver pmu irqs
21:20svenfast enough to replug a usb device? ;)
21:21jannauI think so, fast enough interactive keyboard / mouse usage
21:22jannaueven dragging windows over the desktop is bearable but a little laggy from time to time
22:01jannauso slow :( "panic(cpu 0 caller 0xfffffe0014186ce4): "Halt/Restart Timed Out""
22:06bloomjannau: So, er, you're getting gfx mmiotraces then?
22:07bloomalso, marcan: is there a convenient way to do m1n1 printfs from userspace in the hypervisor?
22:08bloomso you can do a test program `m1n1_printf("before i/o call"); some_iokit_function(); m1n1_printf("after i/o call");` and then in the mmiotrace it's obvious what to grep for
22:08svenhey, stand in line please! i asked for usb replugging first!
22:08bloomyeah do usb replugging first :-p
22:09pugguu has quit [Ping timeout: 480 seconds]
22:13jannausven: for which ADT nodes do you want mmiotraces?
22:13bps has quit [Ping timeout: 480 seconds]
22:14svenusb-drd1 and atc-phy1
22:14svenmaybe during plugging/unplugging some simple device
22:15svencan you also trace irqs? or is that completely left to xnu right now?
22:20xerpi[m]bloom: Something like Linux's /dev/kmsg? (and have the kernel log go to UART)
22:21svencan you still write to /dev/cu.debug-console when kprintf is enabled?
22:21svenif yes echo "hi" > dev/cu.debug-console might just work
22:24svenoh, i guess you could just disable the debug serial when launching the hypervisor and then that should definitely work
22:28bloomheh, that's a much more stupid simple way than I was imagining (using msrs as a primitive and doing an ad hoc stream protocol or something) :-p
22:29jannauI'm not fully sure if I captured the exact moment before the disconnect
22:29svenjannau: thanks! looks great already. can you maybe also plug the device in once more at the end? (i.e. to have a connect -> disconnect -> connect cycle)
22:29svenbloom: just ask if you need more stupid ideas! :P
22:30bloom-EFRIDAY
22:35svenhm, quite a few atc-phy pokes in there
22:35jannauinterrupts (AIC) are out of our control
22:35bloomand you do the mmio pokey and you shake it all about
22:36bloomthat's what it's all about!
22:37jannaumac os breaks rebooting via USB PD when it has access to one usb-c port
22:39svendid you re-enable the hpm nodes as well?
22:41Method_ is now known as method_
22:43jannauyes, I removed the port 1 from setup_adt()
22:44sveni imagine that might bring the usb pd chip into a weird state
22:54frode_0xa has quit [Quit: leaving]
22:55svenawesome, thanks!
22:59bloomsven: does eet work yet ?!?!?! :-p
23:08svenbut something strange happens in usb_regs.atc + 0x08
23:08svenwhen i disconnect the cable it goes from 0x1c1000f to 0x1d1000f and i don't see that in the mmiotrace
23:09svenhuh...
23:09svenso.. uh.. i think i maybe know how to fix it without resetting dwc3
23:10jannauwe could add a virtual uart which inserts markers into mmiotrace. better than matching mmiotrace and serial out with timestamps
23:11sven>>> set32(0x502a90004, 3)
23:11svenTTY> *usb-dwc3@502280000: device event: USBRst (0x01)
23:11sven>>> read32(0x502a9001c)
23:11sven>>> clear32(0x502a90004, 3)
23:11svenso that fixes it
23:11svennow we just need to find the irq that fires when something's disconnected
23:12jannauif 3 markers are enough we could M1racles. user space sets 1,2 or 3 and the hypervisor inserts the marker and clears the bits
23:14svenah, the read is actually not required
23:14svenso set 0b11 and then clear 0b11 in 0x502a90004 makes the dwc3 controller see a USBRst event
23:14sveni bet those two bits are some kind of phy reset crap
23:16svenanyway, bedtime for me. 'night!
23:19jannaufor me as well, good night
…