Skip to contentSkip to conversation

hw/mips: Restrict ITU to TCG

PATCH In review Philippe Mathieu-Daudé 2 participants 3 messages Jul 2, 2025 – Jul 15, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hw/mips: Restrict ITU to TCG

MIPS Inter-Thread Communication Unit is implemented using TCG. Check for TCG both in Kconfig and CPS source.

Fixes 2321d971b6f ("hw/mips: Add dependency MIPS_CPS -> MIPS_ITU")
---
 hw/mips/cps.c   | 4 ++--
 hw/mips/Kconfig | 2 +-
 hw/misc/Kconfig | 1 +
 3 files changed, 4 insertions(+), 3 deletions(-)
hw/mips/cps.c +2 -2
index 2a3ba3f58d2..e47695e2b0a 100644
@@ -24,7 +24,7 @@
 #include "hw/mips/mips.h"
 #include "hw/qdev-clock.h"
 #include "hw/qdev-properties.h"
-#include "system/kvm.h"
+#include "system/tcg.h"
 #include "system/reset.h"
 
 qemu_irq get_cps_irq(MIPSCPSState *s, int pin_number)
@@ -59,7 +59,7 @@ static bool cpu_mips_itu_supported(CPUMIPSState *env)
 {
     bool is_mt = (env->CP0_Config5 & (1 << CP0C5_VP)) || ase_mt_available(env);
 
-    return is_mt && !kvm_enabled();
+    return is_mt && tcg_enabled();
 }
 
 static void mips_cps_realize(DeviceState *dev, Error **errp)
hw/mips/Kconfig +1 -1
index b09c89a0175..f84fffcd323 100644
@@ -76,7 +76,7 @@ config LOONGSON3V
 
 config MIPS_CPS
     bool
-    select MIPS_ITU
+    select MIPS_ITU if TCG
 
 config MIPS_BOSTON
     bool
hw/misc/Kconfig +1 -0
index ec0fa5aa9f8..e9a9405d2f1 100644
@@ -107,6 +107,7 @@ config STM32L4X5_RCC
 
 config MIPS_ITU
     bool
+    depends on TCG
 
 config MPS2_FPGAIO
     bool
Signature · 1 line
2.49.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Philippe Mathieu-Daudé

MIPS Inter-Thread Communication Unit is implemented using TCG. Check for TCG both in Kconfig and CPS source.

Fixes 2321d971b6f ("hw/mips: Add dependency MIPS_CPS -> MIPS_ITU")
---
  hw/mips/cps.c   | 4 ++--
  hw/mips/Kconfig | 2 +-
  hw/misc/Kconfig | 1 +
  3 files changed, 4 insertions(+), 3 deletions(-)

r~

#2 lore raw
In reply to Philippe Mathieu-Daudé
Quoted 10 lines · Philippe Mathieu-Daudé

MIPS Inter-Thread Communication Unit is implemented using TCG. Check for TCG both in Kconfig and CPS source.

Fixes 2321d971b6f ("hw/mips: Add dependency MIPS_CPS -> MIPS_ITU")
---
  hw/mips/cps.c   | 4 ++--
  hw/mips/Kconfig | 2 +-
  hw/misc/Kconfig | 1 +
  3 files changed, 4 insertions(+), 3 deletions(-)

Patch queued, thanks.