#asahi · 2021-04-24 11:25
svenkettenis1: yeah, i think the interrupts would only require an additional interrupt-controller; in there.#asahi · 2021-04-24 11:22
sventhere's a AppleSamsungSPI.kext so it might be so samsung variant controller again#asahi · 2021-04-24 11:21
svenpipcet[m]: yeah, the i2c one. and yes, the corellium code has some, uh, issues#asahi · 2021-04-24 11:20
svenyou don't need a gpio pin to enable the ti chip#asahi · 2021-04-24 11:19
sventhat ti usb chip uses a gpio interrupt fwiw#asahi · 2021-04-21 21:28
sveni'll finish figuring out some details this week and document it then :)#asahi · 2021-04-21 21:27
sveni believe it's meant to prevent most of kernel text to modify pagetables#asahi · 2021-04-21 21:27
svenand i think the guarded name is misleading, it's essentially https://siguza.github.io/APRR/ with more custom extensions#asahi · 2021-04-21 21:26
sveni don't know what BTI is#asahi · 2021-04-21 21:23
sveni've played around with those a little bit today. don't think they are documented anywhere yet#asahi · 2021-04-21 21:23
svenPthariensFlame[m: it's apple-specific#asahi · 2021-04-21 21:22
svenbut we can ignore those for linux#asahi · 2021-04-21 21:22
sventhe m1 also has gl1 and gl2 (guarded levels apparently) on top of that which are the same as el1/2 but the meaning of some permission bits in the pagetables change#asahi · 2021-04-21 21:20
svennimroot[m]: "exception levels". i believe x86 calls these "rings"#asahi · 2021-04-21 21:19
svenand i'd be surprised if these still exist on the m1 ;)#asahi · 2021-04-21 21:19
sveniirc project zero did that stealing a cpu core thing to build an ios debugger. they abused some debug registers though to actually debug the other cores#asahi · 2021-04-21 21:17
svenor if you still doubt that it'll even run in el1 just take a working kernel and patch _start to drop to el1 as early as possible#asahi · 2021-04-21 21:16
svenafter that we can add the 2nd stage translation#asahi · 2021-04-21 21:16
svenrunning xnu itself in el1 is really just a matter of maybe patching the ADT and loading the kernelcache correctly#asahi · 2021-04-21 21:15
svenyeah :-)#asahi · 2021-04-21 21:15
svenjust on the first two#asahi · 2021-04-21 21:15
svenactually, no#asahi · 2021-04-21 21:15
sveni disagree on all three points :D#asahi · 2021-04-21 21:14
svennot sure what that would gain us compared to running it under a hypervisor#asahi · 2021-04-21 21:11
svenit will fail fairly early on non-apple hw though once it tries to access apple specific MSRs or instruction set extensions#asahi · 2021-04-21 21:11
svenokay, let me rephrase: i'm 99% sure the kernel will run just fine in EL1 on Apple Silicon hardware#asahi · 2021-04-21 21:07
svenbut as i said, the kernel looks like it'll run just fine in el1#asahi · 2021-04-21 21:07
svendoesn't really matter, we could just patch those checks#asahi · 2021-04-21 21:04
sven//System/Library/Kernels/kernel.release.t8101#asahi · 2021-04-21 21:04
svenwhich is essentially the kernel + all kexts#asahi · 2021-04-21 21:04
svenbut what gets actually booted is what apple calls kernelcache i think#asahi · 2021-04-21 21:03
sventhere's a macho binary with just the kernel somewhere in /System#asahi · 2021-04-21 21:03
svenit's complicated :-)#asahi · 2021-04-21 21:02
svenprobably needs some patches to the ADT but should be fine otherwise#asahi · 2021-04-21 21:01
svenyeah, the xnu kernel should be able to run in both el1 and el2 without any changes#asahi · 2021-04-21 21:00
svendon't think so#asahi · 2021-04-21 21:00
svenand then at least intercept read32/write32 from macos to understand how the hardware works#asahi · 2021-04-21 20:59
svenpretty much#asahi · 2021-04-20 20:38
svenwhich is.. another iommu i guess#asahi · 2021-04-20 20:37
svenit's behind what apple calls SART#asahi · 2021-04-20 20:37
svennvme isn't behind a DART#asahi · 2021-04-20 19:52
sveni don't think i pushed it anywhere since it's more of a hack#asahi · 2021-04-20 19:48
sven(or maybe i messed up)#asahi · 2021-04-20 19:48
svenfor some reason their binding didn't seem to respect dma-ranges and was still stuck with 32bit addresses which won't work#asahi · 2021-04-20 19:48
svenso the easy way to get it to work is to setup the iommu to bypass mode from m1n1, add dma-ranges; to the device tree and patch the dwc3 driver to use 64bit dma addresses#asahi · 2021-04-20 19:47
svenit was working in linux before i wrote the code for m1n1 actually ;)#asahi · 2021-04-20 19:47
svenpipcet[m]: linux#asahi · 2021-04-20 19:42
svenit might've just been a hobby or a 20% project :)#asahi · 2021-04-20 19:42
sveni mean that part makes sense. it was good (and deserved) PR for them#asahi · 2021-04-20 19:42
svenhah