mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-17 23:22:12 -06:00
target/loongarch: fix vcpu reset command word issue
When the KVM_REG_LOONGARCH_VCPU_RESET command word is sent to the kernel through the kvm_set_one_reg interface, the parameter source needs to be a legal address, otherwise the kernel will return an error and the command word will fail to be sent. Signed-off-by: Xianglai Li <lixianglai@loongson.cn> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Bibo Mao <maobibo@loongson.cn>
This commit is contained in:
parent
b69801dd6b
commit
b61b9d8913
1 changed files with 8 additions and 1 deletions
|
@ -581,9 +581,16 @@ static int kvm_loongarch_get_lbt(CPUState *cs)
|
|||
void kvm_arch_reset_vcpu(CPUState *cs)
|
||||
{
|
||||
CPULoongArchState *env = cpu_env(cs);
|
||||
int ret = 0;
|
||||
uint64_t unused = 0;
|
||||
|
||||
env->mp_state = KVM_MP_STATE_RUNNABLE;
|
||||
kvm_set_one_reg(cs, KVM_REG_LOONGARCH_VCPU_RESET, 0);
|
||||
ret = kvm_set_one_reg(cs, KVM_REG_LOONGARCH_VCPU_RESET, &unused);
|
||||
if (ret) {
|
||||
error_report("Failed to set KVM_REG_LOONGARCH_VCPU_RESET: %s",
|
||||
strerror(errno));
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
|
||||
static int kvm_loongarch_get_mpstate(CPUState *cs)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue