]> git.ipfire.org Git - thirdparty/qemu.git/commit
target/riscv: Clear CSR values at reset and sync MPSTATE with host
authorliguang.zhang <liguang.zhang@hexintek.com>
Wed, 13 Sep 2023 09:13:21 +0000 (17:13 +0800)
committerAlistair Francis <alistair.francis@wdc.com>
Thu, 12 Oct 2023 01:52:43 +0000 (11:52 +1000)
commit8633951530cc923f1e7a6cd250f670f24c0ed817
treec56be809a7ea5717503a839bb2fe8d774fed5ba5
parent67f94b09ac4f64d4a0595d1224ba3a425e565043
target/riscv: Clear CSR values at reset and sync MPSTATE with host

This patch fixes guest reboot errors when using KVM.

There are two issues when rebooting a guest using KVM
1. When the guest initiates a reboot the host is unable to stop the vcpu
2. When running a SMP guest the qemu monitor system_reset causes a vcpu crash

This can be fixed by clearing the CSR values at reset and syncing the
MPSTATE with the host.

Signed-off-by: liguang.zhang <liguang.zhang@hexintek.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-ID: <20230913091332.17355-1-18622748025@163.com>
[ Changes by AF
 - Fixup commit message
 - Fixup patch style
]
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
target/riscv/kvm.c
target/riscv/kvm_riscv.h