#asahi-dev · 2026-08-15 18:49
yukabut I can't be fully sure how this works internally#asahi-dev · 2026-08-15 18:48
yukapmgr regs say so#asahi-dev · 2026-08-15 18:48
chaos_princessare you sure they are off?#asahi-dev · 2026-08-15 18:47
yukathe cores/clusters can hardly use less energy than when they're not turned on in the first place?#asahi-dev · 2026-08-15 18:45
yukachaos_princess: but last time I tested, even just skipping smp_start_secondaries barely resulted in any power saving#asahi-dev · 2026-08-15 18:43
mmediouni[m]yuka: doesn't seem like it#asahi-dev · 2026-08-15 18:41
chaos_princessit is the thing we are using for sleep on m1-3#asahi-dev · 2026-08-15 18:41
svencould be something like clock gating vs. power gating but who knows#asahi-dev · 2026-08-15 18:40
chaos_princessit uses less power#asahi-dev · 2026-08-15 18:40
yukadoes the semi-retention wfi actually power down the core (or cluster, if done on all cores)#asahi-dev · 2026-08-15 18:40
sveni don't really care about naming, but deep wfi has always been very confusing to me#asahi-dev · 2026-08-15 18:39
yukathat's confusing?#asahi-dev · 2026-08-15 18:39
yukaAha, this corresponds to STATE_PWRDOWN#asahi-dev · 2026-08-15 18:38
yukahttps://github.com/AsahiLinux/linux/blob/e2e1930a9595bffafad92cec2b5504525efb9cd4/drivers/cpuidle/cpuidle-apple.c#L24#asahi-dev · 2026-08-15 18:37
chaos_princessmakes sense https://github.com/apple-oss-distributions/xnu/blob/f6217f891ac0bb64f3d375211650a4c1ff8ca1ea/osfmk/arm64/machine_routines_asm.s#L1099#asahi-dev · 2026-08-15 18:37
yukawhatever#asahi-dev · 2026-08-15 18:36
yukaroulette-wfi#asahi-dev · 2026-08-15 18:36
svensemi-retention wfi? :P#asahi-dev · 2026-08-15 18:35
yukabut now we use this as anchor to define proper names for it. And I think non-retention wfi should be the one which drops to RVBAR and *not* the WFI_MODE one which cpuidle-apple uses which retains pc (that should rather be "deep wfi"?)#asahi-dev · 2026-08-15 18:33
chaos_princessyes, but xnu does more things when enabling that mode#asahi-dev · 2026-08-15 18:33
yukaI think setting CYC_OVRD_DISABLE_WFI_RET drops you to RVBAR after the next wfi#asahi-dev · 2026-08-15 18:33
chaos_princessi guess it would be worth it to test setting all cores in cluster in one or the other and measuring system power#asahi-dev · 2026-08-15 18:32
mmediouni[m]Oh so recfg is locked down too#asahi-dev · 2026-08-15 18:32
svenyeah, and that's where my question came "is there a different between "wfi that jumps back to RVBAR" and "wfi that results in full cluster shutdown"?" came from because i'm not sure#asahi-dev · 2026-08-15 18:32
yukaCYC_OVRD_WFI_MODE=3 give the remaining core in the cluster the ability to boost but retains pc and sp#asahi-dev · 2026-08-15 18:31
chaos_princesssven: i _think_ it is a weird inbetween#asahi-dev · 2026-08-15 18:31
chaos_princesswhatever "reconfig engine" is#asahi-dev · 2026-08-15 18:31
mmediouni[m]That and the register masks lockdown#asahi-dev · 2026-08-15 18:31
mmediouni[m]What makes sure that the HIDx register values persist across deep sleep?#asahi-dev · 2026-08-15 18:31
sventhat's why i'm asking if there's a difference or if deep = false is just "enter shutdown wfi but don't set the cluster shutdown reg", i.e. some weird inbetween state#asahi-dev · 2026-08-15 18:30
svendeep = false -> ends up at RVBAR as well#asahi-dev · 2026-08-15 18:30
chaos_princessdeep=true - cluster, deep=false - non-retention#asahi-dev · 2026-08-15 18:29
svenchaos_princess: i'm talking about the difference between deep=true/false here https://github.com/AsahiLinux/m1n1/blob/88a98213d55f2cbd69844762c3171b39c0cd0bf9/src/utils.c#L249#asahi-dev · 2026-08-15 18:29
yukaAnd there are two bits in some of the sysregs#asahi-dev · 2026-08-15 18:29
yukanormal arm64#asahi-dev · 2026-08-15 18:28
yukathere are at least 3 behaviors of wfi#asahi-dev · 2026-08-15 18:28
chaos_princessyou can put just one core in the shutdown wfi, but the config regs are iirc cluster-global#asahi-dev · 2026-08-15 18:28
chaos_princessno? normal non-retention wfi keeps pc#asahi-dev · 2026-08-15 18:27
sven*difference#asahi-dev · 2026-08-15 18:27
svenis there a different between "wfi that jumps back to RVBAR" and "wfi that results in full cluster shutdown"?#asahi-dev · 2026-08-15 18:26
chaos_princessshould be normal arm64 wfi/non-retention wfi/that full cluster shutdown that we can't exit from#asahi-dev · 2026-08-15 18:26
sven<yuka> If we can agree on more precise terms of the possible states of a core and a cluster, and write them down somewhere that would be useful for these discussions <-- let's maybe do just that :D#asahi-dev · 2026-08-15 18:25
yukaMaybe this is where I got the term from, and matched it to the 'wfi which loses state' / what the cpuidle-apple driver does because that's what is actually needed#asahi-dev · 2026-08-15 18:24
svenmaybe another confusion of terminology and that was from before the cpuidle driver#asahi-dev · 2026-08-15 18:24
sven"/* Not available until CPU deep sleep is implemented */"#asahi-dev · 2026-08-15 18:23
svenhttps://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm64/boot/dts/apple/t8103.dtsi#n283 hmmm#asahi-dev · 2026-08-15 18:23
svenyup, agreed#asahi-dev · 2026-08-15 18:23
sventhat sounds like what i thought required actual power off#asahi-dev · 2026-08-15 18:23
yukaIf we can agree on more precise terms of the possible states of a core and a cluster, and write them down somewhere that would be useful for these discussions