]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
LoongArch: KVM: Reload guest CSR registers after sleep
authorBibo Mao <maobibo@loongson.cn>
Sat, 8 Mar 2025 05:52:01 +0000 (13:52 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Mar 2025 12:01:50 +0000 (13:01 +0100)
commit3700cd7c171b2d782be9597cf3db573b28ffb78d
treeda5cb7bd058a8d6c52cfda354f15240ec169c37a
parent5f3f7d2e9adf35f31c1241d60566e51a1890df79
LoongArch: KVM: Reload guest CSR registers after sleep

commit 78d7bc5a02e1468df53896df354fa80727f35b7d upstream.

On host, the HW guest CSR registers are lost after suspend and resume
operation. Since last_vcpu of boot CPU still records latest vCPU pointer
so that the guest CSR register skips to reload when boot CPU resumes and
vCPU is scheduled.

Here last_vcpu is cleared so that guest CSR registers will reload from
scheduled vCPU context after suspend and resume.

Cc: stable@vger.kernel.org
Signed-off-by: Bibo Mao <maobibo@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/loongarch/kvm/main.c