Skip to contentSkip to conversation

hw/intc/Kconfig: Fix GIC settings when using "--without-default-devices"

PATCH In review Thomas Huth 4 participants 5 messages Feb 21, 2024 – Mar 4, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hw/intc/Kconfig: Fix GIC settings when using "--without-default-devices"

When using "--without-default-devices", the ARM_GICV3_TCG and ARM_GIC_KVM settings currently get disabled, though the arm virt machine is only of very limited use in that case. This also causes the migration-test to fail in such builds. Let's make sure that we always keep the GIC switches enabled in the --without-default-devices builds, too.

---
 hw/intc/Kconfig | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
hw/intc/Kconfig +6 -6
index 97d550b06b..2b5b2d2301 100644
@@ -12,10 +12,6 @@ config IOAPIC
     bool
     select I8259
 
-config ARM_GIC
-    bool
-    select MSI_NONBROKEN
-
 config OPENPIC
     bool
     select MSI_NONBROKEN
@@ -25,14 +21,18 @@ config APIC
     select MSI_NONBROKEN
     select I8259
 
+config ARM_GIC
+    bool
+    select ARM_GICV3_TCG if TCG
+    select ARM_GIC_KVM if KVM
+    select MSI_NONBROKEN
+
 config ARM_GICV3_TCG
     bool
-    default y
     depends on ARM_GIC && TCG
 
 config ARM_GIC_KVM
     bool
-    default y
     depends on ARM_GIC && KVM
 
 config XICS
Signature · 1 line
2.43.2
Tested-by on v1 1/1
#1 lore raw
Quoted 7 lines · Thomas Huth

When using "--without-default-devices", the ARM_GICV3_TCG and ARM_GIC_KVM settings currently get disabled, though the arm virt machine is only of very limited use in that case. This also causes the migration-test to fail in such builds. Let's make sure that we always keep the GIC switches enabled in the --without-default-devices builds, too.

#2 lore raw
In reply to Thomas Huth
Quoted 27 lines · Thomas Huth

When using "--without-default-devices", the ARM_GICV3_TCG and ARM_GIC_KVM settings currently get disabled, though the arm virt machine is only of very limited use in that case. This also causes the migration-test to fail in such builds. Let's make sure that we always keep the GIC switches enabled in the --without-default-devices builds, too.

---
  hw/intc/Kconfig | 12 ++++++------
  1 file changed, 6 insertions(+), 6 deletions(-)
hw/intc/Kconfig +0 -4
index 97d550b06b..2b5b2d2301 100644
@@ -12,10 +12,6 @@ config IOAPIC
      bool
      select I8259
 
-config ARM_GIC
-    bool
-    select MSI_NONBROKEN
-
  config OPENPIC
      bool
      select MSI_NONBROKEN

hw/intc/Kconfig config APIC · line 27

Quoted 7 lines
hw/intc/Kconfig +4 -0
@@ -25,14 +21,18 @@ config APIC
      select MSI_NONBROKEN
      select I8259
 
+config ARM_GIC
+    bool
+    select ARM_GICV3_TCG if TCG
+    select ARM_GIC_KVM if KVM

This is odd, we usually 'select' dependencies.

hw/intc/Kconfig config APIC · line 30

Quoted 5 lines
hw/intc/Kconfig +2 -1
+    select MSI_NONBROKEN
+
  config ARM_GICV3_TCG
      bool
-    default y

Don't we want instead:

default y if TCG

hw/intc/Kconfig config APIC · line 35

Quoted 5 lines
hw/intc/Kconfig +0 -1
      depends on ARM_GIC && TCG
 
  config ARM_GIC_KVM
      bool
-    default y

and:

default y if KVM

?

Quoted 3 lines
hw/intc/Kconfig +0 -0
      depends on ARM_GIC && KVM
 
  config XICS
#3 lore raw
Quoted 27 lines · Philippe Mathieu-Daudé
Quoted 26 lines · Thomas Huth

When using "--without-default-devices", the ARM_GICV3_TCG and ARM_GIC_KVM settings currently get disabled, though the arm virt machine is only of very limited use in that case. This also causes the migration-test to fail in such builds. Let's make sure that we always keep the GIC switches enabled in the --without-default-devices builds, too.

---
  hw/intc/Kconfig | 12 ++++++------

  1 file changed, 6 insertions(+), 6 deletions(-)
hw/intc/Kconfig +0 -0
index 97d550b06b..2b5b2d2301 100644
@@ -12,10 +12,6 @@ config IOAPIC

      bool
      select I8259

hw/intc/Kconfig +0 -4
-config ARM_GIC
-    bool
-    select MSI_NONBROKEN
-

  config OPENPIC
      bool
      select MSI_NONBROKEN

hw/intc/Kconfig +0 -0
@@ -25,14 +21,18 @@ config APIC
Quoted 8 lines
Quoted 6 lines

      select MSI_NONBROKEN
      select I8259
+config ARM_GIC
+    bool
+    select ARM_GICV3_TCG if TCG
+    select ARM_GIC_KVM if KVM

This is odd, we usually 'select' dependencies.

We could also move the two select lines into the VIRT Kconfig switch in hw/arm/ ... would that look better?

Quoted 9 lines
Quoted 5 lines

+    select MSI_NONBROKEN
+
  config ARM_GICV3_TCG
      bool
-    default y

Don't we want instead:

       default y if TCG

No, that won't fix the issue, since such statements will also be set to "no" if you run configure --without-default-devices.

Thomas

#4 lore raw
In reply to Thomas Huth
Quoted 11 lines · Thomas Huth

When using "--without-default-devices", the ARM_GICV3_TCG and ARM_GIC_KVM settings currently get disabled, though the arm virt machine is only of very limited use in that case. This also causes the migration-test to fail in such builds. Let's make sure that we always keep the GIC switches enabled in the --without-default-devices builds, too.

---
 hw/intc/Kconfig | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

I don't understand the Kconfig infrastructure well enough to review this, but if somebody who does wants to give it a reviewed-by I'm happy to take it into target-arm.next.

thanks
-- PMM