diff mbox series

[2/2] hw/intc: Have ARM_GIC select ARM_GICV3 when KVM is not available

Message ID 20241227202435.48055-3-philmd@linaro.org
State New
Headers show
Series hw/intc: Select generic ARM_GICV3 when KVM is not available | expand

Commit Message

Philippe Mathieu-Daudé Dec. 27, 2024, 8:24 p.m. UTC
When the KVM accelerator is selected, the Kconfig ARM_GIC key
selects the KVM GIC implementation (ARM_GIC_KVM).
For other accelerators (TCG, HVF, ...), select the generic
implementation.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 hw/intc/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Phil Dennis-Jordan Dec. 28, 2024, 10:48 a.m. UTC | #1
On Fri, 27 Dec 2024 at 21:24, Philippe Mathieu-Daudé <philmd@linaro.org>
wrote:

> When the KVM accelerator is selected, the Kconfig ARM_GIC key
> selects the KVM GIC implementation (ARM_GIC_KVM).
> For other accelerators (TCG, HVF, ...), select the generic
> implementation.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>  hw/intc/Kconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/hw/intc/Kconfig b/hw/intc/Kconfig
> index 7547528f2c2..762139d8df3 100644
> --- a/hw/intc/Kconfig
> +++ b/hw/intc/Kconfig
> @@ -23,7 +23,7 @@ config APIC
>
>  config ARM_GIC
>      bool
> -    select ARM_GICV3 if TCG
> +    select ARM_GICV3 if !KVM
>

Wouldn't this disable the ARM_GICV3 by default when building with
--enable-tcg --enable-kvm? And then there would be no GIC available when
running the built QEMU in TCG mode. (Bear with me, I'm a relative Meson
newbie.)


>      select ARM_GIC_KVM if KVM
>      select MSI_NONBROKEN
>
> --
> 2.47.1
>
>
Phil Dennis-Jordan Jan. 7, 2025, 4:05 p.m. UTC | #2
On Sat, 28 Dec 2024 at 11:48, Phil Dennis-Jordan <phil@philjordan.eu> wrote:

>
>
> On Fri, 27 Dec 2024 at 21:24, Philippe Mathieu-Daudé <philmd@linaro.org>
> wrote:
>
>> When the KVM accelerator is selected, the Kconfig ARM_GIC key
>> selects the KVM GIC implementation (ARM_GIC_KVM).
>> For other accelerators (TCG, HVF, ...), select the generic
>> implementation.
>>
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>> ---
>>  hw/intc/Kconfig | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/hw/intc/Kconfig b/hw/intc/Kconfig
>> index 7547528f2c2..762139d8df3 100644
>> --- a/hw/intc/Kconfig
>> +++ b/hw/intc/Kconfig
>> @@ -23,7 +23,7 @@ config APIC
>>
>>  config ARM_GIC
>>      bool
>> -    select ARM_GICV3 if TCG
>> +    select ARM_GICV3 if !KVM
>>
>
> Wouldn't this disable the ARM_GICV3 by default when building with
> --enable-tcg --enable-kvm? And then there would be no GIC available when
> running the built QEMU in TCG mode. (Bear with me, I'm a relative Meson
> newbie.)
>
>


OK, I've managed to answer my own question now by setting up a RPi5 with
aarch64 RPOS and building QEMU on that with --enable-kvm --enable-tcg. With
patch 1/2 applied on current upstream master, I get:

$ build/qemu-system-aarch64 -accel tcg -M virt,gic-version=3 -smp 4 -m 4G
*[runs successfully]*

with 2/2 applied as well:

$ build/qemu-system-aarch64 -accel tcg -M virt,gic-version=3 -smp 4 -m 4G
qemu-system-aarch64: tcg does not support GICv3 emulation
$

In other words, with the proposed change, ARM_GICV3 is indeed deselected if
KVM is selected even if TCG is also selected.


Possibly very basic question: is there any support for kernel-irqchip=off
on aarch64/KVM?
If yes, don't we need ARM_GICV3 in that case anyway, so we should drop any
accel dependency on it in the first place?


If we definitely don't need the software GIC in KVM-only builds, I guess
we're down to listing each accel that needs it individually. Is that:

select ARM_GICV3 if TCG || HVF || NVMM || WHPX || XEN_EMU || XEN

or can we drop any of those? Have I missed anything? What about QTest?
diff mbox series

Patch

diff --git a/hw/intc/Kconfig b/hw/intc/Kconfig
index 7547528f2c2..762139d8df3 100644
--- a/hw/intc/Kconfig
+++ b/hw/intc/Kconfig
@@ -23,7 +23,7 @@  config APIC
 
 config ARM_GIC
     bool
-    select ARM_GICV3 if TCG
+    select ARM_GICV3 if !KVM
     select ARM_GIC_KVM if KVM
     select MSI_NONBROKEN