#asahi-dev · 2026-04-15 07:18
yukahttp://yuyu.yuka.dev/public/regs_full#asahi-dev · 2026-04-15 07:18
yukahttp://yuyu.yuka.dev/public/regs_core8#asahi-dev · 2026-04-15 07:18
yukahttp://yuyu.yuka.dev/public/regs_core7#asahi-dev · 2026-04-15 07:17
yukahttp://yuyu.yuka.dev/public/regs_boot_core#asahi-dev · 2026-04-14 22:38
yukaanyways thanks for the hints, heading to bed#asahi-dev · 2026-04-14 22:27
yukaIn fact, all regs which differ between the boot cpu and a secondary cpu are readonly, so it is going to be difficult to find out which one we would need#asahi-dev · 2026-04-14 22:21
yukashould I upload the dumps somewhere?#asahi-dev · 2026-04-14 22:20
yukaalmost everything is readonly#asahi-dev · 2026-04-14 22:19
yukaso I can compare 3-way#asahi-dev · 2026-04-14 22:19
yukaI now have dumps of the boot core, and two other p-cores#asahi-dev · 2026-04-14 21:39
yukaof the boot core at least#asahi-dev · 2026-04-14 21:39
yukaok, dumped the regs#asahi-dev · 2026-04-14 21:37
yukathe exception handler crashes#asahi-dev · 2026-04-14 21:35
yukawill decrease the size of the insns blocks#asahi-dev · 2026-04-14 21:34
yukaUartTimeout as soon as the first u.exec(insns, ...) runs#asahi-dev · 2026-04-14 21:08
yukaI do not know which script you mean with msr scan. it would be in proxyclient/experiments?#asahi-dev · 2026-04-14 21:05
yukayes#asahi-dev · 2026-04-14 21:04
yukaI updated like 5 days ago#asahi-dev · 2026-04-14 21:04
yukalatest#asahi-dev · 2026-04-14 21:00
yukaI really don't think this is configurable from what we have seen on M4#asahi-dev · 2026-04-14 21:00
yukalooking at xnu source there is no replacement for CYC_OVRD#asahi-dev · 2026-04-14 20:59
yukaI will try patching all the relevant wfis. I thought it was many more and would be infeasible.#asahi-dev · 2026-04-14 20:46
yukaunless I somehow misremember the numbers of the exception levels#asahi-dev · 2026-04-14 20:46
yukaI think the kernel installs the kvm-stub in EL2 and then mostly runs in EL1#asahi-dev · 2026-04-14 20:40
yukaI did not do it yet, but I somehow doubt there is a way to change this behavior#asahi-dev · 2026-04-14 20:39
yuka2. Somehow patch all WFI calls inside the Linux kernel#asahi-dev · 2026-04-14 20:39
yuka1. Wait for 🍏 to deliver an iBoot update which makes WFI not lose register state#asahi-dev · 2026-04-14 20:39
yukaLike the other possibilities I see are:#asahi-dev · 2026-04-14 20:36
yukacan you elaborate?#asahi-dev · 2026-04-14 20:18
yukaBut also not sure how much overhead this would have#asahi-dev · 2026-04-14 20:18
yukaFor M4, I think I could enable WFI trapping and then handle the register save & restore in EL2? Like I would hack this into the Linux EL2 entrypoint. Not sure how difficult it would be to make it coexist with kvm.#asahi-dev · 2026-04-14 14:39
yukaWe should first confirm it exactly by doing wfi in m1n1 and testing the register state afterwards#asahi-dev · 2026-04-14 14:36
yukaI have all cores up :)#asahi-dev · 2026-04-14 14:35
yukaSo I guess just nobody else implemented this?#asahi-dev · 2026-04-14 14:29
yukaDo they claim that this is ARM ISA compliant anywhere?#asahi-dev · 2026-04-14 14:24
yukabut yeah maybe there is some new msr controlling this#asahi-dev · 2026-04-14 14:24
yukaI checked the CYC_OVRD and it's 0 in all cpus and it can't be set#asahi-dev · 2026-04-14 14:22
yukaor, like, always _may_ lose register state, on the boot cpu it doesn't#asahi-dev · 2026-04-14 14:21
yukabut the more I look at it, the more plausible it becomes that wfi always loses register state on M4#asahi-dev · 2026-04-14 14:21
yukabasically#asahi-dev · 2026-04-14 14:20
yukawith WFE it just gets stuck. With WFI simply commented out it gets a bit further before it crashes (possibly because some other code also does WFI)#asahi-dev · 2026-04-14 14:12
yukaor rather registered, since it's a builtin#asahi-dev · 2026-04-14 14:12
yukait is probably loaded too late#asahi-dev · 2026-04-14 14:07
yukaSadly it seems just loading cpuidle-apple with the CYC_OVRD accesses removed is not sufficient#asahi-dev · 2026-04-14 14:06
yukaIf I'm not completely crazy, x20 is one of the registers saved and restored for deep sleep by the cpuidle-apple driver. And the null pointer dereference I'm getting is exactly dereferencing x20#asahi-dev · 2026-04-14 13:14
yukaHowever I'm not sure if this explanation is coherent with it only happening on secondary cores#asahi-dev · 2026-04-14 13:14
yukaAs in maybe after waking up from idle some of the registers have lost their value and now contain null values#asahi-dev · 2026-04-14 13:14
yukaI had a wild theory that the random Null pointer dereferences in the idle loop on M4 secondary cores could be caused by a deeper sleep state being now the (nonconfigurable) default.