#asahi-dev · 2026-07-14 07:44
svenagreed. but it's great you found that timer thing!#asahi-dev · 2026-07-14 07:39
chaos_princessi do think that it is probably not a xnu bug but us doing sth wrong#asahi-dev · 2026-07-14 07:39
chaos_princessoh well#asahi-dev · 2026-07-14 07:38
Carlosnope, without the recount_transition, instant panic: Nested panic detected - entry count: 2 panic_caller: 0xfffffe0013debbdc#asahi-dev · 2026-07-14 07:32
Carloslet me try#asahi-dev · 2026-07-14 07:32
chaos_princessi wonder if dropping it will be possible now#asahi-dev · 2026-07-14 07:32
Carloscorrect yuka#asahi-dev · 2026-07-14 07:32
yukaon M3 Pro it would've been --cpus 6#asahi-dev · 2026-07-14 07:32
yukabecause that means it only boots on the boot core#asahi-dev · 2026-07-14 07:31
svenwhich also explains why we don't hit this on m1/m2#asahi-dev · 2026-07-14 07:31
yukaMakes sense that --cpus 4 worked on M3 Max then#asahi-dev · 2026-07-14 07:31
Carlosyes i do the recount_transition patch manually every boot lol#asahi-dev · 2026-07-14 07:31
svenso it's probably really "write SYS_IMP_APL_AGTCNTRDIR_EL1, isb, write CNTHCTL_EL2" that's required instead of the other way around#asahi-dev · 2026-07-14 07:31
chaos_princessso, out of curiosity, do you still apply the recount_transition patch?#asahi-dev · 2026-07-14 07:31
svennice!#asahi-dev · 2026-07-14 07:30
Carlosjust booted on all cores, seems fine to me. camera stream now is stable, minimal lag in the os#asahi-dev · 2026-07-14 07:27
chaos_princessor upload somewhere and post/dm the link#asahi-dev · 2026-07-14 07:27
chaos_princessyou can pastebin the logs if they are small enough#asahi-dev · 2026-07-14 07:27
svendoes it run on stable on all cores now?#asahi-dev · 2026-07-14 07:27
chaos_princessperfectly normal and expected, i actually just needed logs up to login screen to this step#asahi-dev · 2026-07-14 07:26
Carlosthanks sven, btw#asahi-dev · 2026-07-14 07:26
Carlosi zipped them up, how should i share them?#asahi-dev · 2026-07-14 07:25
Carloschaos_princess: i have the logs now with isp tracing, but this time on opening facetime the camera failed to initialize#asahi-dev · 2026-07-14 07:24
svenlooking at his change the issue seems to be setting CNTHCTL_EL2 before setting up apple's counter redirection#asahi-dev · 2026-07-14 07:18
mazit is odd that CNTHCTL_EL2 has effects beyond a single CPU. It really is supposed to be local only.#asahi-dev · 2026-07-14 06:58
svenyeah, might just be some subtle hardware difference. very nice find!#asahi-dev · 2026-07-14 06:58
Carlossven: hard to say, maybe m1/2 serialized this context switching, or it completed it faster, not sure#asahi-dev · 2026-07-14 06:53
chaos_princessalso, please push the m1n1 change, i gotta test it on m3max too#asahi-dev · 2026-07-14 06:53
sven*hit#asahi-dev · 2026-07-14 06:53
svenweird that we didn't git that on m1/2 though#asahi-dev · 2026-07-14 06:53
Carlosah, forgot about that, let me do that#asahi-dev · 2026-07-14 06:53
chaos_princessCarlos: w/ trace_isp.py actice?#asahi-dev · 2026-07-14 06:53
svenhah, nice#asahi-dev · 2026-07-14 06:52
Carlossven: after some experiments, it seems like the bug was in the ordering which we write CNTHCTL_EL2 (timer/counter access control register). m1n1 set it before secondary cpu context was active, leaving CNTHCTL_EL2==0 in the new context. I added an ISB and moved it down after the context registers are restored.#asahi-dev · 2026-07-14 06:52
Carloschaos_princess: i'm now able to reliably boot with multiple cpus, i saved logs from a session where i opened facetime camera and stopped#asahi-dev · 2026-07-14 06:37
chadmedonly a few more unknown callbacks to go :3#asahi-dev · 2026-07-13 22:42
ryandrfrhello#asahi-dev · 2026-07-13 18:20
Carlos_yes i am planning to take a deeper look at it once i'm off work today#asahi-dev · 2026-07-13 18:14
sveni guess the spinlock code in xnu is open source, isn't it? so if it's really some timer issue we should be able to figure out what exactly it relies on#asahi-dev · 2026-07-13 18:13
svenso i wonder if this is a hardware difference with m3 or if we just have a subtle bug in hv that only gets hit because m3 speculates much more or something like that#asahi-dev · 2026-07-13 18:06
Carlos_iirc from last night the counters were at 24MHz#asahi-dev · 2026-07-13 18:04
sventhough i guess much more stuff would explode if that was wrong#asahi-dev · 2026-07-13 18:04
svenhrm, wasn't that 24MHz vs. 1 GHz counter thing first on m3? do we initialize those apple regs correctly?#asahi-dev · 2026-07-13 17:57
Carlos_from whatever regs i probed, it did seem fine but the repeated spinlocks suggest there is something wrong still#asahi-dev · 2026-07-13 17:55
sveni looked through the hv code a few days ago and the time stealing/accounting seemed okay to me. maybe it's time to take another look#asahi-dev · 2026-07-13 17:46
Carlos_i haven't found proof of my hypothesis, since all timers i probed seemed to be properly virtualized, all in sync, but logically it makes sense that there is some path running through the python client and making the boot think a cpu stalled#asahi-dev · 2026-07-13 17:44
Carlos_yeah i think that will make a difference. my hypothesis is that the hypervisor is introducing long waits in specific paths. so allowing longer timeout would help#asahi-dev · 2026-07-13 17:43
nickchanthe boot arg controls the number of microseconds before a ticket spinlock times out#asahi-dev · 2026-07-13 17:42
Carlos_thanks nickchan, i'll try that out#asahi-dev · 2026-07-13 17:23
nickchantlto_us=900000 boot-arg may help