#asahi-dev · 2023-04-19 05:58
marcanthese days the CPUs power down any time they're idle#asahi-dev · 2023-04-19 05:58
marcanback in the day you'd have needed s2ram for good battery#asahi-dev · 2023-04-19 05:58
marcanyou can tell this has all been improving with newer hardware from the xnu dumps#asahi-dev · 2023-04-19 05:58
marcanthat's what I enabled in the cpuidle stuff the other day#asahi-dev · 2023-04-19 05:57
marcannicolas17: the ACCs have "deep sleep" but it's not yet clear how much power it saves over CPU deep idle (which also powers down the individual cores)#asahi-dev · 2023-04-19 05:57
marcanultimately the only difference with s2ram is that in s2ram the CPUs go into effectively shutdown and the RAM goes into self-refresh... but there's no reason that wouldn't be achievable with the CPUs in deep sleep if you manage to quiesce all RAM traffic#asahi-dev · 2023-04-19 05:55
marcans2idle isn't just "be idle", you still put all devices into low power mode, we save about 1W over plain system idle right now and I'm sure there's more we can do#asahi-dev · 2023-04-19 05:54
marcanI think if macOS had been designed around AS from the get go they probably wouldn't have bothered with s2ram, and I still think there's a good chance we can get s2idle to be just about as good#asahi-dev · 2023-04-19 05:54
marcanwhich is probably why it's designed this way#asahi-dev · 2023-04-19 05:54
marcanand the whole s2ram thing would've been way more critical on intel since s2idle on intel is... not great#asahi-dev · 2023-04-19 05:53
marcanyeah#asahi-dev · 2023-04-19 05:50
marcanyeah#asahi-dev · 2023-04-19 05:50
marcanthe wifi implements ARP/ping/mDNS directly on the wifi card, so yeah, they're cheating#asahi-dev · 2023-04-19 05:49
marcan(among other things because there have been multiple macOS issues with suspend battery drain, probably caused by such wakeups)#asahi-dev · 2023-04-19 05:48
marcanat least on battery with default config, it's s2ram, but I suspenct macOS still periodically wakes up to do stuff and that's how it implements charge control#asahi-dev · 2023-04-19 05:48
marcanwell, it depends on config#asahi-dev · 2023-04-19 05:47
marcanthat's... a good question#asahi-dev · 2023-04-19 05:47
marcanthe ones exposed to userspace in sysfs have no safeties, you can ask it to discharge and it will happily run down your battery to emergency shutdown even while plugged in#asahi-dev · 2023-04-19 05:46
marcanthe one for optimized battery charging has an auto safety trip at 50% where it does autonomously go back to charging, presumably to prevent the battery from outright dying in sleep mode#asahi-dev · 2023-04-19 05:46
marcan(there are several)#asahi-dev · 2023-04-19 05:46
marcanno, those use a different set of charge controls :)#asahi-dev · 2023-04-19 05:45
marcanI would sort of expect it's used in suspend at least#asahi-dev · 2023-04-19 05:45
marcanI don't actually know if macOS 13 *uses* that feature, all I know is it's in the firmware#asahi-dev · 2023-04-19 05:44
marcan(same one the linux kernel-side limiter does)#asahi-dev · 2023-04-19 05:44
marcanthey use (one set of) the binary charge controls#asahi-dev · 2023-04-19 05:44
marcanalways was#asahi-dev · 2023-04-19 05:44
marcanyes#asahi-dev · 2023-04-19 05:44
marcanfirmware-based autonomous chage limiting is only on macOS 13#asahi-dev · 2023-04-19 05:14
marcanI imagine trying to bring them back after *that* would end up in RVBAR#asahi-dev · 2023-04-19 05:13
marcanso something else macOS does is allowing the clusters to go into deep sleep#asahi-dev · 2023-04-19 05:13
marcanbut when I shut them down without macOS involved, they don't#asahi-dev · 2023-04-19 05:13
marcanbecause when I shut down the cores after a guest sleep event, MMIO for the cores goes away (there's a bit for that even, which we both set)#asahi-dev · 2023-04-19 05:12
marcanre deep sleep, I think what's happening is that on M2 full shutdown only happens with proper full cluster shutdown, and that isn't working properly when I do it (but *is* when macOS does it)#asahi-dev · 2023-04-19 05:02
marcanI suspect the reason they do that is that they can guarantee sufficient vcore for those iff there is low vdroop from the other cores#asahi-dev · 2023-04-19 05:01
marcanchadmed_: the higher pstates do not increase the voltage, so I would expect linear power on those#asahi-dev · 2023-04-19 03:45
marcanthat's... interesting.#asahi-dev · 2023-04-19 03:45
marcanso it *always* returns from wfi instead of jumping to RVBAR#asahi-dev · 2023-04-19 03:45
marcansoo the core shutdown stuff *does* work on M1... it's just that on M2 the non-retention sleep bit seems to be gone?#asahi-dev · 2023-04-18 17:56
marcangood night :p#asahi-dev · 2023-04-18 17:56
marcannah, not that easy#asahi-dev · 2023-04-18 17:51
marcanthere's at least one interesting thing I can try though#asahi-dev · 2023-04-18 17:50
marcanI also don't have working serial right now so I can't debug whether it even tries#asahi-dev · 2023-04-18 17:50
marcanor well, I think it puts the system to sleep (after the guest does), but it definitely doesn't come back yet#asahi-dev · 2023-04-18 17:49
marcanpushed some sleep mode stuff that doesn't really work#asahi-dev · 2023-04-18 17:00
marcanI expect t6001 to use more power than t6000#asahi-dev · 2023-04-18 16:51
marcanjannau: that looks about right?#asahi-dev · 2023-04-18 16:24
marcanpushed the stuff#asahi-dev · 2023-04-18 16:23
marcanresume would be... more interesting to implement. I think we'd have to *actually* suspend the CPUs and m1n1 and go through the whole thing for real.#asahi-dev · 2023-04-18 16:22
marcanbut at least we get to see the entire suspend cycle#asahi-dev · 2023-04-18 16:22
marcanunfortunately there's an SMC timer or something triggered that forces a reboot a few seconds later