When processor enters power-save state it releases resources shared with other
cpu threads which makes other cores working much faster.
This patch also implements saving and restoring registers that might get
corrupted in power-save state.
Differential D14330
PowerNV: Put processor to power-save state in idle thread pdk_semihalf.com on Feb 12 2018, 4:42 PM. Authored by Tags Referenced Files
Subscribers None
Details When processor enters power-save state it releases resources shared with other This patch also implements saving and restoring registers that might get
Diff Detail
Event Timeline
Comment Actions Thanks for your response. I've updated diff (checked spacing too) so everything should be OK now. Comment Actions Is cpu_idle() the right place for this? I'm not sure what the wake-up latency of this code is, but, if it involves restoring registers in software, it seems like it might be heavier-weight than intended for cpu_idle().
Comment Actions Actually, this is the only way to release resources by idling CPUs within the same SMT group - Linux does the same. All these are because Power does not implement "wfi"-like instruction and waking up from sleep modes has to be handled by entering EXC_RST vector.
Comment Actions There is a yield instruction ("yield"), but it is a bit of a different thing. Earlier versions of POWER also do implement instructions that do this without going through reset (MSR[POW], notably). As a result, I have somewhat mixed feelings implementing this in the platform layer. Is there a reason to do it there rather than cpu.c, where the code for MSR[POW] etc. lives?
Comment Actions Could you tell me more about scenario in which we branch to rstcode from software? I was looking for it but I found nothing. BTW "yield", "mdoio" and "mdoom" instructions were never implemented on POWER8 Comment Actions Line 99 of locore64.S.
OK. I have only the architecture manual, which defines them as non-optional. I guess they are just no-ops?
Comment Actions Thanks. I will clear whole register, right?
Yes, they are no-ops. I don't know how it looks like in older versions of POWER architecture, but these instructions are removed from PowerISA 3.0. On the other side, they are doing no harm.
Comment Actions Yes, that seems like the right approach.
OK.
Comment Actions cpu_subr64.S isn't really a great name, since it doesn't convey a ton of information. How about cpu_idle64.S? In any case, is there a reason it needs to be #included into locore64.S rather than built as an independent file? Comment Actions I wanted this file to be cpu.c equivalent but in assembler, that's why it was named cpu.S Comment Actions Added some checks, which detects situation when SRR1 is set to inappropriate value (eg. QEMU) |