Re: [tip:x86/urgent] x86/kconfig: Add a Kconfig shortcut for buildingworking KVM guest kernels

From: David Rientjes
Date: Wed May 01 2013 - 15:53:15 EST


On Tue, 30 Apr 2013, tip-bot for Borislav Petkov wrote:

> diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
> index 15b5cef..1d053dc 100644
> --- a/arch/x86/Kconfig
> +++ b/arch/x86/Kconfig
> @@ -633,6 +633,45 @@ config KVM_GUEST
> underlying device model, the host provides the guest with
> timing infrastructure such as time of day, and system time
>
> +config KVM_GUEST_COMMON_OPTIONS
> + bool "Enable commodity options for a standalone KVM guest"
> + depends on KVM_GUEST
> + select NET
> + select NETDEVICES
> + select BLOCK
> + select BLK_DEV
> + select NETWORK_FILESYSTEMS
> + select INET
> + select EXPERIMENTAL
> + select TTY
> + select SERIAL_8250
> + select SERIAL_8250_CONSOLE
> + select IP_PNP
> + select IP_PNP_DHCP
> + select BINFMT_ELF
> + select PCI_MSI
> + select HAVE_ARCH_KGDB
> + select DEBUG_KERNEL
> + select KGDB
> + select KGDB_SERIAL_CONSOLE
> + select VIRTUALIZATION
> + select VIRTIO
> + select VIRTIO_RING
> + select VIRTIO_PCI
> + select VIRTIO_BLK
> + select VIRTIO_CONSOLE
> + select VIRTIO_NET
> + select 9P_FS
> + select NET_9P
> + select NET_9P_VIRTIO
> + ---help---
> + Select guest kernel functionality which facilitates booting the
> + kernel as a guest in qemu or lkvm. This entails basic stuff like
> + serial support, kgdb, virtio and other so that you can be able to
> + have commodity functionality like serial output from the guest,
> + networking, seamless host file system integration into guest context
> + and other useful things.
> +
> source "arch/x86/lguest/Kconfig"
>
> config PARAVIRT

This causes

warning: (KVM_GUEST_COMMON_OPTIONS && AMD_IOMMU) selects PCI_MSI which has unmet direct dependencies (PCI && ARCH_SUPPORTS_MSI)
warning: (KVM_GUEST_COMMON_OPTIONS) selects VIRTIO_PCI which has unmet direct dependencies (PCI)

in linux-next which results in

drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c: In function âixgbevf_request_msix_irqsâ:
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c:911:10: error: invalid use of undefined type âstruct msix_entryâ
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c:911:52: error: dereferencing pointer to incomplete type
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c:927:26: error: dereferencing pointer to incomplete type
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c:937:2: error: invalid use of undefined type âstruct msix_entryâ
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c:937:41: error: dereferencing pointer to incomplete type
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c:950:3: error: invalid use of undefined type âstruct msix_entryâ
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c:950:33: error: dereferencing pointer to incomplete type
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c: In function âixgbevf_free_irqâ:
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c:1007:2: error: invalid use of undefined type âstruct msix_entryâ
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c:1007:32: error: dereferencing pointer to incomplete type
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c:1016:3: error: invalid use of undefined type âstruct msix_entryâ
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c:1016:33: error: dereferencing pointer to incomplete type
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c: In function âixgbevf_irq_disableâ
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c:1039:3: error: invalid use of undefined type âstruct msix_entryâ
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c:1039:40: error: dereferencing pointer to incomplete type
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c: In function âixgbevf_acquire_msix_vectorsâ:
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c:1767:3: error: implicit declaration of function âpci_enable_msixâ [-Werror=implicit-function-declaration]
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c: In function âixgbevf_set_interrupt_capabilityâ:
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c:1887:13: error: invalid application of âsizeofâ to incomplete type âstruct msix_entryâ
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c:1894:3: error: invalid use of undefined type âstruct msix_entryâ
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c:1894:24: error: dereferencing pointer to incomplete type
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c: In function âixgbevf_reset_interrupt_capabilityâ:
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c:1976:2: error: implicit declaration of function âpci_disable_msixâ [-Werror=implicit-function-declaration]
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c: In function âixgbevf_resumeâ:
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c:3212:2: error: implicit declaration of function âpci_enable_device_memâ [-Werror=implicit-function-declaration]

since KVM_GUEST_COMMON_OPTIONS selects PCI_MSI without selecting PCI.

If we select PCI in KVM_GUEST_COMMON_OPTIONS, we get:

arch/x86/Kconfig:651:error: recursive dependency detected!
arch/x86/Kconfig:651: symbol KVM_GUEST_COMMON_OPTIONS depends on HYPERVISOR_GUEST
arch/x86/Kconfig:597: symbol HYPERVISOR_GUEST is selected by X86_VSMP
arch/x86/Kconfig:388: symbol X86_VSMP depends on PCI
arch/x86/Kconfig:2042: symbol PCI is selected by KVM_GUEST_COMMON_OPTIONS