#
#asahi · 2022-10-24 15:07
marcanthis does mean cpuidle will only work when booting via u-boot (which is the normal way, but not how I usually boot during development), but that's not a big deal
#asahi · 2022-10-24 15:07
marcanand then u-boot exposes it over UEFI
#asahi · 2022-10-24 15:06
marcanthe plan is to have an ad-hoc hook from u-boot back into m1n1 (linux doesn't have to care about this) so m1n1 can implement the actual PSCI handler
#asahi · 2022-10-24 15:06
marcanu-boot provides the UEFI bit
#asahi · 2022-10-24 15:06
marcanyes
#asahi · 2022-10-24 15:06
rannright, so psci over uefi runtime services is then a psci device which lives in m1n1 and somehow utilizes uefi runtime services to do what it needs to do, without a dependency on any kind of virtualization?
#asahi · 2022-10-24 15:03
marcanand the only way to keep both things is NV
#asahi · 2022-10-24 15:03
marcanwhich is obviously undesirable
#asahi · 2022-10-24 15:03
marcanwe could use normal virtualization but then that would break virtualization in linux
#asahi · 2022-10-24 15:02
rannjust to verify my own understanding: you would in such a case implement a psci device/interface in m1n1 so that when linux boots on top of that, it could use that (through CONFIG_ARM_PSCI presumably). To implement that, you would need to use nested virt which is madly complex and m2 only. Did I grasp it correctly?
#asahi · 2022-10-24 14:58
rannright, good poinst
#asahi · 2022-10-24 14:57
j`eyand it wouldnt work on m1 anyway
#asahi · 2022-10-24 14:57
marcanm1n1 implements a research hypervisor but I am not adding nested virt to it so people can do crazy stuff like this :p
#asahi · 2022-10-24 14:57
rannfair enough!
#asahi · 2022-10-24 14:56
marcanbut it's a terrible idea because first it would have to be M2+ only, and second because nested virt is stupidly complex to implement and has nontrivial overhead
#asahi · 2022-10-24 14:56
marcanPSCI supports hypervisors, that much would just work
#asahi · 2022-10-24 14:55
rannmarcan: how/why would it be possible to implement this with a hypervisor that supports nested virtualization (and it sounds crazy to me also, but why do you think its a terrible idea)
#asahi · 2022-10-24 14:54
marcannot sure if something "magic" happens at that point or if it's just a consequence of the design that "S3" isn't much more than deep WFI as far as the CPUs are concerned
#asahi · 2022-10-24 14:53
marcanalso this is part of how to enter "S3" (AIUI you set things up to go into proper sleep, then deep-WFI all cores)
#asahi · 2022-10-24 14:53
marcanlinux probably prefers to control it itself
#asahi · 2022-10-24 14:53
povikok, good
#asahi · 2022-10-24 14:53
marcanmacos actually just lets the cpus do some heuristic magic and decide what idle state to enter themselves
#asahi · 2022-10-24 14:53
marcanand presumably it has higher latency
#asahi · 2022-10-24 14:52
marcanyes, it's just another idle state, the only difference is it loses the GPR contents except SP/PC, so you need a save/restore around the wfi
#asahi · 2022-10-24 14:52
povikyou can wake up by any ordinary interrupts?
#asahi · 2022-10-24 14:52
marcanit just needs a driver for it and the only upstream-approved driver for this on arm64 is psci
#asahi · 2022-10-24 14:52
povikgood kernel
#asahi · 2022-10-24 14:52
marcanyes, the kernel already knows how to do idle states
#asahi · 2022-10-24 14:52
povikso you can deep idle cores selectively, and that will be what kernel does based on workload?
#asahi · 2022-10-24 14:51
marcanbut cooking up such a standard is preferable to an ad-hoc cpuidle driver, since other platforms can use it (I think there's at least one other with a similar problem)
#asahi · 2022-10-24 14:50
marcanso we need a third option, the idea is cooking up a standard for PSCI-over-UEFI-Runtime-Services
#asahi · 2022-10-24 14:50
marcanand doing it in a hypervisor would break KVM since it'd need nested virt which M1 does not support (M2 does) but it's also a terrible idea
#asahi · 2022-10-24 14:50
rannright
#asahi · 2022-10-24 14:50
marcanand M* chips do not support supervisors
#asahi · 2022-10-24 14:50
marcanthe problem is standard PSCI requires the existence of a supervisor or hypervisor
#asahi · 2022-10-24 14:49
marcanno, there is no PSCI
#asahi · 2022-10-24 14:49
marcan(boost meaning 3.2GHz instead of 3GHz, not exactly a massive difference)
#asahi · 2022-10-24 14:49
rannSo, as I understand it, Apple M* does support PSCI, but not in a compatible way so that it works like CONFIG_ARM_PSCI can handle it?
#asahi · 2022-10-24 14:49
marcanbut that will automatically work once deep idle works
#asahi · 2022-10-24 14:48
marcanyou don't get boost states as a consequence of the deep idle thing, since they require it
#asahi · 2022-10-24 14:48
marcancpufreq does work fine, I just sent v3 for upstreaming a few hours ago (that has worked fine for like a year now, just not upstream because it took a while to figure out the "right" way to do it)
#asahi · 2022-10-24 14:46
marcansince it's all supposed to use PSCI
#asahi · 2022-10-24 14:46
marcanbecause upstream will reject custom cpuidle implementations on arm64
#asahi · 2022-10-24 14:45
rannWhy is it not upstreamable?
#asahi · 2022-10-24 14:45
marcanand for technical reasons we need to cook up a custom PSCI interface because these machines can't support standard PSCI
#asahi · 2022-10-24 14:45
rann(I'm seriously impressed with how many things are working already, it's really something)
#asahi · 2022-10-24 14:45
marcanimplementing it in Linux is trivial, but not upstreamable
#asahi · 2022-10-24 14:45
marcanit's just the second deep idle state that is not, and the only reason it isn't is bureaucratic
#asahi · 2022-10-24 14:44
marcanall that is supported properly already
#asahi · 2022-10-24 14:44
rannIs there a an issue that tracks cpu power scheduling/scaling where I can read up on the status on that?

plus ›