linux-loongson/arch/loongarch/power
Huacai Chen ceb9155d05 LoongArch: Save and restore CSR.CNTC for hibernation
Save and restore CSR.CNTC for hibernation which is similar to suspend.

For host this is unnecessary because sched clock is ensured continuous,
but for kvm guest sched clock isn't enough because rdtime.d should also
be continuous.

Host::rdtime.d = Host::CSR.CNTC + counter
Guest::rdtime.d = Host::CSR.CNTC + Host::CSR.GCNTC + Guest::CSR.CNTC + counter

so,

Guest::rdtime.d = Host::rdtime.d + Host::CSR.GCNTC + Guest::CSR.CNTC

To ensure Guest::rdtime.d continuous, Host::rdtime.d should be at first
continuous, while Host::CSR.GCNTC / Guest::CSR.CNTC is maintained by KVM.

Cc: stable@vger.kernel.org
Signed-off-by: Xianglai Li <lixianglai@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
2025-05-14 22:17:52 +08:00
..
hibernate_asm.S
hibernate.c LoongArch: Save and restore CSR.CNTC for hibernation 2025-05-14 22:17:52 +08:00
Makefile
platform.c LoongArch: Fix warnings during S3 suspend 2025-01-26 21:49:59 +08:00
suspend_asm.S LoongArch: Adjust SETUP_SLEEP and SETUP_WAKEUP 2025-01-25 18:51:43 +08:00
suspend.c LoongArch: Give a chance to build with !CONFIG_SMP 2024-05-14 12:24:18 +08:00