2021-05-08
00:21mrkajetanp has joined #asahi
00:22modwizcode has quit [Ping timeout: 246 seconds]
00:29modwizcode has joined #asahi
00:45KindOne has quit [Ping timeout: 260 seconds]
00:45mrkajetanp has quit [Quit: WeeChat 3.1]
00:47KindOne has joined #asahi
00:51odmir has quit [Remote host closed the connection]
00:52odmir has joined #asahi
00:57odmir has quit [Ping timeout: 260 seconds]
01:20Emantor has quit [Quit: ZNC - http://znc.in]
01:20Emantor has joined #asahi
01:23odmir has joined #asahi
01:34odmir has quit [Ping timeout: 268 seconds]
01:48odmir has joined #asahi
01:51phiologe has quit [Ping timeout: 276 seconds]
01:51phiologe has joined #asahi
01:53odmir has quit [Ping timeout: 260 seconds]
01:57phiologe has quit [Ping timeout: 260 seconds]
02:00phiologe has joined #asahi
02:25Bublik has joined #asahi
02:26Bublik_ has quit [Ping timeout: 260 seconds]
02:35phiologe has quit [Ping timeout: 250 seconds]
02:35odmir has joined #asahi
02:35phiologe has joined #asahi
02:39odmir has quit [Ping timeout: 240 seconds]
03:23qyousef_ has quit [Ping timeout: 252 seconds]
04:01marvin24 has quit [Ping timeout: 276 seconds]
04:01marvin24_ has joined #asahi
04:02robinp_ is now known as robinp
04:37odmir has joined #asahi
04:43odmir has quit [Read error: Connection reset by peer]
05:22VinDuv has joined #asahi
06:00adamcstephens has quit [Quit: The Lounge - https://thelounge.chat]
06:04adamcstephens has joined #asahi
06:04neunon has quit [Quit: ZNC 1.8.2 - https://znc.in]
06:06neunon has joined #asahi
06:17dottedmagI wonder how much work is needed for QEMU to run macOS under Linux on M1? Nearly zero or a lot?
06:28VinDuvKVM (or equivalent) virtualizes the CPU but you’d still need to emulate the rest of the M1 hardware
06:55ardottedmag: kvm (the interface the kernel provides) is available on a couple of different architectures, not just x86
07:08jeffmiw has joined #asahi
07:10jeffmiw has quit [Remote host closed the connection]
07:10jeffmiw has joined #asahi
07:19marcandottedmag: kvm on linux on m1 should already work better in some ways than the hypervisor stuff on macos (:)), but that's to virtualize linux/windows
07:20marcanyou can't just "pass through" hardware under KVM like I can under my toy hypervisor, there needs to be DMA and IRQ remapping
07:22marcanin particular the GPU is a big question mark, but there's reason to believe Apple is interested in virtualizing macos, so it's possible the hardware is built to enable this kind of feature
07:23marcanalso, to run macos unmodified, KVM may need quite a bit of patching to support custom M1 features; at the very least we need to set everything to trap, but that might be very slow as it causes vmexits for tons of stuff
07:24marcanso that might be useful for experiments, but possibly not for end users; to do it properly KVM would need more M1-specific stuff and that's harder to implement and upstream
07:24marcanit's certainly something to investigate in the future, but it'll probably come quite further down the line
07:42arthis hypervisor is super cool, and seems like the kind of thing that would also be useful also for devices other than just the ones based on m1
07:44marcanyeah, it's already useful for debugging linux to some extent... and now I'm conflicted, because m1n1 is quite apple silicon-centric by design
07:45marcanI really don't want to turn this into a big portable bootloader thing, but on the other hand the HV stuff is eminently useful elsewhere
07:45marcanmaybe just the HV bits can be extracted into a stand-alone thing you can plug into another existing bootloader more easily?
07:45marcanalthough e.g. the HV page tables all assume 16K pages which few ARM systems support AIUI, so...
08:08jeffmiw has quit [Remote host closed the connection]
08:25jeffmiw has joined #asahi
08:30jeffmiw has quit [Ping timeout: 268 seconds]
08:46pipcet[m]marcan: I have a plan for that (start macos physically, teach qemu to identity-map /dev/mem for the relevant ranges)
08:48pipcet[m]sorry, I don't understand. qemu would still use its own page tables to translate simulated virtual to simulated physical, which would be equal to actual physical.
08:51marcanyou would need to restrict the RAM that Linux is allowed to use, and give macos a contiguous chunk of physical RAM
08:54marcanif you're going to cripple Linux to this point, I fail to see what that buys you over just using the HV in m1n1
08:55marcan... so you're loading a big blob of linux and qemu and everything into a tmpfs... without any network, storage, or anything... what's the point then?
08:55pipcet[m]and we don't even need usb for a minimal setup, we can communicate with macos through shared memory and do the i/o from the emulated macos
08:57marcanwhen you're giving the guest access to 95% of the hardware directly, having a massive OS in the way without being able to use most of its features just increases the bug/problem surface
08:59pipcet[m]marcan: again, I'm not convinced it's worth it or working on it, but someone asked and it's totally possible, if possibly harder than just getting the HV to work properly.
09:06svenmarcan: sooo.... you could just replace genter/gexit in the kernel text with hvc instructions while loading it :D
10:04vimal has joined #asahi
10:06jeffmiw has joined #asahi
10:10jeffmiw has quit [Ping timeout: 268 seconds]
10:14vimal has quit [Ping timeout: 260 seconds]
10:27vimal has joined #asahi
10:35raster has joined #asahi
10:38choozy has joined #asahi
10:42idt23[m] has joined #asahi
10:57klaus has quit [Ping timeout: 252 seconds]
10:57Bublik_ has joined #asahi
11:00Bublik has quit [Ping timeout: 265 seconds]
11:05klaus has joined #asahi
11:07odmir has joined #asahi
11:08odmir_ has joined #asahi
11:11jamadazi has joined #asahi
11:11odmir has quit [Ping timeout: 260 seconds]
11:13odmir_ has quit [Ping timeout: 260 seconds]
11:14jamadazihi guys! there hasn't been a public update post on the project for a long time now (a couple of months?), how's it going? has there been much progress on the project since the blog post update?
11:14jamadazii know those initial patches were accepted into mainline, but i don't know anything else
11:58maknho has joined #asahi
12:01maknho____ has quit [Ping timeout: 260 seconds]
12:53jeffmiw has joined #asahi
13:35modrobert has quit [Read error: Connection reset by peer]
13:35m0drobert has joined #asahi
13:35m0drobert is now known as modrobert
14:01VinDuv has quit [Quit: Leaving.]
14:04VinDuv has joined #asahi
14:12klaus has quit [Ping timeout: 260 seconds]
14:12KindOne has quit [Ping timeout: 268 seconds]
14:14klaus has joined #asahi
14:17marcanand since m1n1 maps everything as EL0-accessible, EL2 can't access any data, not even the stack
14:31svenpeterUgh, yes. I’ve been meaning to send the initial dumb version where a page is mapped for each clock for a while now
14:36VinDuv has left #asahi [#asahi]
14:39raster has quit [Quit: Gettin' stinky!]
14:41Spectrejan[m] has joined #asahi
14:41kettenisAh, but I may have botched the sending by effectively spoofing using my @openbsd.org address
14:43VinDuv has joined #asahi
14:43jeffmiw_ has joined #asahi
14:47Emantorkettenis: I'd wait for comments/Acks first. As long as the patches are fine I wouldn't bother to send again.
14:47c4r1c4[m] has joined #asahi
14:48jeffmiw_ has quit [Ping timeout: 240 seconds]
14:49Emantorhttps://lore.kernel.org/linux-arm-kernel/20210508142000.85116-1-kettenis@openbsd.org/T/#t
15:09agnem has quit [Quit: WeeChat 3.1]
15:29qyousef_ has joined #asahi
15:43odmir has joined #asahi
15:47odmir has quit [Remote host closed the connection]
15:49odmir has joined #asahi
15:50agnem has joined #asahi
15:56marcanso macos is panicing now... trying to figure out how to decode the panic from the hypervisor, since serial isn't initialized yet
16:04odmir has quit [Remote host closed the connection]
16:10yrlfmarcan: so if I understand it correctly, it prints the panic to the framebuffer, but macos died before it hits serial?
16:11pipcet[m]kettenis: FWIW, gmail classified your messages as spam, probably because of the spoofing thing
16:19marcanI already have the panic hooked because it triggers a debugger trap and I have all exceptions hooked
16:21yrlfahh, yeah, doing a debugger trap on panic definitely is something that makes sense for them to do
16:23yrlfthis kind of "semihosted" way of doing development with python and m1n1 cooperating definitely makes a lot of things easier
16:35c4r1c4[m] has left #asahi ["User left"]
16:45zkrx has quit [Ping timeout: 240 seconds]
16:51zkrx has joined #asahi
16:53odmir has joined #asahi
16:59jeffmiw has quit [Ping timeout: 240 seconds]
17:01marcanInvalid kernel stack pointer (probable corruption). at pc 0xfffffe00113dd374, lr 0xc1ff7e00112837e8 (saved state: 0xfffffe0015083cb0)
17:01marcanah, maybe this is a PAC thing; it's entirely possible the PAC registers are VHE'd and I'm passing through to the wrong ones
17:02Bublik has joined #asahi
17:03zkrx has quit [Ping timeout: 268 seconds]
17:04Bublik_ has quit [Ping timeout: 252 seconds]
17:08zkrx has joined #asahi
17:16marcan(for reference: so far this is kernel panic -> undefined instruction aka debuger trap -> hvc hook -> m1n1)
17:38marcana data abort on a possibly bad but not null address -> 15 frames of recursive null pointer dereferences due to the thread context not being fully initialized -> panic due to stack overflow -> debugger break -> hypercall hook -> m1n1 -> python exception handler
17:55solarkraft has joined #asahi
17:57marcanI guess I'm going to have to figure out how to get kernel symbols to make any sense of this
18:44jeffmiw has joined #asahi
18:45jeffmiw_ has joined #asahi
18:45jeffmiw has quit [Read error: Connection reset by peer]
18:48vimal has quit [Quit: Leaving]
18:55marcanI suspect devtree. maybe it's trying to look up mach-o sections in the memory map, I don't currently update those...
19:03trimental has joined #asahi
19:17odmir has quit [Remote host closed the connection]
19:20pipcet[m]oh, I thought m1n1 relocated itself somewhere safe (because obviously that's what I'm doing). It might be worth it just to try relocating m1n1 somewhere and loading the guest at the physical address iBoot gave you?
19:21balrog marcan kernel symbols? go to developer.apple.com/download/more, download the matching KDK, and install it. The symbols get installed in /Library/Developer/KDKs/KDK_version.kdk/System/Library/Kernels/kernel.BUILD.dSYM
19:21odmir has joined #asahi
19:21balrogThe symbols file for the release kernel is included, but the release kernel is built with lots of inlining
19:22balrogAnd yeah you need to be on 11.3 or later, or there won't be symbols for the t8101 kernel at all
19:26odmir has quit [Remote host closed the connection]
19:27odmir has joined #asahi
19:29odmir has quit [Remote host closed the connection]
19:35jeffmiw_ has quit [Remote host closed the connection]
19:40jeffmiw has joined #asahi
19:40odmir has joined #asahi
19:47yrlfmarcan: the fact that it's possible to debug this huge chain of faults and at all is already a _huge_ success of m1n1 and the hypervisor stuff you are doing
19:48yrlfprops to already getting this far! at this point I probably wouldn't want to develop an OS without such a nice debugging tool as m1n1
20:14balrogmarcan: the documentation with the KDK explains how to do two machine debugging but I'm not sure how that plays within m1
20:23VinDuv has quit [Quit: Leaving.]
20:34roxfando they support two-machine debugging for arm? iirc first releases supported panic symbolication only
20:40odmir has quit [Remote host closed the connection]
20:47linkmauve has quit [Ping timeout: 246 seconds]
20:55kettenis has quit [Ping timeout: 240 seconds]
20:57kettenis has joined #asahi
21:07jeffmiw has quit [Remote host closed the connection]
21:07odmir has joined #asahi
21:10jeffmiw has joined #asahi
21:11jeffmiw_ has joined #asahi
21:11jeffmiw has quit [Read error: Connection reset by peer]
21:12odmir has quit [Ping timeout: 250 seconds]
21:21odmir has joined #asahi
21:23diamondbond has joined #asahi
21:51jamadazi has quit [Quit: WeeChat 3.1]
22:06jeffmiw_ has quit [Remote host closed the connection]
22:17odmir has quit [Remote host closed the connection]
22:17odmir has joined #asahi
22:22odmir has quit [Ping timeout: 250 seconds]
22:23jeffmiw has joined #asahi
22:27jeffmiw has quit [Ping timeout: 260 seconds]
22:35raster has joined #asahi
22:47odmir has joined #asahi
22:51odmir has quit [Remote host closed the connection]
22:51odmir has joined #asahi
23:50choozy has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]