#asahi-dev · 2026-07-11 10:31
svenyeah, that's just weird#asahi-dev · 2026-07-11 10:27
svenlol #asahi-dev · 2026-07-11 10:25
svenYup :(#asahi-dev · 2026-07-11 10:23
svenlol, no worries, i barely did any work for the last four or so months and just recently picked up again :-)#asahi-dev · 2026-07-11 08:59
svenhttps://git.kernel.org/pub/scm/linux/kernel/git/sven/linux.git/log/?h=efi-psci new version that survives a cpu powerdown and also doesn't cause lockdep splats#asahi-dev · 2026-07-10 21:34
svenlol, this is getting rather hacky now. i can reserve an ASID with arm64_mm_context_get in some initcall and then later switch mm via what's essentially switch_mm_fastpath in check_and_switch_context to bypass that asid allocator and the lock entirely#asahi-dev · 2026-07-10 19:05
svenah crap, it's the tracepoint #asahi-dev · 2026-07-10 18:59
svenhuh, wait, that one takes a raw spinlock and that should be fine i think#asahi-dev · 2026-07-10 18:56
svencan't take spinlocks anymore after ct_cpuidle_enter but the context switch to efi runtime mapping takes a spinlock *sigh*#asahi-dev · 2026-07-10 18:54
svenwell fuck, this is going to be very annoying to fix: https://f.svpe.de/6c2a2466c223751bd59151473486e23f92fb08a7466c5f50628b8952b630dbf7_crap#asahi-dev · 2026-07-10 18:26
sven"please contact the board at board@asahilinux.org and refrain from public speculation"#asahi-dev · 2026-07-10 16:00
svenalright, that linux psci code also works for "fake core powerdown", i.e. just disable mmu and jump to the entry_point immediately#asahi-dev · 2026-07-10 10:27
svenit'll still need halt=nop, but yeah, that's the plan#asahi-dev · 2026-07-10 10:20
sveni'm more interested if the linux side works correctly#asahi-dev · 2026-07-10 10:20
svenmeh, guess i can just fake it for now by having the psci code shut down the mmu and just jump to RVBAR itself for now#asahi-dev · 2026-07-10 10:19
svenand i wonder if that's just the hv not implementing that part#asahi-dev · 2026-07-10 10:19
svenbut it should come up again then and never does#asahi-dev · 2026-07-10 10:19
svenTTY> HV: Exiting from CPU 1#asahi-dev · 2026-07-10 10:19
svenTTY> HV: Requesting exit of CPU#1 from the guest#asahi-dev · 2026-07-10 10:19
sven[cpu1] Guest is shutting down CPU#asahi-dev · 2026-07-10 10:19
svenyeah, i see the catch#asahi-dev · 2026-07-10 10:18
sventrying to test psci with that mode where the core ends up at RVBAR and uhh.. the exit works but i think the cpu then never comes up again and i think that's because we just don't implement that correctly in the hv#asahi-dev · 2026-07-10 10:18
svenalso, did anyone ever test what happens when a cpu is shut down in the hv? does macos ever do that and we survive? #asahi-dev · 2026-07-10 10:17
svenyeah, finding that offset is rather simple#asahi-dev · 2026-07-10 06:16
sven(and on m2/m3 with SPTM XNU is ofc entered with MMU and all tha t already on)#asahi-dev · 2026-07-10 06:15
sven*already#asahi-dev · 2026-07-10 06:14
svenin EL1 xnu enables the mmu, yes. in EL2 the mmu is ofc laready on before the guest is entered#asahi-dev · 2026-07-09 20:06
svenyeah, hv_exc.c fixes this. so once each core went through at least one exception that hit hv_exc_entry everything's fine#asahi-dev · 2026-07-09 20:05
svenah.. i thinnk hv_exc.c may just fix this on the first exception anyway#asahi-dev · 2026-07-09 20:04
svenuh... or maybe i'm confused#asahi-dev · 2026-07-09 20:03
svenif they exit quickly enough they still meet, it's just that if they're too slow... well#asahi-dev · 2026-07-09 20:03
svenit's gonna send an IPI to each and every cpu anyway so we may just be very lucky on M1/M2#asahi-dev · 2026-07-09 20:02
svenessentially hv_rendezvous will return the moment it caught the boot cpu unless i'm missing something#asahi-dev · 2026-07-09 20:02
svendon't think so#asahi-dev · 2026-07-09 19:59
sventhat, uh, might just make every hv_rendezvous unreliable i think#asahi-dev · 2026-07-09 19:58
svenonly suspicious thing i found in the hv code#asahi-dev · 2026-07-09 19:58
svenhttps://github.com/AsahiLinux/m1n1/pull/621 🙃#asahi-dev · 2026-07-09 19:50
svenyeah, that too#asahi-dev · 2026-07-09 19:49
svenunless this sounds like fun ofc ;)#asahi-dev · 2026-07-09 19:48
svenimho stuff can always be made generic later, i usually prefer to just make it work for us for now#asahi-dev · 2026-07-09 19:37
sven10W, wtf#asahi-dev · 2026-07-09 19:15
svenweird#asahi-dev · 2026-07-09 19:07
svenhow is it unstable? still weird crashes in random places?#asahi-dev · 2026-07-09 18:28
svenwonder if there's another weird issue like that hiding somewhere in the hv code. i really don't want to debug another one like that though ;)#asahi-dev · 2026-07-09 18:26
svenyeah #asahi-dev · 2026-07-09 18:25
svenonce they’re up everything should be fine #asahi-dev · 2026-07-09 18:25
sventhat should only matter during smp bringup #asahi-dev · 2026-07-09 18:23
svenhuh, is the hv still unstable on m3?#asahi-dev · 2026-07-09 16:31
svenhttps://github.com/AsahiLinux/m1n1/pull/619#asahi-dev · 2026-07-09 16:26
svenphew... i expected this bug to be much worse :-)