]> git.ipfire.org Git - thirdparty/linux.git/commit
KVM: LoongArch: selftests: Add system registers save/restore on exception
authorBibo Mao <maobibo@loongson.cn>
Thu, 27 Nov 2025 03:00:18 +0000 (11:00 +0800)
committerHuacai Chen <chenhuacai@loongson.cn>
Thu, 27 Nov 2025 03:00:18 +0000 (11:00 +0800)
commit985a96983bedf04fa61315e68806f3468450c8a1
treee23c2b201513f759f71a2e80e5eb64bb44b544da
parentd3e43a1f34acbb9a814337fc5624765538e5a274
KVM: LoongArch: selftests: Add system registers save/restore on exception

When system returns from exception with ertn instruction, PC comes from
LOONGARCH_CSR_ERA, and CSR.CRMD comes LOONGARCH_CSR_PRMD.

Here save CSR register CSR.ERA and CSR.PRMD into stack, and then restore
them from stack. So it can be modified by exception handlers in future.

Signed-off-by: Bibo Mao <maobibo@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
tools/testing/selftests/kvm/include/loongarch/processor.h
tools/testing/selftests/kvm/lib/loongarch/exception.S