[PATCH v4 3/3] target/loongarch: KVM disable msgint

Song Gao <[email protected]>
Newsgroups gmane.comp.emulators.qemu
Message-ID <[email protected]>
From: gaosong <[email protected]>

In KVM mode, msgint is disabled by default; please enable it manually.

e.g
   ... -cpu max,msgint=on ...

Signed-off-by: gaosong <[email protected]>
Reviewed-by: Bibo Mao <[email protected]>
---
 target/loongarch/cpu.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/target/loongarch/cpu.c b/target/loongarch/cpu.c
index a241135227..84e609b5ed 100644
--- a/target/loongarch/cpu.c
+++ b/target/loongarch/cpu.c
@@ -449,6 +449,9 @@ 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;
+    }
     if (tcg_enabled()) {
         uint32_t data = cpu->env.cpucfg[2];
         data = FIELD_DP32(data, CPUCFG2, HPTW, 1);
@@ -463,9 +466,9 @@ static void loongarch_max_initfn(Object *obj)
         data = cpu->env.cpucfg[3];
         data = FIELD_DP32(data, CPUCFG3, DBAR_HINTS, 1);
         cpu->env.cpucfg[3] = data;
+	 cpu->env.cpucfg[1] = FIELD_DP32(cpu->env.cpucfg[1], CPUCFG1, MSG_INT, 1);
+        cpu->msgint = ON_OFF_AUTO_AUTO;
     }
-    cpu->env.cpucfg[1] = FIELD_DP32(cpu->env.cpucfg[1], CPUCFG1, MSG_INT, 1);
-    cpu->msgint = ON_OFF_AUTO_AUTO;
 }
 
 #if defined(CONFIG_KVM)
-- 
2.47.3
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.