2021-05-05
00:04odmir has quit [Ping timeout: 260 seconds]
00:15matt6 has quit [Ping timeout: 265 seconds]
00:30odmir has joined #asahi
01:15riker77 has quit [Ping timeout: 260 seconds]
01:16riker77 has joined #asahi
01:30odmir has quit [Ping timeout: 260 seconds]
01:57odmir has joined #asahi
02:22odmir has quit [Remote host closed the connection]
02:22odmir has joined #asahi
02:27odmir has quit [Ping timeout: 240 seconds]
02:37Namidairo has joined #asahi
02:38PhilippvK has quit [Ping timeout: 250 seconds]
02:39phiologe has joined #asahi
03:05gabiruh has quit [Remote host closed the connection]
03:05gabiruh has joined #asahi
03:06marvin24 has quit [Ping timeout: 250 seconds]
03:06marvin24 has joined #asahi
03:13crabbedhaloablut has quit [Ping timeout: 260 seconds]
03:14crabbedhaloablut has joined #asahi
03:29Namidairo has quit [Ping timeout: 268 seconds]
03:31crabbedhaloablut has quit [Ping timeout: 240 seconds]
03:33crabbedhaloablut has joined #asahi
03:53illya has quit [Quit: ZNC - https://znc.in]
03:56illya has joined #asahi
04:00crabbedhaloablut has quit [Ping timeout: 268 seconds]
04:02crabbedhaloablut has joined #asahi
04:30Namidairo has joined #asahi
04:42the-mentor3 has quit [Quit: The Lounge - https://thelounge.chat]
04:42the-mentor3 has joined #asahi
05:17VinDuv has joined #asahi
05:44Bublik_ has joined #asahi
05:46Bublik has quit [Ping timeout: 246 seconds]
06:04jeffmiw has joined #asahi
06:08jeffmiw has quit [Ping timeout: 240 seconds]
06:19VinDuv has quit [Quit: Leaving.]
06:25TheJollyRoger has quit [Quit: TheJollyRoger]
06:29Bublik has joined #asahi
06:31Bublik_ has quit [Ping timeout: 246 seconds]
07:10arndkrbtgt: the Sony PS3 was the original target for petitboot, and it could already boot a linux kernel that would only run on the ps3, so kexec was the easiest way to load a distro kernel
07:22tmlindfyi, there's also kexecboot that is a much simpler solution for folks needing a kexec gui
07:48ponikrf[m] has joined #asahi
08:14herbas has joined #asahi
08:21mazthere is also a set of patches that allow grub to run in *cough* userspace and use kexec as a backend. pretty neat for distro kernels.
08:36herbas has quit [Quit: herbas]
08:43raster has joined #asahi
09:43matt6 has joined #asahi
09:43matt6 has quit [Client Quit]
09:44matt6 has joined #asahi
09:44matt6 has quit [Client Quit]
09:44matt6 has joined #asahi
09:52anarsoul has quit [Ping timeout: 245 seconds]
09:54anarsoul has joined #asahi
10:05Bublik_ has joined #asahi
10:06Bublik has quit [Ping timeout: 240 seconds]
10:09agnem has quit [Ping timeout: 260 seconds]
10:13agnem has joined #asahi
10:23JTL has quit [Ping timeout: 260 seconds]
10:26agnem has quit [Ping timeout: 260 seconds]
10:29klaus has quit [Ping timeout: 240 seconds]
10:29agnem has joined #asahi
10:31JTL has joined #asahi
10:40klaus has joined #asahi
11:23taziden has quit [Ping timeout: 245 seconds]
11:52mazhttps://share.confex.com/share/122/webprogram/Handout/Session14802/SHARE-Anaheim-2014-zBoot-14802-20140304.pdf
11:53m0drobert is now known as modrobert
11:54pipcet[m]sven: I don't think we want grub in userspace, but I suspect we'd be happier with the device tree mangling in userspace. The main problem kexec has and had is that the old kernel may leave hardware in a bad state, and that's not an issue for us as the first kernel doesn't even need to touch the interrupt controller or anything.
11:55mazhttps://build.opensuse.org/package/view_file/SUSE:SLE-12:GA/grub2/grub2-s390x-02-kexec-module-added-to-emu.patch?expand=1
12:19taziden has joined #asahi
12:21ephe_meral1 has joined #asahi
12:29segher_ is now known as segher
13:01choozy has joined #asahi
13:10jeffmiw has joined #asahi
13:14jeffmiw has quit [Ping timeout: 240 seconds]
13:20maknho___ has quit [Ping timeout: 252 seconds]
13:21maknho___ has joined #asahi
13:34modrobert has quit [Read error: Connection reset by peer]
13:35modrobert has joined #asahi
14:39maknho____ has joined #asahi
14:41maknho___ has quit [Ping timeout: 260 seconds]
14:48maknho has joined #asahi
14:51maknho____ has quit [Ping timeout: 240 seconds]
15:10choozy has quit [Remote host closed the connection]
15:15pipcet[m]do we have any way at all of loading macos if it isn't currently configured to be the boot OS? I tried installing the macos .macho as a custom kernel but could not get that to boot.
15:16pipcet[m]or to emulate it (https://worthdoingbadly.com/xnuqemu2/ doesn't work on actual kernels), or to get a memory image of a running macos system (I don't suppose they have /dev/mem :-) ), or anything like that? Because without a way of doing that, I don't see how all this hypervisor work will ever pay off.
15:48pipcet[m]so which macho would we use? The .kc machos do not have plain AArch64 instructions in them.
15:49rwhitby has quit [Ping timeout: 250 seconds]
15:49rwhitby has joined #asahi
15:52pipcet[m]but so far the "load xnu and jump to it" part doesn't seem trivial to me. If it is, we should get that done first, I think, because that would give us debugging information even without a hypervisor.
15:57pipcet[m]you appear to be saying that it should be trivial to boot macos from, say, Linux, and the difficult bit is getting a hypervisor in. I think it's the opposite.
15:58sveni'm not sure it would be easy from linux but it's going to be relatively easy from m1n1 when almost no hardware is up and running
15:59pipcet[m]why "going to be", though? If it's the easy part we should do it first, to see whether it isn't actually tricky or impossible.
16:00choozy has joined #asahi
16:01jixhmm to me it seems there are two outcomes when trying this before the hypervisor is complete enough... a) jumping to the macos macho works right away b) it doesn't ... in case of a) there's nothing to do, in case of b) you'd probably want the hypervisor to be able to debug things
16:01yrlfpipcet: we can probably easily chainload MacOS from m1n1 (load it and jump in, basically), but without a hypervisor, that will not really be useful, since it effectively does the same as booting MacOS normally
16:07yrlfas far as I understand it, iboot2 will load the MachO, and jump to the entrypoint (same as it does with m1n1)
16:10yrlfso it does not work out of the box yet, but it's not _that_ far off if I understand this correctly
16:11svenpretty much. it might need some reverse engineering of undocumented macho headers (or however that format works) but i'm willing to bet it's possible to figure those out by staring at them
16:17svenpipcet[m]: so i'm not sure what you're looking at but the latest mac os kernelcache still contains plain aarch64 instructions
16:20yrlfusually, if I just want to disassemble something that the normal tools don't like I use radare2. though the more I learn about that tool the less I want to use it for that
16:21yrlf(I'm pretty sure if you throw the wrong binary at it you can easily get code execution from it)
16:21svenfor serious reverse engineering i generally stick to ghidra or ida pro. for quick glances objdump works fine though
16:31KindOne has quit [Quit: K-Lined]
16:56VinDuv has joined #asahi
17:10zkrx has quit [Ping timeout: 240 seconds]
17:12marcanthe very first test I did to convince myself kmutil worked was patch the darwin version string to say "Linux" and boot it
17:13marcanworked fine (and that also kills any conspiracy theories about apple "blocking" anything for custom kernels)
17:14marcan(and this also means my hypervisor stuff *will* work, modulo a as-yet unconfirmed level of fuckery to deal with corner cases due to macos running in EL1 not EL2, but by definition nothing insurmountable)
17:16marcanand yes, what I want to do could be accomplished with kexts, or with a patched FOSS XNU build, or any other number of ways
17:16marcanI chose the hypervisor approach because I liked it initially, and it is proving to have been an *excellent* idea because it also becomes a magical debugger for m1n1 and Linux themselves that anyone will be able to use, without a serial cable. built in USB to serial.
17:18marcanwill do more dev in the next 1-2 days; chances are good I'll have serial over a secondary CDC-ACM brought up really soon and that will mean anyone can load Linux kernels and debug m1n1 and Linux (and u-boot or whatever) bring-up with zero special hardware or cables or fuss, which is a big win
17:18marcan(single core initially, multicore will come a bit later, but that's good enough for a lot of work)
17:19marcansven: ghidra sadly barfs on current kernelcaches, but I'm trying to avoid disassembling anything at this point so I don't care
17:20marcanthe only thing I ended up doing in the early days was objdumping the xnu init section to figure out exactly what chicken bits Corellium got from there (and that told me they didn't know what they were doing and had copied useless stuff and added some of their own, so it was a good thing I did it :P)
17:33zkrx has joined #asahi
17:39pipcet[m]marcan: excellent news! As I said, on my device the kernel cache does not contain plain aarch64 instructions, and doesn't boot when installed as a custom kernel.
17:40marcanif you mean the kernelcache file, that would be an img4 wrapper built by kmutil; you need to extract the mach-o from it first before feeding it back to it
17:52marcanmake sure you're looking at the right file (/System/Volumes/Preboot/*/boot/*/System/Library/Caches/com.apple.kernelcaches/kernelcache)
17:53marcanand either way, they *are* releasing XNU source dumps; it might even be *easier* to do this with such a FOSS build, as those lack hypervisor support
17:54flying_sausages_ has quit [Quit: You just lost the game. Peace Out.]
17:54marcanonly reason I can think of why they'd encrypt XNU is to further obfuscate the M1-isms, though that cat is thoroughly out of the bag and if they do so I'm pointing squarely at ARM's lawyers being idiots
17:55flying_sausages has joined #asahi
17:58marcanif that goes wrong I could see ending up with a good-looking but very borked kernel image
17:59pipcet[m]I'd appreciate any help, but it looks like my concerns seem specific to my machine so far (purchased in March)
18:04marcanpipcet[m]: upgrade isn't done yet but I lifted the staged kernelcache from the upgrade volume
18:04marcanfor reference: Darwin Kernel Version 20.4.0: Thu Apr 22 21:46:41 PDT 2021; root:xnu-7195.101.2~1/RELEASE_ARM64_T8101
18:05marcanimg4 has sha1 221763401520819850b4a71ff00ab0dab9b55108; mach-o has sha1 5a652f986f3fa29c69c94a046a9a7122cc115a41
18:11marcanflying_sausages: soon, sorry, I have an update pending but got too caughed up in hypervisor development :)
18:12marcanI'll do a catch-up march post on the upstreaming stuff, then april-may will probably be a combined update about hypervisor goodies since this month is going to be fun
18:12flying_sausagesnice, cheers!
18:23marcanI was wrong, because I just chainload.py'ed darwin and it worked, framebuffer and serial output and all (didn't get to the desktop, might not even be the right kernel, but whatever)
18:24marcanactually that isn't even setting up the devicetree and trustcache properly; the version in hv.py does.
18:36svenmarcan: i never tried loading anything in ghidra. so far i've just used objdump to find the entry register for guarded exec and that's it :D
18:37marcanfwiw, this is a far as darwin gets when chainloaded: https://mrcn.st/p/jNkTDWj6 (again this may or may not even be the right kernel for the current iboot2/sfr...)
18:38pipcet[m]...okay, macos lets me have a different image, and that chainloads a little. I must have done something wrong in the recovery terminal
18:40marcanprobably the next thing I'll do is hook VBAR and add my own exception vector hooks that just hypercall on anything "interesting" like undefined instruction syndromes
18:40marcanI think there's a good chance just hooking all undefined instruction exceptions will let me do what I want
18:41marcan(I hate ARM for not letting me just flip a bit to do that, unless I missed something / cc maz)
18:46marcanhttps://mrcn.st/p/RA2VE5CV anyway there are your trap bits, and I bet bit 12 is related (trap instructions maybe?)
18:47zkrx has quit [Ping timeout: 252 seconds]
18:48marcanalso fwiw I don't care *too* much about w^x; I already had a similar problem with EL0 and solved it with a mirror. wouldn't be a big deal doing something similar for call() in the proxy if it comes to that.
18:49marcanI only use self-modifying code from python; m1n1's stuff should already be w^x and properly page aligned, I did it properly from the get go
18:51marcanoh, I just mean enable it whenever I feel like it, and then just keep call() working by pointing it at a rx mirror
18:52marcanwill probably need to extend your pagetable code to support actual page granularity, or otherwise align m1n1 to larger blocks
18:52marcan... thankfully, I already wrote fancier pagetable code for the HV which I can just copy and paste and simplify :p
18:52zkrx has joined #asahi
18:53svenokay, let me clean up my current code which just disables the mmu for p.gl1_call and then write some documentation (and/or a blog post because it's kinda awesome how you can figure this all out by (un)educated guesswork)
18:53KindOne has joined #asahi
18:53marcanactually, there is some reason to implement self-reloading for m1n1, which would amount to copying .data from a stash and clearing .bss and jumping to the entry
19:34maknho_ has joined #asahi
19:35maknho has quit [Ping timeout: 240 seconds]
19:47jeffmiw has joined #asahi
19:49riker77 has quit [Quit: Quitting IRC - gone for good...]
19:52zorun has quit [Ping timeout: 246 seconds]
19:52zorun has joined #asahi
19:58riker77 has joined #asahi
20:06VinDuv has quit [Quit: Leaving.]
20:39choozy has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
20:43ephe_meral1 has quit [Ping timeout: 265 seconds]
20:52jeffmiw has quit [Ping timeout: 252 seconds]
21:07lazarosser[m] has joined #asahi
21:07lazarosser[m]Is there an eta to when Asahi will be ready?
21:10lazarosser[m]<clover[m] "Linux 5.13 I think"> Will I be able to install on ipad pro?
21:11lazarosser[m]That makes sense.
21:11lazarosser[m]Since there is work essentially rewriting the whole stack
21:11lazarosser[m]Does this mean that m1 macs could technically be RYF compliant?
21:13skg has quit [Quit: 〜バイバイ〜!]
21:14skg has joined #asahi
21:17lazarosser[m]<clover[m] "Ido that acronym "> RYF "Respects Your Freedom" it is a thing the FSF likes. It means everything is open source in the hardware. With no proprietary blobs.
21:22jeffmiw has joined #asahi
21:25jeffmiw_ has joined #asahi
21:25jeffmiw has quit [Read error: Connection reset by peer]
21:29matt6 has quit [Quit: Connection closed]
21:49prusnak has left #asahi [#asahi]
21:50jeffmiw_ has quit [Remote host closed the connection]
22:40TomJepp has quit [Quit: ZNC closing...]
22:42TomJepp has joined #asahi
22:43jeffmiw has joined #asahi
22:47jeffmiw has quit [Ping timeout: 240 seconds]
23:10scubasteve has joined #asahi
23:26scubasteve has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
23:26scubasteve has joined #asahi
23:44odmir has joined #asahi
23:45chivay has quit [Quit: RIP]
23:46chivay has joined #asahi