[PATCH] Kconfig: kvm: allow building without any board

Paolo Bonzini posted 1 patch 1 week, 4 days ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20240423191728.52535-1-pbonzini@redhat.com
Maintainers: Paolo Bonzini <pbonzini@redhat.com>, Peter Maydell <peter.maydell@linaro.org>
target/arm/Kconfig  | 2 ++
target/i386/Kconfig | 2 ++
2 files changed, 4 insertions(+)
[PATCH] Kconfig: kvm: allow building without any board
Posted by Paolo Bonzini 1 week, 4 days ago
KVM code might have to call functions on the PCIDevice that is
passed to kvm_arch_fixup_msi_route().  This fails in the case
where --without-default-devices is used and no board is
configured.  While this is not really a useful configuration,
and therefore setting up stubs for CONFIG_PCI is overkill,
failing the build is impolite.  Just include the PCI
subsystem if kvm_arch_fixup_msi_route() requires it, as
is the case for ARM and x86.

Reported-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Tested-by: Fabiano Rosas <farosas@suse.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 target/arm/Kconfig  | 2 ++
 target/i386/Kconfig | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/target/arm/Kconfig b/target/arm/Kconfig
index bf57d739cd1..5847c5a74a7 100644
--- a/target/arm/Kconfig
+++ b/target/arm/Kconfig
@@ -9,3 +9,5 @@ config ARM
 config AARCH64
     bool
     select ARM
+    # kvm_arch_fixup_msi_route() needs to access PCIDevice
+    select PCI if KVM
diff --git a/target/i386/Kconfig b/target/i386/Kconfig
index ce6968906ee..46898946394 100644
--- a/target/i386/Kconfig
+++ b/target/i386/Kconfig
@@ -1,5 +1,7 @@
 config I386
     bool
+    # kvm_arch_fixup_msi_route() needs to access PCIDevice
+    select PCI if KVM
 
 config X86_64
     bool
-- 
2.44.0


Re: [PATCH] Kconfig: kvm: allow building without any board
Posted by Philippe Mathieu-Daudé 1 week, 3 days ago
On 23/4/24 21:17, Paolo Bonzini wrote:
> KVM code might have to call functions on the PCIDevice that is
> passed to kvm_arch_fixup_msi_route().  This fails in the case
> where --without-default-devices is used and no board is
> configured.  While this is not really a useful configuration,
> and therefore setting up stubs for CONFIG_PCI is overkill,
> failing the build is impolite.  Just include the PCI
> subsystem if kvm_arch_fixup_msi_route() requires it, as
> is the case for ARM and x86.
> 
> Reported-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> Tested-by: Fabiano Rosas <farosas@suse.de>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>   target/arm/Kconfig  | 2 ++
>   target/i386/Kconfig | 2 ++
>   2 files changed, 4 insertions(+)
> 
> diff --git a/target/arm/Kconfig b/target/arm/Kconfig
> index bf57d739cd1..5847c5a74a7 100644
> --- a/target/arm/Kconfig
> +++ b/target/arm/Kconfig
> @@ -9,3 +9,5 @@ config ARM
>   config AARCH64
>       bool
>       select ARM
> +    # kvm_arch_fixup_msi_route() needs to access PCIDevice
> +    select PCI if KVM

Kind of funny :)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>