#asahi-dev · 2025-04-06 10:46
svenmischa85: uh, no. the point is to make wfi last longer but right now the core seems to exit that state pretty quickly again#asahi-dev · 2025-04-05 12:09
sventhat means that the e-cores likely don't spin up either#asahi-dev · 2025-04-05 11:58
svenhave you figured out how to start the other cores yet?#asahi-dev · 2025-04-05 10:45
svenx1 should be fine, that reg is just allowed to be discarded across function calls #asahi-dev · 2025-04-05 10:45
svenah, no, nvm#asahi-dev · 2025-04-05 10:45
svenor looking at https://github.com/AsahiLinux/m1n1/blob/5291d5c1ccee788086972dbad21ba9202be30b8d/src/utils_asm.S#L155 you probably want to use x18 instead of x1#asahi-dev · 2025-04-05 10:43
svenif state is never retained it always uses deeper sleep states#asahi-dev · 2025-04-05 10:43
svenif state is sometimes retained then there's some HW heuristic that decides if wfi uses deeper sleep states#asahi-dev · 2025-04-05 10:43
svenif state is always retained than wfi won't ever enter deep sleep#asahi-dev · 2025-04-05 10:42
svenmischa85_: (let's move back from -re): run m1n1 and write some code that prepare a timer interrupt or something, save all regs, set x1 to some magic value, run wfi, check if x1 still has that magic value, restore all regs or something like that#asahi-dev · 2025-04-05 09:56
svenmischa85_: also, I think m4 doesn't seem to require any chicken bits (or they're already set up in iboot before we get control)#asahi-dev · 2025-04-05 08:22
svensee #asahi-re, i think cyc_ovrd just doesn't exist anymore on M4#asahi-dev · 2025-04-04 10:50
sventime is probably the issue for all of us :D#asahi-dev · 2025-04-04 10:29
svenstill all pretty far away since we need to get m1/2 upstream and then ideally bring up m3 directly upstream as well #asahi-dev · 2025-04-04 10:27
svenor maybe it just works differently on m4. We don’t really know yet #asahi-dev · 2025-04-04 10:26
svenbut sleep might just be a bug, ie they just disabled everything and didn’t realize that the sleep msr is very important #asahi-dev · 2025-04-04 10:26
svenyeah, the rest we can (painfully) work around probably #asahi-dev · 2025-04-04 10:19
svenplus deep sleep states might be affected which would actually be important for running Linux #asahi-dev · 2025-04-04 10:19
svenit’s mostly annoying because our Hv for reverse engineering won’t work without these extensions #asahi-dev · 2025-04-04 08:02
svenany of the deeper wfi states being broken would be very bad :(#asahi-dev · 2025-04-04 06:42
svenmaybe that. maybe arm lawyer being annoyed just because they were bored. maybe both. :/ #asahi-dev · 2025-04-04 06:27
svenhaven’t thought about it in details but probably hijack exception vectors and maybe proxy calls to SPTM to mess with page tables #asahi-dev · 2025-04-04 06:26
svenit’s going to be painful, yes #asahi-dev · 2025-04-04 06:13
svenfor the rest patching our tracers into xnu might just work #asahi-dev · 2025-04-04 06:13
sventhough I guess it’s just iommus and power stuff that’s hidden in SPTM and that binary isn’t very large #asahi-dev · 2025-04-04 06:12
svenas long as they’re gonna reverse all the new hardware and write drivers then :D#asahi-dev · 2025-04-04 06:08
svenbut anyway, I’m not going to play cat and mouse. I’ve done that ages ago on consoles and don’t want to ever do that again. it’s just no fun #asahi-dev · 2025-04-04 06:05
sventhere’s also the issue that booting on >15.1 seems to fail. maybe they accidentally broke raw boot objects and didn’t notice 🙃#asahi-dev · 2025-04-04 05:49
svenanother thing that’s going to be annoying: DART etc is inside SPTM so we won’t be able to trace that #asahi-dev · 2025-04-03 20:54
svent8112 (M2) seems to have SPTM support as well in the latest firmware #asahi-dev · 2025-04-03 16:57
svenand even if there was we’d still need to see if we could stuff SPTM into GL1 and have everything still work as expected #asahi-dev · 2025-04-03 16:57
svenwould be surprised if there was a way to run code in GL2 though #asahi-dev · 2025-04-03 16:55
svenyeah, totally forgot about that #asahi-dev · 2025-04-03 16:55
svenohhh true #asahi-dev · 2025-04-03 16:52
sventhe problem with abusing bugs is that they’ll probably still be fixed unless we keep them secret and I really don’t want to play that game again #asahi-dev · 2025-04-03 16:51
svensounds like hv on m4+ is gonna be painful either way *sigh*#asahi-dev · 2025-04-03 15:33
svenif that's true it's going to make hv bringup very very annoying#asahi-dev · 2025-04-03 15:33
svenwhen configuring a macho object they'll start this SPTM thing in GL2 and then drop to EL2 and only then give control to the macho#asahi-dev · 2025-04-03 15:33
sven(i.e. we're running under EL2 with GL2,etc. completely disabled)#asahi-dev · 2025-04-03 15:32
svenwhat i think happens is that they disabled their custom ISA extensions when using a raw boot object#asahi-dev · 2025-04-03 15:32
svenmischa85: so it looks like that XNU on M4 expects to be running in EL2 under what Apple calls SPTM in GL2, see e.g. https://github.com/apple-oss-distributions/xnu/blob/main/osfmk/arm64/sptm/start_sptm.s#L34#asahi-dev · 2025-03-31 18:00
svenwhat makes you think that’s the cause?#asahi-dev · 2025-03-30 17:53
sveni'd like to know if the hv works on m1/m2 with your patches. if it does it's a HW issue with M4. if it doesn't one of your commits broke it.#asahi-dev · 2025-03-30 17:48
svendo you have access to a m1/m2 and can run your hacked m1n1 there and see what happens?#asahi-dev · 2025-03-30 17:33
svendo you know if you can even execute a single instruction while running the hv successfully?#asahi-dev · 2025-03-30 10:32
svenhave you already tried a simpler payload as a guest, e.g. just m1n1 again?#asahi-dev · 2025-03-30 09:26
svenyeah, they'd still need to support modified xnu kernels for people writing kexts, etc.#asahi-dev · 2025-03-30 09:18
svenugh, that sounds like apple locked those down inside iboot already#asahi-dev · 2025-03-29 20:47
svenuh, isn’t it already somewhere inside xnu?#asahi-dev · 2025-03-29 18:18
svendoes mrs work with any other register?