Commit 6ad515b01b for qemu.org
commit 6ad515b01b4b2417080c07884153ea7a62ddc871
Author: Bibo Mao <maobibo@loongson.cn>
Date: Mon Sep 14 10:14:18 2026 +0800
target/loongarch: Set msgint property with auto detected
Linux kernel and KVM has supported msgint irqchip, set msgint property
with value ON_OFF_AUTO_AUTO with max CPU type in both KVM and TCG mode.
Signed-off-by: Bibo Mao <maobibo@loongson.cn>
Reviewed-by: Song Gao <17746591750@163.com>
diff --git a/target/loongarch/cpu.c b/target/loongarch/cpu.c
index 2d58277549..99499034ed 100644
--- a/target/loongarch/cpu.c
+++ b/target/loongarch/cpu.c
@@ -473,9 +473,8 @@ static void loongarch_max_initfn(Object *obj)
loongarch_la464_initfn(obj);
cpu->ptw = ON_OFF_AUTO_AUTO;
- if (kvm_enabled()){
- cpu->msgint=ON_OFF_AUTO_OFF;
- }
+ cpu->env.cpucfg[1] = FIELD_DP32(cpu->env.cpucfg[1], CPUCFG1, MSG_INT, 1);
+ cpu->msgint = ON_OFF_AUTO_AUTO;
/* Enable LA v1.1 instructions */
data = cpu->env.cpucfg[2];
@@ -494,9 +493,6 @@ static void loongarch_max_initfn(Object *obj)
data = cpu->env.cpucfg[2];
data = FIELD_DP32(data, CPUCFG2, HPTW, 1);
cpu->env.cpucfg[2] = data;
-
- cpu->env.cpucfg[1] = FIELD_DP32(cpu->env.cpucfg[1], CPUCFG1, MSG_INT, 1);
- cpu->msgint = ON_OFF_AUTO_AUTO;
}
}