#
✕ nick:marcan
#asahi · 2021-05-09 08:57
marcanI think the checksum is linear? can probably get away with precomputing some powers of 31337 mod 2**32 and parallelizing this in numpy
#asahi · 2021-05-09 08:55
marcanj`ey: not right now
#asahi · 2021-05-09 08:55
marcanthen the checksum is left. if it's dumb enough maybe I can numpy it
#asahi · 2021-05-09 08:54
marcaneta: yeah I was thinking of shelling out to pigz for the gzip part too
#asahi · 2021-05-09 08:53
marcanI'm not sure chopping a kernel at the 10MB mark is a good idea :P
#asahi · 2021-05-09 08:53
marcanwonder if I can somehow use numpy or something to implement the checksum... or just disable checksums over USB anyway
#asahi · 2021-05-09 08:53
marcanand uh I really don't feel like implementing a cython module just for that :-)
#asahi · 2021-05-09 08:52
marcanand yeah but then the checksum is the bottleneck
#asahi · 2021-05-09 08:52
marcanmost of the time is *before* and *after* the dots!
#asahi · 2021-05-09 08:52
marcan(it's still faster than the old linux kernels over serial)
#asahi · 2021-05-09 08:52
marcanit's not *that* bad waiting a few seconds for it to load
#asahi · 2021-05-09 08:52
marcanI could append it as a m1n1 payload just to have it lying around there but... eh
#asahi · 2021-05-09 08:52
marcanwell I could stash the image somewhere in RAM that doesn't get touched, but right now I reboot the system after runs anyway to clean up properly so that wouldn't really help
#asahi · 2021-05-09 08:51
marcanand yeah the main thing missing is actually using the debug features so you can set breakpoints and such
#asahi · 2021-05-09 08:51
marcanso it's pretty much fail all around
#asahi · 2021-05-09 08:50
marcansven: actually compressing is about 1/3 of the time and calculating the checksum in python is about 1/3 of the time... and that's after switching from lzma to gzip :D
#asahi · 2021-05-09 04:58
marcan(which is like a 100+MB image)
#asahi · 2021-05-09 04:57
marcanhonestly the slowest part right now is just sending over the xnu kernel
#asahi · 2021-05-09 04:57
marcanthat's the beauty of this all, the silly fast test cycle
#asahi · 2021-05-09 04:57
marcanwas just changing one line of python :)
#asahi · 2021-05-09 04:57
marcansince I just made it break to the debugger on everything
#asahi · 2021-05-09 04:57
marcanso in fact the state right now is data abort on bad address -> hypercall hook -> m1n1 -> python
#asahi · 2021-05-09 04:56
marcaneach EL1 abort ends up in python anyway right now, it's just that initially I was passing through page faults on the assumption that they were normal (they aren't, not this early)
#asahi · 2021-05-09 04:55
marcanamw: that's already the case
#asahi · 2021-05-09 02:24
marcan"known good" bisection debugging is a valid strategy, but not worth it here, where I already have better visibility
#asahi · 2021-05-09 02:23
marcansince i'm getting faults I can just trace the cause of the problem with symbols/etc
#asahi · 2021-05-09 02:23
marcanpipcet[m]: what I meant is that what I'm doing should work; if it doesn't it means I'm doing something wrong, and I want to find out what it is
#asahi · 2021-05-08 19:25
marcanthe whole point of this exercise is understanding
#asahi · 2021-05-08 19:24
marcanpipcet[m]: I'd rather fix the problem than work around it
#asahi · 2021-05-08 19:18
marcanm1n1 lives where iBoot loaded things initially, the guest goes higher in memory
#asahi · 2021-05-08 19:12
marcannot with the hypervisor, obviously
#asahi · 2021-05-08 19:06
marcanyes
#asahi · 2021-05-08 19:06
marcanthat one would be valid when chainloaded, but not hv
#asahi · 2021-05-08 19:06
marcanhowever, there is at least one that would stay the same: the mach header
#asahi · 2021-05-08 19:06
marcanthat's true
#asahi · 2021-05-08 18:55
marcanI suspect devtree. maybe it's trying to look up mach-o sections in the memory map, I don't currently update those...
#asahi · 2021-05-08 18:52
marcanso obviously something's borked
#asahi · 2021-05-08 18:52
marcanit's a bad vaddr that corresponds, offset-wise, to physical address 0
#asahi · 2021-05-08 18:52
marcanok so the fault address is actually a null physical pointer
#asahi · 2021-05-08 18:04
marcancould just boot one of those
#asahi · 2021-05-08 18:03
marcanbut I'm going to upgrade this first, I'm on an ancient version
#asahi · 2021-05-08 18:02
marcanI think there are symbol files available
#asahi · 2021-05-08 17:57
marcanI guess I'm going to have to figure out how to get kernel symbols to make any sense of this
#asahi · 2021-05-08 17:38
marcana 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
#asahi · 2021-05-08 17:37
marcanyup so the fault chain currently is
#asahi · 2021-05-08 17:29
marcanI think this might be a recursive fault triggering a stack overflow
#asahi · 2021-05-08 17:16
marcanbut it looks like the panic is a stack check that happened due to a null deref
#asahi · 2021-05-08 17:16
marcan(for reference: so far this is kernel panic -> undefined instruction aka debuger trap -> hvc hook -> m1n1)
#asahi · 2021-05-08 17:15
marcanI'm starting to wonder how many levels deep into a fault I am
#asahi · 2021-05-08 17:15
marcanand it's a null deref reading from some percpu/thread info stuff

plus ›