#
#asahi-dev · 2026-01-09 21:39
Shiz(this wasn't re fwiw)
#asahi-dev · 2026-01-09 21:39
chaos_princessThat looks like open source xnu, no?
#asahi-dev · 2026-01-09 21:39
Shizoops, sorry *
#asahi-dev · 2026-01-09 21:39
Shiz b.ne 1f // precise time update.oops, sorry
#asahi-dev · 2026-01-09 21:39
Shiz tst x23, PSR64_MODE_EL_KERNEL // If interrupting this kernel, skip
#asahi-dev · 2026-01-09 21:39
svenplease keep re stuff to #asahi-re :)
#asahi-dev · 2026-01-09 21:38
Shiz b.ne 1f // precise time update.
#asahi-dev · 2026-01-09 21:38
Shiz tst x23, PSR64_MODE_EL_KERNEL // If interrupting this kernel, skip
#asahi-dev · 2026-01-09 21:38
Shizxnu-10063:
#asahi-dev · 2026-01-09 21:38
Shiz:D
#asahi-dev · 2026-01-09 21:38
Shizthey changed the check between xnu-14.8.3 and current
#asahi-dev · 2026-01-09 21:38
svenuhhh
#asahi-dev · 2026-01-09 21:38
svenat least it had something != EL0 in that recount structure from the thread. it might still be coming from EL0
#asahi-dev · 2026-01-09 21:38
Shizit might be that the old kernel is borken
#asahi-dev · 2026-01-09 21:38
Shizuggh
#asahi-dev · 2026-01-09 21:38
noopwafelaaagh
#asahi-dev · 2026-01-09 21:37
sveni assume recent macos (like 26) still works under the hv on m1?
#asahi-dev · 2026-01-09 21:37
noopwafelour reading is that it expects to be coming from el0 but actually it was in el1. based on the xnu code.
#asahi-dev · 2026-01-09 21:36
chaos_princessAlso, does anyone remember what was the apcie xnu boot arg for?
#asahi-dev · 2026-01-09 21:36
svenosfmk/kern/recount.c
#asahi-dev · 2026-01-09 21:36
svenyeah, i'm looking at the xnu code that runs everywhere
#asahi-dev · 2026-01-09 21:36
chaos_princesssven: recount transition also happens on m1pro
#asahi-dev · 2026-01-09 21:35
noopwafel(x23 contains SPSR_EL1)
#asahi-dev · 2026-01-09 21:35
svenyeah, and then it updates the level just after the assert in that performance accounting structure attached to the thread
#asahi-dev · 2026-01-09 21:34
Shizif I understand correctly
#asahi-dev · 2026-01-09 21:34
Shizso when it's transition from user to kernel, whether current thread is user, and when it's transitioning from kernel to user, wheether current thread is kernel
#asahi-dev · 2026-01-09 21:34
Shizyea
#asahi-dev · 2026-01-09 21:31
svenmaybe i'm reading the code wrong, but doesn't it check if the EL in the thread context (or whatever) is equal to the expected EL (EL0 here)?
#asahi-dev · 2026-01-09 21:30
noopwafelit thinks we are in el0.
#asahi-dev · 2026-01-09 21:28
Shizit's basically fleh_dispatch64 (first-level exc handler) -> bl EXT(recount_leave_user) -> recount_transition -> assert
#asahi-dev · 2026-01-09 21:26
svenuh, i wonder if we're patching a symptom of some corruption already. that assert seems to be triggered on unexpected ELn->ELm transitions i think
#asahi-dev · 2026-01-09 21:24
svenit's some performance accounting for threads i think, but the code is rather confusing
#asahi-dev · 2026-01-09 21:23
leiocan we nerdsnipe jann_au into that vfio thing for AVD next? *g
#asahi-dev · 2026-01-09 21:20
svenlovely
#asahi-dev · 2026-01-09 21:20
noopwafelfailing with beautiful nested panics
#asahi-dev · 2026-01-09 21:20
noopwafelit is about user/kernel transition
#asahi-dev · 2026-01-09 21:20
svenblind guess though
#asahi-dev · 2026-01-09 21:20
svenand with m3 there was some change to the cycle counter which got switched to 1 GHz or something like that so maybe that's related?
#asahi-dev · 2026-01-09 21:19
svenokay, that's in open source xnu (at least partially) and seems to be related to timing or something
#asahi-dev · 2026-01-09 21:15
Shiz`recount_assert_level(thread, from);` is the assertion that fails withot the _recount_transition patch
#asahi-dev · 2026-01-09 21:14
sventhat sounds cursed
#asahi-dev · 2026-01-09 21:14
svenhuh
#asahi-dev · 2026-01-09 21:14
noopwafelyeah
#asahi-dev · 2026-01-09 21:14
svenokay, wait, so the msr insn executes but then it runs into a dabort later on?
#asahi-dev · 2026-01-09 21:13
Shizso by the time we have the dabort it's hard to debug
#asahi-dev · 2026-01-09 21:13
sventhat sounds very weird
#asahi-dev · 2026-01-09 21:13
Shiznot sure, it seems a bunch of memory gets stomped over
#asahi-dev · 2026-01-09 21:12
svenso it does a dabort at the msr instruction?
#asahi-dev · 2026-01-09 21:12
svenhuh
#asahi-dev · 2026-01-09 21:12
Shizwhich is a branch patch, not an msr patch

plus ›