Support Kconfig in QEMU
v3 cover Support Kconfig in QEMU
This Kconfig implementation is rebased from Paolo's branch
https://github.com/bonzini/qemu/commits/kconfig
I rebased most of patches except non-x86 ARCHs dependency definitions this time.
https://github.com/yangzhon/qemu/commits/topic/upstream/Kconfig
The current RFC patches only support
(*) x86_64 platform build
Once design is fixed, we can do other archs.
(*) defconfig
"randconfig" build has some issues, which are mostly related with CONFIG* in Kconfig.host abd configure. In randconfig mode, some CONFIG* has different setting value in config-host.mak and %/config-device.mak, which make QEMU build failure.
(*) Kconfig in hw/ directory
The current configure and build command are same with previous commands and if we want to disable or enable some features, like "tcg", we still need add "--enable/--disable-tcg" in configure command line. If we want to disable one emulation device, we can disable this in related Kconfig file in hw/ directory.
The current build command:
(*) ./configure --target-list=x86_64-softmmu
(*) make -j8
Since the Kconfig language replace traditional CONFIG_* in default-config/%-softmmu.mak, the %-softmmu.mak file only define embeded boards or machines, like 440fx and Q35 in x86_64 platform. The Kconfig has already defined dependency topology between different Kconfig files, but there are still some issues
(*) Kconfig for configure(config-host.mak)
Some CONFIG* in configure need some logic to generate, those are hard to input this CONFIG* in Kconfig.host or Kconfig* file.
(*) Kconfig for %config-target.mak
The CONFIG* in %/config-target.mak file, this is still related with configure.
(*) randconfig support issue.
Before this RFC patches, we have talked Kconfig in another thread
http://lists.nongnu.org/archive/html/qemu-devel/2018-09/msg02827.html
Please give your comments on this RFC thread, many thanks!
Changes in v3:
patch 3: resume CONFIG_ACPI=y for ARM (Thomas Huth)
patch 4: CONFIG_AN5206 for an5206.o and mcf5206.o (Thomas Huth)
patch 6: CONFIG_VT82C686 is only in mips64el-softmmu.mak (Thomas Huth)
patch 7: sort the new config switches into "# For Macs" and
"# For embedded PPC" section (Thomas Huth)
patch 8: sh7750.o and sh7750_regnames.o are "common" code, no need to
define new CONFIG.(Thomas Huth)
patch 12: CONFIG_NIOS2_10M50 replace CONFIG_NIOS2_10M50_BOARD(Thomas Huth)
patch 13: added new CONFIGs for sifive_e.o and sifive_u.o(Thomas Huth) CONFIG_RISCV_VIRT for virt.o
patch 15~20:added for other non-x86 platforms(alpha/Kconfig, cris/Kconfig
hppa/Kconfig,unicore32/Kconfig,tricore/Kconfig,moxie/Kconfig openrisc/Kconfig)(Thomas Huth)
patch 25: sort the sources/*/Kconfig entries alphabetically(Thomas Huth)
added the new configs for arm/nios2/ppc/sh4/sparc
patch 29: E1000E_PCI with PCIE dependency(Thomas Huth) patch 30: CONFIG_ISA_BUS replace CONFIG_ISA(Thomas Huth) patch 32: changed the commit message (Paolo)(Thomas Huth) patch 41: "I440FX && Q35" was changedto "I440FX || Q35"(Thomas Huth)
"default y" for IPMI_LOCAL and IPMI_EXTERN
Changes in v2:
patch 1: added "CONFIG_PAM=y" in default-configs/i386-softmmu.mak
(Thomas Huth)
patch 3~14: added support for other ARCHs configurable(Paolo)
patch 15: changed the annotate (Paolo) patch 16: changed the python code (Paolo) patch 19: added other ARCHs Kconfig files(Paolo) patch 21: added "select IDE_PCI" for CMD646, PIIX, VIA and SII3112(Thomas Huth) patch 22: added new patch for PCIE configurable. patch 23: moved "select IDE_PCI" from CMD646, PIIX, VIA to 21 patch(Thomas Huth)
added "select CAN_BUS" for net/Kconfig (Thomas Huth)
added "depends on PCI" for CAN_SJA1000 (Paolo)
removed CONFIG_PCIE=y and add dependency for pcie(Paolo)
patch 26: added "depends on PSERIES" for "config SPAPR_VSCSI" (Thomas Huth)
USB_STORAGE_BOT and USB_STORAGE_UAS must also "select SCSI"(Paolo)
patch 28: added "select SERIAL" into "config SERIAL_PCI" (Thomas Huth)
removed "depend on ISA_BUS" from "config VGA_CIRRUS"(Thomas Huth)
patch 30: "config XLNX_ZYNQMP_ARM" is defined in hw/arm/Kconfig(Thomas Huth)
CONFIG_AUX should select I2C(Paolo)
patch 33: depends on HYPERV for HYPERV_TESTDEV(Thomas Huth)
removed "select HYPERV" and "select HYPERV_TESTDEV" with "default y if PC" in "config HYPERV" and "config HYPERV_TESTDEV"(Paolo)
patch 34: deleted default-configs/virtio.mak(Thomas Huth)
removed "y" in "config VIRTIO_MMIO"(Thomas Huth)
patch 35: removed remaining CONFIG_* and removed "select xxxx" from hw/i386/Kconfig
to other Kconfigs(Paolo)
Paolo Bonzini (18):
build: actually use CONFIG_PAM
hw/i386/Makefile.objs: Build pc_piix* and pc_q35 boards
minikconfig: add parser skeleton
minikconfig: add AST
minikconfig: add semantic analysis
kconfig: introduce kconfig files
build: switch to Kconfig
ide: express dependencies with Kconfig
build: convert pci.mak to Kconfig
build: convert sound.mak to Kconfig
build: convert usb.mak to Kconfig
scsi: express dependencies with Kconfig
bluetooth: express dependencies with Kconfig
isa: express dependencies with kconfig
i386: express dependencies with Kconfig
i2c: express dependencies with Kconfig
ptimer: express dependencies with Kconfig
minikconf: implement allyesconfig, allnoconfig, randconfig, defconfig
Yang Zhong (17):
hw/arm/Makefile.objs: CONFIG_VIRT created for virt board hw/nios2/Makefile.objs: Conditionally build nios2 hw/riscv/Makefile.objs: Create CONFIG_* for riscv boards hw/sparc64/Makefile.objs: Create CONFIG_* for sparc64 hw/alpha/Makefile.objs: Create CONFIG_* for alpha hw/cris/Makefile.objs: Create CONFIG_* for cris hw/hppa/Makefile.objs: Create CONFIG_* for hppa hw/moxie/Makefile.objs: Conditionally build moxie hw/openrisc/Makefile.objs: Create CONFIG_* for openrisc hw/tricore/Makefile.objs: Create CONFIG_* for tricore hw/display: make edid configurable hw/pci/Makefile.objs: make pcie configurable
edid: express dependencies with kconfig
hyperv: express dependencies with kconfig
virtio: make virtio dependencies with Kconfig i386-softmmu.mak: remove all CONFIG_* except boards definitions
Makefile: only support defconfig
Ákos Kovács (8):
hw/m68k/Makefile.objs: Conditionally build boards hw/microblaze/Makefile.objs: Create configs for petalogix and xilinx
boards
hw/mips/Makefile.objs: Create CONFIG_* for r4k, malta,mipssim boards hw/ppc/Makefile.objs: Build all boards conditinally with CONFIG_* hw/sh4/Makefile.objs: New CONFIG_* varibales created for sh4 boards
and device
hw/sparc/Makefile.objs: CONFIG_* for sun4m and leon3 created hw/lm32/Makefile.objs: Conditionally build lm32 and milkmyst hw/xtensa/Makefile.objs: Build xtensa_sim and xtensa_fpga
conditionally
Kconfig.host | 24 + Makefile | 19 +- Makefile.target | 7 +- default-configs/alpha-softmmu.mak | 7 +- default-configs/arm-softmmu.mak | 5 +- default-configs/cris-softmmu.mak | 1 + default-configs/hppa-softmmu.mak | 5 +- default-configs/hyperv.mak | 2 - default-configs/i386-softmmu.mak | 72 +-- default-configs/m68k-softmmu.mak | 2 + default-configs/microblaze-softmmu.mak | 3 + default-configs/mips-softmmu-common.mak | 8 +- default-configs/moxie-softmmu.mak | 1 + default-configs/nios2-softmmu.mak | 1 + default-configs/or1k-softmmu.mak | 1 + default-configs/pci.mak | 49 -- default-configs/ppc-softmmu.mak | 12 +- default-configs/riscv32-softmmu.mak | 11 +- default-configs/riscv64-softmmu.mak | 11 +- default-configs/s390x-softmmu.mak | 1 - default-configs/sh4-softmmu.mak | 5 +- default-configs/sh4eb-softmmu.mak | 5 +- default-configs/sound.mak | 4 - default-configs/sparc-softmmu.mak | 2 + default-configs/sparc64-softmmu.mak | 5 +- default-configs/tricore-softmmu.mak | 1 + default-configs/usb.mak | 11 - default-configs/virtio.mak | 14 - default-configs/xtensa-softmmu.mak | 3 + default-configs/xtensaeb-softmmu.mak | 3 + hw/9pfs/Kconfig | 4 + hw/Kconfig | 69 +++ hw/Makefile.objs | 4 +- hw/acpi/Kconfig | 30 ++ hw/adc/Kconfig | 2 + hw/alpha/Kconfig | 5 + hw/alpha/Makefile.objs | 4 +- hw/arm/Kconfig | 113 ++++ hw/arm/Makefile.objs | 3 +- hw/audio/Kconfig | 52 ++ hw/block/Kconfig | 37 ++ hw/bt/Kconfig | 2 + hw/char/Kconfig | 42 ++ hw/core/Kconfig | 11 + hw/cpu/Kconfig | 8 + hw/cris/Kconfig | 2 + hw/cris/Makefile.objs | 2 +- hw/display/Kconfig | 106 ++++ hw/display/Makefile.objs | 4 +- hw/dma/Kconfig | 20 + hw/gpio/Kconfig | 9 + hw/hppa/Kconfig | 5 + hw/hppa/Makefile.objs | 4 +- hw/hyperv/Kconfig | 9 + hw/i2c/Kconfig | 27 + hw/i2c/Makefile.objs | 7 +- hw/i386/Kconfig | 87 +++ hw/i386/Makefile.objs | 4 +- hw/ide/Kconfig | 54 ++ hw/input/Kconfig | 28 + hw/intc/Kconfig | 55 ++ hw/ipack/Kconfig | 4 + hw/ipmi/Kconfig | 22 + hw/isa/Kconfig | 30 ++ hw/lm32/Kconfig | 5 + hw/lm32/Makefile.objs | 4 +- hw/m68k/Kconfig | 8 + hw/m68k/Makefile.objs | 4 +- hw/mem/Kconfig | 10 + hw/microblaze/Kconfig | 8 + hw/microblaze/Makefile.objs | 6 +- hw/mips/Kconfig | 20 + hw/mips/Makefile.objs | 6 +- hw/misc/Kconfig | 110 ++++ hw/misc/macio/Kconfig | 11 + hw/moxie/Kconfig | 2 + hw/moxie/Makefile.objs | 2 +- hw/net/Kconfig | 122 +++++ hw/nios2/Kconfig | 5 + hw/nios2/Makefile.objs | 3 +- hw/nvram/Kconfig | 8 + hw/openrisc/Kconfig | 2 + hw/openrisc/Makefile.objs | 2 +- hw/pci-bridge/Kconfig | 25 + hw/pci-host/Kconfig | 46 ++ hw/pci-host/Makefile.objs | 2 +- hw/pci/Kconfig | 5 + hw/pci/Makefile.objs | 5 +- hw/pcmcia/Kconfig | 2 + hw/ppc/Kconfig | 56 ++ hw/ppc/Makefile.objs | 12 +- hw/riscv/Kconfig | 14 + hw/riscv/Makefile.objs | 22 +- hw/scsi/Kconfig | 52 ++ hw/scsi/Makefile.objs | 2 +- hw/sd/Kconfig | 14 + hw/sh4/Kconfig | 11 + hw/sh4/Makefile.objs | 4 +- hw/smbios/Kconfig | 2 + hw/sparc/Kconfig | 11 + hw/sparc/Makefile.objs | 4 +- hw/sparc64/Kconfig | 5 + hw/sparc64/Makefile.objs | 6 +- hw/ssi/Kconfig | 14 + hw/timer/Kconfig | 63 +++ hw/tpm/Kconfig | 20 + hw/tricore/Kconfig | 2 + hw/tricore/Makefile.objs | 2 +- hw/unicore32/Kconfig | 2 + hw/usb/Kconfig | 92 ++++ hw/vfio/Kconfig | 11 + hw/virtio/Kconfig | 27 + hw/watchdog/Kconfig | 15 + hw/xtensa/Kconfig | 5 + hw/xtensa/Makefile.objs | 4 +- rules.mak | 2 +- scripts/make_device_config.sh | 30 -- scripts/minikconf.py | 680 ++++++++++++++++++++++++ 118 files changed, 2502 insertions(+), 265 deletions(-) create mode 100644 Kconfig.host delete mode 100644 default-configs/hyperv.mak delete mode 100644 default-configs/pci.mak delete mode 100644 default-configs/sound.mak delete mode 100644 default-configs/usb.mak delete mode 100644 default-configs/virtio.mak create mode 100644 hw/9pfs/Kconfig create mode 100644 hw/Kconfig create mode 100644 hw/acpi/Kconfig create mode 100644 hw/adc/Kconfig create mode 100644 hw/alpha/Kconfig create mode 100644 hw/arm/Kconfig create mode 100644 hw/audio/Kconfig create mode 100644 hw/block/Kconfig create mode 100644 hw/bt/Kconfig create mode 100644 hw/char/Kconfig create mode 100644 hw/core/Kconfig create mode 100644 hw/cpu/Kconfig create mode 100644 hw/cris/Kconfig create mode 100644 hw/display/Kconfig create mode 100644 hw/dma/Kconfig create mode 100644 hw/gpio/Kconfig create mode 100644 hw/hppa/Kconfig create mode 100644 hw/hyperv/Kconfig create mode 100644 hw/i2c/Kconfig create mode 100644 hw/i386/Kconfig create mode 100644 hw/ide/Kconfig create mode 100644 hw/input/Kconfig create mode 100644 hw/intc/Kconfig create mode 100644 hw/ipack/Kconfig create mode 100644 hw/ipmi/Kconfig create mode 100644 hw/isa/Kconfig create mode 100644 hw/lm32/Kconfig create mode 100644 hw/m68k/Kconfig create mode 100644 hw/mem/Kconfig create mode 100644 hw/microblaze/Kconfig create mode 100644 hw/mips/Kconfig create mode 100644 hw/misc/Kconfig create mode 100644 hw/misc/macio/Kconfig create mode 100644 hw/moxie/Kconfig create mode 100644 hw/net/Kconfig create mode 100644 hw/nios2/Kconfig create mode 100644 hw/nvram/Kconfig create mode 100644 hw/openrisc/Kconfig create mode 100644 hw/pci-bridge/Kconfig create mode 100644 hw/pci-host/Kconfig create mode 100644 hw/pci/Kconfig create mode 100644 hw/pcmcia/Kconfig create mode 100644 hw/ppc/Kconfig create mode 100644 hw/riscv/Kconfig create mode 100644 hw/scsi/Kconfig create mode 100644 hw/sd/Kconfig create mode 100644 hw/sh4/Kconfig create mode 100644 hw/smbios/Kconfig create mode 100644 hw/sparc/Kconfig create mode 100644 hw/sparc64/Kconfig create mode 100644 hw/ssi/Kconfig create mode 100644 hw/timer/Kconfig create mode 100644 hw/tpm/Kconfig create mode 100644 hw/tricore/Kconfig create mode 100644 hw/unicore32/Kconfig create mode 100644 hw/usb/Kconfig create mode 100644 hw/vfio/Kconfig create mode 100644 hw/virtio/Kconfig create mode 100644 hw/watchdog/Kconfig create mode 100644 hw/xtensa/Kconfig delete mode 100644 scripts/make_device_config.sh create mode 100644 scripts/minikconf.py
Signature · 1 line
2.17.1
RFC PATCH v3 1/43 build: actually use CONFIG_PAM
From: Paolo Bonzini <[email protected]>
Do not link it unconditionally into all binaries.
--- default-configs/i386-softmmu.mak | 1 + hw/pci-host/Makefile.objs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-)
default-configs/i386-softmmu.mak +1 -0
@@ -67,3 +67,4 @@ CONFIG_I2C=y CONFIG_SEV=$(CONFIG_KVM) CONFIG_VTD=y CONFIG_AMD_IOMMU=y +CONFIG_PAM=y
hw/pci-host/Makefile.objs +1 -1
@@ -1,4 +1,4 @@ -common-obj-y += pam.o +common-obj-$(CONFIG_PAM) += pam.o # PPC devices common-obj-$(CONFIG_PREP_PCI) += prep.o
Signature · 1 line
2.17.1
RFC PATCH v3 2/43 hw/i386/Makefile.objs: Build pc_piix* and pc_q35 boards
In reply to Yang ZhongFrom: Paolo Bonzini <[email protected]>
CONFIG_PIIX and CONFIG_Q35 created for the pc board object files. These are enabled automatically at default-configs/i386-softmmu.mak and default-configs/x86_64-softmmu.mak
--- default-configs/i386-softmmu.mak | 2 ++ hw/i386/Makefile.objs | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-)
default-configs/i386-softmmu.mak +2 -0
@@ -68,3 +68,5 @@ CONFIG_SEV=$(CONFIG_KVM) CONFIG_VTD=y CONFIG_AMD_IOMMU=y CONFIG_PAM=y +CONFIG_I440FX=y +CONFIG_Q35=y
hw/i386/Makefile.objs +3 -1
@@ -1,6 +1,8 @@ obj-$(CONFIG_KVM) += kvm/ obj-y += multiboot.o -obj-y += pc.o pc_piix.o pc_q35.o +obj-y += pc.o +obj-$(CONFIG_I440FX) += pc_piix.o +obj-$(CONFIG_Q35) += pc_q35.o obj-y += pc_sysfw.o obj-$(CONFIG_VTD) += x86-iommu.o intel_iommu.o obj-$(CONFIG_AMD_IOMMU) += x86-iommu.o amd_iommu.o
Signature · 1 line
2.17.1
RFC PATCH v3 3/43 hw/arm/Makefile.objs: CONFIG_VIRT created for virt board
In reply to Yang Zhongmake virt code configurable and the new CONFIG_VIRT definitions added to the default-configs/arm-softmmu.mak to replace CONFIG_ACPI in arm board.
--- default-configs/arm-softmmu.mak | 1 + hw/arm/Makefile.objs | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-)
default-configs/arm-softmmu.mak +1 -0
@@ -148,6 +148,7 @@ CONFIG_XIO3130=y CONFIG_IOH3420=y CONFIG_I82801B11=y CONFIG_ACPI=y +CONFIG_VIRT=y CONFIG_SMBIOS=y CONFIG_ASPEED_SOC=y CONFIG_GPIO_KEY=y
hw/arm/Makefile.objs +2 -1
@@ -1,4 +1,5 @@ -obj-y += boot.o virt.o sysbus-fdt.o +obj-y += boot.o sysbus-fdt.o +obj-$(CONFIG_VIRT) += virt.o obj-$(CONFIG_ACPI) += virt-acpi-build.o obj-$(CONFIG_DIGIC) += digic_boards.o obj-$(CONFIG_EXYNOS4) += exynos4_boards.o
Signature · 1 line
2.17.1
RFC PATCH v3 4/43 hw/m68k/Makefile.objs: Conditionally build boards
In reply to Yang ZhongFrom: Ákos Kovács <[email protected]>
CONFIG_AN5206, CONFIG_MCF5206 and CONFIG_MCF5208 make variables created for m68k boards, and added to default-configs/m86k-softmmu.mak.
--- default-configs/m68k-softmmu.mak | 2 ++ hw/m68k/Makefile.objs | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-)
default-configs/m68k-softmmu.mak +2 -0
@@ -2,3 +2,5 @@ CONFIG_COLDFIRE=y CONFIG_PTIMER=y +CONFIG_AN5206=y +CONFIG_MCF5208=y
hw/m68k/Makefile.objs +2 -2
@@ -1,2 +1,2 @@ -obj-y += an5206.o mcf5208.o -obj-y += mcf5206.o mcf_intc.o +obj-$(CONFIG_AN5206) += an5206.o mcf5206.o +obj-$(CONFIG_MCF5208) += mcf5208.o mcf_intc.o
Signature · 1 line
2.17.1
RFC PATCH v3 5/43 hw/microblaze/Makefile.objs: Create configs for petalogix and xilinx boards
In reply to Yang ZhongFrom: Ákos Kovács <[email protected]>
CONFIG_PETALOGIX_* and CONFIG_XLNX_* configs added to default-configs/microblaze-softmmu.mak and default-configs/microblazeel-softmmu.mak.
--- default-configs/microblaze-softmmu.mak | 3 +++ hw/microblaze/Makefile.objs | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-)
default-configs/microblaze-softmmu.mak +3 -0
@@ -10,3 +10,6 @@ CONFIG_XILINX_ETHLITE=y CONFIG_SSI=y CONFIG_SSI_M25P80=y CONFIG_XLNX_ZYNQMP=y +CONFIG_PETALOGIX_S3ADSP1800=y +CONFIG_PETALOGIX_ML605=y +CONFIG_XLNX_ZYNQMP_PMU=y
hw/microblaze/Makefile.objs +3 -3
@@ -1,4 +1,4 @@ -obj-y += petalogix_s3adsp1800_mmu.o -obj-y += petalogix_ml605_mmu.o -obj-y += xlnx-zynqmp-pmu.o +obj-$(CONFIG_PETALOGIX_S3ADSP1800) += petalogix_s3adsp1800_mmu.o +obj-$(CONFIG_PETALOGIX_ML605) += petalogix_ml605_mmu.o +obj-$(CONFIG_XLNX_ZYNQMP_PMU) += xlnx-zynqmp-pmu.o obj-y += boot.o
Signature · 1 line
2.17.1
RFC PATCH v3 6/43 hw/mips/Makefile.objs: Create CONFIG_* for r4k, malta, mipssim boards
In reply to Yang ZhongFrom: Ákos Kovács <[email protected]>
Add the new configs to default-configs/mips*-sofmmu.mak.
--- default-configs/mips-softmmu-common.mak | 3 +++ hw/mips/Makefile.objs | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-)
default-configs/mips-softmmu-common.mak +3 -0
@@ -36,3 +36,6 @@ CONFIG_EMPTY_SLOT=y CONFIG_MIPS_CPS=y CONFIG_MIPS_ITU=y CONFIG_I2C=y +CONFIG_R4K=y +CONFIG_MALTA=y +CONFIG_MIPSSIM=y
hw/mips/Makefile.objs +4 -2
@@ -1,7 +1,9 @@ -obj-y += mips_r4k.o mips_malta.o mips_mipssim.o obj-y += addr.o mips_int.o +obj-y += gt64xxx_pci.o +obj-$(CONFIG_R4K) += mips_r4k.o +obj-$(CONFIG_MALTA) += mips_malta.o +obj-$(CONFIG_MIPSSIM) += mips_mipssim.o obj-$(CONFIG_JAZZ) += mips_jazz.o obj-$(CONFIG_FULONG) += mips_fulong2e.o -obj-y += gt64xxx_pci.o obj-$(CONFIG_MIPS_CPS) += cps.o obj-$(CONFIG_MIPS_BOSTON) += boston.o
Signature · 1 line
2.17.1
RFC PATCH v3 7/43 hw/ppc/Makefile.objs: Build all boards conditinally with CONFIG_*
In reply to Yang ZhongFrom: Ákos Kovács <[email protected]>
CONFIG_PPC405, CONFIG_PPC440, CONFIG_MAC_OLDWORLD, CONFIG_MAX_NEWWORLD and CONFIG_VIRTEX configuration options created for default-configs/ppc*-softmmu.mak.
--- default-configs/ppc-softmmu.mak | 7 ++++++- hw/ppc/Makefile.objs | 12 ++++++------ 2 files changed, 12 insertions(+), 7 deletions(-)
default-configs/ppc-softmmu.mak +6 -1
@@ -21,6 +21,10 @@ CONFIG_E500=y CONFIG_OPENPIC_KVM=$(call land,$(CONFIG_E500),$(CONFIG_KVM)) CONFIG_PLATFORM_BUS=y CONFIG_ETSEC=y +CONFIG_PPC405=y +CONFIG_PPC440=y +CONFIG_VIRTEX=y + # For Sam460ex CONFIG_SAM460EX=y CONFIG_USB_EHCI_SYSBUS=y
@@ -34,7 +38,6 @@ CONFIG_M41T80=y CONFIG_VGA_CIRRUS=y # For Macs -CONFIG_MAC=y CONFIG_ESCC=y CONFIG_MACIO=y CONFIG_MACIO_GPIO=y
@@ -50,6 +53,8 @@ CONFIG_GRACKLE_PCI=y CONFIG_UNIN_PCI=y CONFIG_DEC_PCI=y CONFIG_IDE_MACIO=y +CONFIG_MAC_OLDWORLD=y +CONFIG_MAC_NEWWORLD=y # For PReP CONFIG_PREP=y
hw/ppc/Makefile.objs +6 -6
@@ -13,20 +13,20 @@ obj-y += spapr_pci_vfio.o endif obj-$(CONFIG_PSERIES) += spapr_rtas_ddw.o # PowerPC 4xx boards -obj-y += ppc4xx_devs.o ppc405_uc.o -obj-$(CONFIG_PPC4XX) += ppc4xx_pci.o ppc405_boards.o -obj-$(CONFIG_PPC4XX) += ppc440_bamboo.o ppc440_pcix.o ppc440_uc.o +obj-$(CONFIG_PPC405) += ppc405_boards.o ppc405_uc.o +obj-$(CONFIG_PPC440) += ppc440_bamboo.o ppc440_pcix.o ppc440_uc.o +obj-$(CONFIG_PPC4XX) += ppc4xx_pci.o ppc4xx_devs.o obj-$(CONFIG_SAM460EX) += sam460ex.o # PReP obj-$(CONFIG_PREP) += prep.o obj-$(CONFIG_PREP) += prep_systemio.o obj-${CONFIG_RS6000_MC} += rs6000_mc.o # OldWorld PowerMac -obj-$(CONFIG_MAC) += mac_oldworld.o +obj-$(CONFIG_MAC_OLDWORLD) += mac_oldworld.o # NewWorld PowerMac -obj-$(CONFIG_MAC) += mac_newworld.o +obj-$(CONFIG_MAC_NEWWORLD) += mac_newworld.o # e500 obj-$(CONFIG_E500) += e500.o mpc8544ds.o e500plat.o obj-$(CONFIG_E500) += mpc8544_guts.o ppce500_spin.o # PowerPC 440 Xilinx ML507 reference board. -obj-$(CONFIG_XILINX) += virtex_ml507.o +obj-$(CONFIG_VIRTEX) += virtex_ml507.o
Signature · 1 line
2.17.1
RFC PATCH v3 8/43 hw/sh4/Makefile.objs: New CONFIG_* varibales created for sh4 boards and device
In reply to Yang ZhongFrom: Ákos Kovács <[email protected]>
Make hw/sh4 configurable and add new CONFIG_* to the default-configs/sh4*-softmmu.mak.
--- default-configs/sh4-softmmu.mak | 2 ++ default-configs/sh4eb-softmmu.mak | 2 ++ hw/sh4/Makefile.objs | 4 ++-- 3 files changed, 6 insertions(+), 2 deletions(-)
default-configs/sh4-softmmu.mak +2 -0
@@ -19,3 +19,5 @@ CONFIG_PCSPK=y CONFIG_I82374=y CONFIG_I8257=y CONFIG_MC146818RTC=y +CONFIG_R2D=y +CONFIG_SHIX=y
default-configs/sh4eb-softmmu.mak +2 -0
@@ -19,3 +19,5 @@ CONFIG_PCSPK=y CONFIG_I82374=y CONFIG_I8257=y CONFIG_MC146818RTC=y +CONFIG_R2D=y +CONFIG_SHIX=y
hw/sh4/Makefile.objs +2 -2
@@ -1,4 +1,4 @@ -obj-y += shix.o r2d.o - obj-y += sh7750.o sh7750_regnames.o obj-y += sh_pci.o +obj-$(CONFIG_R2D) += r2d.o +obj-$(CONFIG_SHIX) += shix.o
Signature · 1 line
2.17.1
RFC PATCH v3 9/43 hw/sparc/Makefile.objs: CONFIG_* for sun4m and leon3 created
In reply to Yang ZhongFrom: Ákos Kovács <[email protected]>
CONFIG_LEON3 added to default-configs/sparc-softmmu.mak.
--- default-configs/sparc-softmmu.mak | 2 ++ hw/sparc/Makefile.objs | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-)
default-configs/sparc-softmmu.mak +2 -0
@@ -18,4 +18,6 @@ CONFIG_CS4231=y CONFIG_GRLIB=y CONFIG_STP2000=y CONFIG_ECCMEMCTL=y + CONFIG_SUN4M=y +CONFIG_LEON3=y
hw/sparc/Makefile.objs +3 -1
@@ -1 +1,3 @@ -obj-y += sun4m_iommu.o sun4m.o leon3.o +obj-$(CONFIG_SUN4M) += sun4m_iommu.o +obj-$(CONFIG_SUN4M) += sun4m.o +obj-$(CONFIG_LEON3) += leon3.o
Signature · 1 line
2.17.1
RFC PATCH v3 10/43 hw/lm32/Makefile.objs: Conditionally build lm32 and milkmyst
In reply to Yang ZhongFrom: Ákos Kovács <[email protected]>
CONFIG_LM32 and CONFIG_MILKYMIST added for lm32 and milkmyst build.
--- hw/lm32/Makefile.objs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
hw/lm32/Makefile.objs +2 -2
@@ -1,3 +1,3 @@ # LM32 boards -obj-y += lm32_boards.o -obj-y += milkymist.o +obj-$(CONFIG_LM32) += lm32_boards.o +obj-$(CONFIG_MILKYMIST) += milkymist.o
Signature · 1 line
2.17.1
RFC PATCH v3 11/43 hw/xtensa/Makefile.objs: Build xtensa_sim and xtensa_fpga conditionally
In reply to Yang ZhongFrom: Ákos Kovács <[email protected]>
Add the new CONFIG_* values to default-config/xtensa*-softmmu.mak.
--- default-configs/xtensa-softmmu.mak | 3 +++ default-configs/xtensaeb-softmmu.mak | 3 +++ hw/xtensa/Makefile.objs | 4 ++-- 3 files changed, 8 insertions(+), 2 deletions(-)
default-configs/xtensa-softmmu.mak +3 -0
@@ -3,3 +3,6 @@ CONFIG_SERIAL=y CONFIG_OPENCORES_ETH=y CONFIG_PFLASH_CFI01=y + +CONFIG_XTENSA_SIM=y +CONFIG_XTENSA_FPGA=y
default-configs/xtensaeb-softmmu.mak +3 -0
@@ -3,3 +3,6 @@ CONFIG_SERIAL=y CONFIG_OPENCORES_ETH=y CONFIG_PFLASH_CFI01=y + +CONFIG_XTENSA_SIM=y +CONFIG_XTENSA_FPGA=y
hw/xtensa/Makefile.objs +2 -2
@@ -1,4 +1,4 @@ obj-y += pic_cpu.o -obj-y += sim.o obj-y += xtensa_memory.o -obj-y += xtfpga.o +obj-$(CONFIG_XTENSA_SIM) += sim.o +obj-$(CONFIG_XTENSA_FPGA) += xtfpga.o
Signature · 1 line
2.17.1
RFC PATCH v3 12/43 hw/nios2/Makefile.objs: Conditionally build nios2
In reply to Yang ZhongCONFIG_NIOS2_10M50 added for 10m50 dev board.
--- default-configs/nios2-softmmu.mak | 1 + hw/nios2/Makefile.objs | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-)
default-configs/nios2-softmmu.mak +1 -0
@@ -4,3 +4,4 @@ CONFIG_NIOS2=y CONFIG_SERIAL=y CONFIG_PTIMER=y CONFIG_ALTERA_TIMER=y +CONFIG_NIOS2_10M50=y
hw/nios2/Makefile.objs +2 -1
@@ -1 +1,2 @@ -obj-y = boot.o cpu_pic.o 10m50_devboard.o +obj-y = boot.o cpu_pic.o +obj-$(CONFIG_NIOS2_10M50) += 10m50_devboard.o
Signature · 1 line
2.17.1
RFC PATCH v3 13/43 hw/riscv/Makefile.objs: Create CONFIG_* for riscv boards
In reply to Yang ZhongAdd the new configs to default-configs/riscv*-sofmmu.mak.
--- default-configs/riscv32-softmmu.mak | 7 +++++++ default-configs/riscv64-softmmu.mak | 7 +++++++ hw/riscv/Makefile.objs | 22 +++++++++++----------- 3 files changed, 25 insertions(+), 11 deletions(-)
default-configs/riscv32-softmmu.mak +7 -0
@@ -12,3 +12,10 @@ CONFIG_PCI_GENERIC=y CONFIG_VGA=y CONFIG_VGA_PCI=y + +CONFIG_SPIKE=y +CONFIG_HART=y +CONFIG_SIFIVE_E=y +CONFIG_SIFIVE=y +CONFIG_SIFIVE_U=y +CONFIG_RISCV_VIRT=y
default-configs/riscv64-softmmu.mak +7 -0
@@ -12,3 +12,10 @@ CONFIG_PCI_GENERIC=y CONFIG_VGA=y CONFIG_VGA_PCI=y + +CONFIG_SPIKE=y +CONFIG_HART=y +CONFIG_SIFIVE_E=y +CONFIG_SIFIVE=y +CONFIG_SIFIVE_U=y +CONFIG_RISCV_VIRT=y
hw/riscv/Makefile.objs +11 -11
@@ -1,11 +1,11 @@ -obj-y += riscv_htif.o -obj-y += riscv_hart.o -obj-y += sifive_e.o -obj-y += sifive_clint.o -obj-y += sifive_prci.o -obj-y += sifive_plic.o -obj-y += sifive_test.o -obj-y += sifive_u.o -obj-y += sifive_uart.o -obj-y += spike.o -obj-y += virt.o +obj-$(CONFIG_SPIKE) += riscv_htif.o +obj-$(CONFIG_HART) += riscv_hart.o +obj-$(CONFIG_SIFIVE_E) += sifive_e.o +obj-$(CONFIG_SIFIVE) += sifive_clint.o +obj-$(CONFIG_SIFIVE) += sifive_prci.o +obj-$(CONFIG_SIFIVE) += sifive_plic.o +obj-$(CONFIG_SIFIVE) += sifive_test.o +obj-$(CONFIG_SIFIVE_U) += sifive_u.o +obj-$(CONFIG_SIFIVE) += sifive_uart.o +obj-$(CONFIG_SPIKE) += spike.o +obj-$(CONFIG_RISCV_VIRT) += virt.o
Signature · 1 line
2.17.1
RFC PATCH v3 14/43 hw/sparc64/Makefile.objs: Create CONFIG_* for sparc64
In reply to Yang ZhongAdd the new configs to default-configs/sparc64-sofmmu.mak.
--- default-configs/sparc64-softmmu.mak | 2 ++ hw/sparc64/Makefile.objs | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-)
default-configs/sparc64-softmmu.mak +2 -0
@@ -17,3 +17,5 @@ CONFIG_SUNHME=y CONFIG_MC146818RTC=y CONFIG_ISA_TESTDEV=y CONFIG_SUN4V_RTC=y +CONFIG_SUN4U=y +CONFIG_NIAGARA=y
hw/sparc64/Makefile.objs +3 -3
@@ -1,4 +1,4 @@ obj-y += sparc64.o -obj-y += sun4u_iommu.o -obj-y += sun4u.o -obj-y += niagara.o +obj-$(CONFIG_SUN4U) += sun4u_iommu.o +obj-$(CONFIG_SUN4U) += sun4u.o +obj-$(CONFIG_NIAGARA) += niagara.o
Signature · 1 line
2.17.1
RFC PATCH v3 15/43 hw/alpha/Makefile.objs: Create CONFIG_* for alpha
In reply to Yang ZhongAdd the new configs to default-configs/alpha-sofmmu.mak.
--- default-configs/alpha-softmmu.mak | 2 ++ hw/alpha/Makefile.objs | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-)
default-configs/alpha-softmmu.mak +2 -0
@@ -19,3 +19,5 @@ CONFIG_I8259=y CONFIG_MC146818RTC=y CONFIG_ISA_TESTDEV=y CONFIG_SMC37C669=y +CONFIG_DP264=y +CONFIG_TYPHOON=y
hw/alpha/Makefile.objs +3 -1
@@ -1 +1,3 @@ -obj-y += dp264.o pci.o typhoon.o +obj-y += pci.o +obj-$(CONFIG_DP264) += dp264.o +obj-$(CONFIG_TYPHOON) += typhoon.o
Signature · 1 line
2.17.1
RFC PATCH v3 16/43 hw/cris/Makefile.objs: Create CONFIG_* for cris
In reply to Yang ZhongAdd the new configs to default-configs/cris-sofmmu.mak.
--- default-configs/cris-softmmu.mak | 1 + hw/cris/Makefile.objs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-)
default-configs/cris-softmmu.mak +1 -0
@@ -4,3 +4,4 @@ CONFIG_ETRAXFS=y CONFIG_NAND=y CONFIG_PTIMER=y CONFIG_PFLASH_CFI02=y +CONFIG_AXIS=y
hw/cris/Makefile.objs +1 -1
@@ -1,2 +1,2 @@ obj-y += boot.o -obj-y += axis_dev88.o +obj-$(CONFIG_AXIS) += axis_dev88.o
Signature · 1 line
2.17.1
RFC PATCH v3 17/43 hw/hppa/Makefile.objs: Create CONFIG_* for hppa
In reply to Yang ZhongAdd the new configs to default-configs/hppa-sofmmu.mak.
--- default-configs/hppa-softmmu.mak | 2 ++ hw/hppa/Makefile.objs | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-)
default-configs/hppa-softmmu.mak +2 -0
@@ -10,3 +10,5 @@ CONFIG_IDE_CMD646=y # CONFIG_IDE_MMIO=y CONFIG_VIRTIO_VGA=y CONFIG_MC146818RTC=y +CONFIG_HPPA=y +CONFIG_DINO=y
hw/hppa/Makefile.objs +3 -1
@@ -1 +1,3 @@ -obj-y += machine.o pci.o dino.o +obj-y += pci.o +obj-$(CONFIG_HPPA) += machine.o +obj-$(CONFIG_DINO) += dino.o
Signature · 1 line
2.17.1
RFC PATCH v3 18/43 hw/moxie/Makefile.objs: Conditionally build moxie
In reply to Yang ZhongCONFIG_MOXIE added for moxiesim board.
--- default-configs/moxie-softmmu.mak | 1 + hw/moxie/Makefile.objs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-)
default-configs/moxie-softmmu.mak +1 -0
@@ -5,3 +5,4 @@ CONFIG_MC146818RTC=y CONFIG_SERIAL=y CONFIG_SERIAL_ISA=y CONFIG_VGA=y +CONFIG_MOXIE=y
hw/moxie/Makefile.objs +1 -1
@@ -1,2 +1,2 @@ # moxie boards -obj-y += moxiesim.o +obj-$(CONFIG_MOXIE) += moxiesim.o
Signature · 1 line
2.17.1
RFC PATCH v3 19/43 hw/openrisc/Makefile.objs: Create CONFIG_* for openrisc
In reply to Yang ZhongAdd the new configs to default-configs/or1k-sofmmu.mak.
--- default-configs/or1k-softmmu.mak | 1 + hw/openrisc/Makefile.objs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-)
default-configs/or1k-softmmu.mak +1 -0
@@ -3,3 +3,4 @@ CONFIG_SERIAL=y CONFIG_OPENCORES_ETH=y CONFIG_OMPIC=y +CONFIG_OPENRISC=y
hw/openrisc/Makefile.objs +1 -1
@@ -1,2 +1,2 @@ obj-y = pic_cpu.o cputimer.o -obj-y += openrisc_sim.o +obj-$(CONFIG_OPENRISC) += openrisc_sim.o
Signature · 1 line
2.17.1
RFC PATCH v3 20/43 hw/tricore/Makefile.objs: Create CONFIG_* for tricore
In reply to Yang ZhongAdd the new configs to default-configs/tricore-sofmmu.mak.
--- default-configs/tricore-softmmu.mak | 1 + hw/tricore/Makefile.objs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-)
default-configs/tricore-softmmu.mak +1 -0
@@ -0,0 +1 @@ +CONFIG_TRICORE=y
hw/tricore/Makefile.objs +1 -1
@@ -1 +1 @@ -obj-y += tricore_testboard.o +obj-$(CONFIG_TRICORE) += tricore_testboard.o
Signature · 1 line
2.17.1
RFC PATCH v3 21/43 minikconfig: add parser skeleton
In reply to Yang ZhongFrom: Paolo Bonzini <[email protected]>
This implements a scanner and recursive descent parser for Kconfig-like configuration files. The only "action" of the parser is for now to detect undefined variables and process include files.
The main differences between Kconfig and this are:
* only the "bool" type is supported
* variables can only be defined once
* choices are not supported (but they could be added as syntactic sugar for multiple Boolean values)
* menus and other graphical concepts (prompts, help text) are not supported
* assignments ("CONFIG_FOO=y", "CONFIG_FOO=n") are parsed as part of the Kconfig language, not as a separate file.
The idea was originally by Ákos Kovács, but I could not find his implementation so I had to redo it.
--- scripts/minikconf.py | 423 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 423 insertions(+) create mode 100644 scripts/minikconf.py
scripts/minikconf.py new file +423 -0
@@ -0,0 +1,423 @@ +# +# Mini-Kconfig parser +# +# Copyright (c) 2015 Red Hat Inc. +# +# Authors: +# Paolo Bonzini <[email protected]> +# +# This work is licensed under the terms of the GNU GPL, version 2 +# or, at your option, any later version. See the COPYING file in +# the top-level directory. + +import os +import sys + +__all__ = [ 'KconfigParserError', 'KconfigData', 'KconfigParser' ] + +# ------------------------------------------- +# KconfigData implements the Kconfig semantics. For now it can only +# detect undefined symbols, i.e. symbols that were referenced in +# assignments or dependencies but were not declared with "config FOO". +# +# Semantic actions are represented by methods called do_*. The do_var +# method return the semantic value of a variable (which right now is +# just its name). +# ------------------------------------------- + +class KconfigData: + def __init__(self): + self.previously_included = [] + self.incl_info = None + self.defined_vars = set() + self.referenced_vars = set() + + # semantic analysis ------------- + + def check_undefined(self): + undef = False + for i in self.referenced_vars: + if not (i in self.defined_vars): + print "undefined symbol %s" % (i) + undef = True + return undef + + # semantic actions ------------- + + def do_declaration(self, var): + if (var in self.defined_vars): + raise Exception('variable "' + var + '" defined twice') + + self.defined_vars.add(var) + + # var is a string with the variable's name. + # + # For now this just returns the variable's name itself. + def do_var(self, var): + self.referenced_vars.add(var) + return var + + def do_assignment(self, var, val): + pass + + def do_default(self, var, val, cond=None): + pass + + def do_depends_on(self, var, expr): + pass + + def do_select(self, var, symbol, cond=None): + pass + +# ------------------------------------------- +# KconfigParser implements a recursive descent parser for (simplified) +# Kconfig syntax. +# ------------------------------------------- + +# tokens table +TOKENS = {} +TOK_NONE = -1 +TOK_LPAREN = 0; TOKENS[TOK_LPAREN] = '"("'; +TOK_RPAREN = 1; TOKENS[TOK_RPAREN] = '")"'; +TOK_EQUAL = 2; TOKENS[TOK_EQUAL] = '"="'; +TOK_AND = 3; TOKENS[TOK_AND] = '"&&"'; +TOK_OR = 4; TOKENS[TOK_OR] = '"||"'; +TOK_NOT = 5; TOKENS[TOK_NOT] = '"!"'; +TOK_DEPENDS = 6; TOKENS[TOK_DEPENDS] = '"depends"'; +TOK_ON = 7; TOKENS[TOK_ON] = '"on"'; +TOK_SELECT = 8; TOKENS[TOK_SELECT] = '"select"'; +TOK_CONFIG = 9; TOKENS[TOK_CONFIG] = '"config"'; +TOK_DEFAULT = 10; TOKENS[TOK_DEFAULT] = '"default"'; +TOK_Y = 11; TOKENS[TOK_Y] = '"y"'; +TOK_N = 12; TOKENS[TOK_N] = '"n"'; +TOK_SOURCE = 13; TOKENS[TOK_SOURCE] = '"source"'; +TOK_BOOL = 14; TOKENS[TOK_BOOL] = '"bool"'; +TOK_IF = 15; TOKENS[TOK_IF] = '"if"'; +TOK_ID = 16; TOKENS[TOK_ID] = 'identifier'; +TOK_EOF = 17; TOKENS[TOK_EOF] = 'end of file'; + +class KconfigParserError(Exception): + def __init__(self, parser, msg, tok=None): + self.loc = parser.location() + tok = tok or parser.tok + if tok != TOK_NONE: + msg = '%s before %s' %(msg, TOKENS[tok]) + self.msg = msg + + def __str__(self): + return "%s: %s" % (self.loc, self.msg) + +class KconfigParser: + @classmethod + def parse(self, fp): + data = KconfigData() + parser = KconfigParser(data) + parser.parse_file(fp) + if data.check_undefined(): + raise KconfigParserError(parser, "there were undefined symbols") + + return data + + def __init__(self, data): + self.data = data + + def parse_file(self, fp): + self.abs_fname = os.path.abspath(fp.name) + self.fname = fp.name + self.data.previously_included.append(self.abs_fname) + self.src = fp.read() + if self.src == '' or self.src[-1] != '\n': + self.src += '\n' + self.cursor = 0 + self.line = 1 + self.line_pos = 0 + self.get_token() + self.parse_config() + + # file management ----- + + def error_path(self): + inf = self.data.incl_info + res = "" + while inf: + res = ("In file included from %s:%d:\n" % (inf['file'], + inf['line'])) + res + inf = inf['parent'] + return res + + def location(self): + col = 1 + for ch in self.src[self.line_pos:self.pos]: + if ch == '\t': + col += 8 - ((col - 1) % 8) + else: + col += 1 + return '%s%s:%d:%d' %(self.error_path(), self.fname, self.line, col) + + def do_include(self, include): + incl_abs_fname = os.path.join(os.path.dirname(self.abs_fname), + include) + # catch inclusion cycle + inf = self.data.incl_info + while inf: + if incl_abs_fname == os.path.abspath(inf['file']): + raise KconfigParserError(self, "Inclusion loop for %s" + % include) + inf = inf['parent'] + + # skip multiple include of the same file + if incl_abs_fname in self.data.previously_included: + return + try: + fp = open(incl_abs_fname, 'r') + except IOError, e: + raise KconfigParserError(self, + '%s: %s' % (e.strerror, include)) + + inf = self.data.incl_info + self.data.incl_info = { 'file': self.fname, 'line': self.line, + 'parent': inf } + KconfigParser(self.data).parse_file(fp) + self.data.incl_info = inf + + # recursive descent parser ----- + + # y_or_n: Y | N + def parse_y_or_n(self): + if self.tok == TOK_Y: + self.get_token() + return True + if self.tok == TOK_N: + self.get_token() + return False + raise KconfigParserError(self, 'Expected "y" or "n"') + + # var: ID + def parse_var(self): + if self.tok == TOK_ID: + val = self.val + self.get_token() + return self.data.do_var(val) + else: + raise KconfigParserError(self, 'Expected identifier') + + # assignment_var: ID (starting with "CONFIG_") + def parse_assignment_var(self): + if self.tok == TOK_ID: + val = self.val + if not val.startswith("CONFIG_"): + raise KconfigParserError(self, + 'Expected identifier starting with "CONFIG_"', TOK_NONE) + self.get_token() + return self.data.do_var(val[7:]) + else: + raise KconfigParserError(self, 'Expected identifier') + + # assignment: var EQUAL y_or_n + def parse_assignment(self): + var = self.parse_assignment_var() + if self.tok != TOK_EQUAL: + raise KconfigParserError(self, 'Expected "="') + self.get_token() + self.data.do_assignment(var, self.parse_y_or_n()) + + # primary: NOT primary + # | LPAREN expr RPAREN + # | var + def parse_primary(self): + if self.tok == TOK_NOT: + self.get_token() + self.parse_primary() + elif self.tok == TOK_LPAREN: + self.get_token() + self.parse_expr() + if self.tok != TOK_RPAREN: + raise KconfigParserError(self, 'Expected ")"') + self.get_token() + elif self.tok == TOK_ID: + self.parse_var() + else: + raise KconfigParserError(self, 'Expected "!" or "(" or identifier') + + # disj: primary (OR primary)* + def parse_disj(self): + self.parse_primary() + while self.tok == TOK_OR: + self.get_token() + self.parse_primary() + + # expr: disj (AND disj)* + def parse_expr(self): + self.parse_disj() + while self.tok == TOK_AND: + self.get_token() + self.parse_disj() + + # condition: IF expr + # | empty + def parse_condition(self): + if self.tok == TOK_IF: + self.get_token() + return self.parse_expr() + else: + return None + + # property: DEFAULT y_or_n condition + # | DEPENDS ON expr + # | SELECT var condition + # | BOOL + def parse_property(self, var): + if self.tok == TOK_DEFAULT: + self.get_token() + val = self.parse_y_or_n() + cond = self.parse_condition() + self.data.do_default(var, val, cond) + elif self.tok == TOK_DEPENDS: + self.get_token() + if self.tok != TOK_ON: + raise KconfigParserError(self, 'Expected "on"') + self.get_token() + self.data.do_depends_on(var, self.parse_expr()) + elif self.tok == TOK_SELECT: + self.get_token() + symbol = self.parse_var() + cond = self.parse_condition() + self.data.do_select(var, symbol, cond) + elif self.tok == TOK_BOOL: + self.get_token() + else: + raise KconfigParserError(self, 'Error in recursive descent?') + + # properties: properties property + # | /* empty */ + def parse_properties(self, var): + had_default = False + while self.tok == TOK_DEFAULT or self.tok == TOK_DEPENDS or \ + self.tok == TOK_SELECT or self.tok == TOK_BOOL: + self.parse_property(var) + self.data.do_default(var, False) + + # for nicer error message + if self.tok != TOK_SOURCE and self.tok != TOK_CONFIG and \ + self.tok != TOK_ID and self.tok != TOK_EOF: + raise KconfigParserError(self, 'expected "source", "config", identifier, ' + + '"default", "depends on" or "select"') + + # declaration: config var properties + def parse_declaration(self): + if self.tok == TOK_CONFIG: + self.get_token() + var = self.parse_var() + self.data.do_declaration(var) + self.parse_properties(var) + else: + raise KconfigParserError(self, 'Error in recursive descent?') + + # clause: SOURCE + # | declaration + # | assignment + def parse_clause(self): + if self.tok == TOK_SOURCE: + val = self.val + self.get_token() + self.do_include(val) + elif self.tok == TOK_CONFIG: + self.parse_declaration() + elif self.tok == TOK_ID: + self.parse_assignment() + else: + raise KconfigParserError(self, 'expected "source", "config" or identifier') + + # config: clause+ EOF + def parse_config(self): + while self.tok != TOK_EOF: + self.parse_clause() + return self.data + + # scanner ----- + + def get_token(self): + while True: + self.tok = self.src[self.cursor] + self.pos = self.cursor + self.cursor += 1 + + self.val = None + self.tok = self.scan_token() + if self.tok is not None: + return + + def check_keyword(self, rest): + if not self.src.startswith(rest, self.cursor): + return False + length = len(rest) + if self.src[self.cursor + length].isalnum() or self.src[self.cursor + length] == '|': + return False + self.cursor += length + return True + + def scan_token(self): + if self.tok == '#': + self.cursor = self.src.find('\n', self.cursor) + return None + elif self.tok == '=': + return TOK_EQUAL + elif self.tok == '(': + return TOK_LPAREN + elif self.tok == ')': + return TOK_RPAREN + elif self.tok == '&' and self.src[self.pos+1] == '&': + self.cursor += 1 + return TOK_AND + elif self.tok == '|' and self.src[self.pos+1] == '|': + self.cursor += 1 + return TOK_OR + elif self.tok == '!': + return TOK_NOT + elif self.tok == 'd' and self.check_keyword("epends"): + return TOK_DEPENDS + elif self.tok == 'o' and self.check_keyword("n"): + return TOK_ON + elif self.tok == 's' and self.check_keyword("elect"): + return TOK_SELECT + elif self.tok == 'c' and self.check_keyword("onfig"): + return TOK_CONFIG + elif self.tok == 'd' and self.check_keyword("efault"): + return TOK_DEFAULT + elif self.tok == 'b' and self.check_keyword("ool"): + return TOK_BOOL + elif self.tok == 'i' and self.check_keyword("f"): + return TOK_IF + elif self.tok == 'y' and self.check_keyword(""): + return TOK_Y + elif self.tok == 'n' and self.check_keyword(""): + return TOK_N + elif (self.tok == 's' and self.check_keyword("ource")) or \ + self.tok == 'i' and self.check_keyword("nclude"): + # source FILENAME + # include FILENAME + while self.src[self.cursor].isspace(): + self.cursor += 1 + start = self.cursor + self.cursor = self.src.find('\n', self.cursor) + self.val = self.src[start:self.cursor] + return TOK_SOURCE + elif self.tok.isalpha(): + # identifier + while self.src[self.cursor].isalnum() or self.src[self.cursor] == '_': + self.cursor += 1 + self.val = self.src[self.pos:self.cursor] + return TOK_ID + elif self.tok == '\n': + if self.cursor == len(self.src): + return TOK_EOF + self.line += 1 + self.line_pos = self.cursor + elif not self.tok.isspace(): + raise KconfigParserError(self, 'Stray "%s"' % self.tok) + + return None + +if __name__ == '__main__': + fname = len(sys.argv) > 1 and sys.argv[1] or 'Kconfig.test' + KconfigParser.parse(open(fname, 'r'))
Signature · 1 line
2.17.1
RFC PATCH v3 22/43 minikconfig: add AST
In reply to Yang ZhongFrom: Paolo Bonzini <[email protected]>
Add Python classes that represent the Kconfig abstract syntax tree. The abstract syntax tree is stored as a list of clauses. For example:
config FOO
depends on BAR
select BAZ
is represented as three clauses:
FOO depends on BAR
FOO default n
select BAZ if FOO
--- scripts/minikconf.py | 116 ++++++++++++++++++++++++++++++++++++------- 1 file changed, 98 insertions(+), 18 deletions(-)
scripts/minikconf.py +98 -18
@@ -26,11 +26,84 @@ __all__ = [ 'KconfigParserError', 'KconfigData', 'KconfigParser' ] # ------------------------------------------- class KconfigData: + class Expr: + def __and__(self, rhs): + return KconfigData.AND(self, rhs) + def __or__(self, rhs): + return KconfigData.OR(self, rhs) + def __invert__(self): + return KconfigData.NOT(self) + + class AND(Expr): + def __init__(self, lhs, rhs): + self.lhs = lhs + self.rhs = rhs + def __str__(self): + return "(%s && %s)" % (self.lhs, self.rhs) + + class OR(Expr): + def __init__(self, lhs, rhs): + self.lhs = lhs + self.rhs = rhs + def __str__(self): + return "(%s || %s)" % (self.lhs, self.rhs) + + class NOT(Expr): + def __init__(self, lhs): + self.lhs = lhs + def __str__(self): + return "!%s" % (self.lhs) + + class Var(Expr): + def __init__(self, name): + self.name = name + self.value = None + def __str__(self): + return self.name + + class Clause: + def __init__(self, dest): + self.dest = dest + + class AssignmentClause(Clause): + def __init__(self, dest, value): + KconfigData.Clause.__init__(self, dest) + self.value = value + def __str__(self): + return "%s=%s" % (self.dest, 'y' if self.value else 'n') + + class DefaultClause(Clause): + def __init__(self, dest, value, cond=None): + KconfigData.Clause.__init__(self, dest) + self.value = value + self.cond = cond + def __str__(self): + value = 'y' if self.value else 'n' + if self.cond is None: + return "config %s default %s" % (self.dest, value) + else: + return "config %s default %s if %s" % (self.dest, value, self.cond) + + class DependsOnClause(Clause): + def __init__(self, dest, expr): + KconfigData.Clause.__init__(self, dest) + self.expr = expr + def __str__(self): + return "config %s depends on %s" % (self.dest, self.expr) + + class SelectClause(Clause): + def __init__(self, dest, cond): + KconfigData.Clause.__init__(self, dest) + self.cond = cond + def __str__(self): + return "select %s if %s" % (self.dest, self.cond) + def __init__(self): self.previously_included = [] self.incl_info = None self.defined_vars = set() - self.referenced_vars = set() + self.referenced_vars = dict() + self.clauses = list() # semantic analysis -------------
@@ -48,26 +121,28 @@ class KconfigData: if (var in self.defined_vars): raise Exception('variable "' + var + '" defined twice') - self.defined_vars.add(var) + self.defined_vars.add(var.name) # var is a string with the variable's name. - # - # For now this just returns the variable's name itself. def do_var(self, var): - self.referenced_vars.add(var) - return var + if (var in self.referenced_vars): + return self.referenced_vars[var] + + var_obj = self.referenced_vars[var] = KconfigData.Var(var) + return var_obj def do_assignment(self, var, val): - pass + self.clauses.append(KconfigData.AssignmentClause(var, val)) def do_default(self, var, val, cond=None): - pass + self.clauses.append(KconfigData.DefaultClause(var, val, cond)) def do_depends_on(self, var, expr): - pass + self.clauses.append(KconfigData.DependsOnClause(var, expr)) def do_select(self, var, symbol, cond=None): - pass + cond = (cond & var) if cond is not None else var + self.clauses.append(KconfigData.SelectClause(symbol, cond)) # ------------------------------------------- # KconfigParser implements a recursive descent parser for (simplified)
@@ -227,31 +302,34 @@ class KconfigParser: def parse_primary(self): if self.tok == TOK_NOT: self.get_token() - self.parse_primary() + val = ~self.parse_primary() elif self.tok == TOK_LPAREN: self.get_token() - self.parse_expr() + val = self.parse_expr() if self.tok != TOK_RPAREN: raise KconfigParserError(self, 'Expected ")"') self.get_token() elif self.tok == TOK_ID: - self.parse_var() + val = self.parse_var() else: raise KconfigParserError(self, 'Expected "!" or "(" or identifier') + return val # disj: primary (OR primary)* def parse_disj(self): - self.parse_primary() + lhs = self.parse_primary() while self.tok == TOK_OR: self.get_token() - self.parse_primary() + lhs = lhs | self.parse_primary() + return lhs # expr: disj (AND disj)* def parse_expr(self): - self.parse_disj() + lhs = self.parse_disj() while self.tok == TOK_AND: self.get_token() - self.parse_disj() + lhs = lhs & self.parse_disj() + return lhs # condition: IF expr # | empty
@@ -420,4 +498,6 @@ class KconfigParser: if __name__ == '__main__': fname = len(sys.argv) > 1 and sys.argv[1] or 'Kconfig.test' - KconfigParser.parse(open(fname, 'r')) + data = KconfigParser.parse(open(fname, 'r')) + for i in data.clauses: + print i
Signature · 1 line
2.17.1
RFC PATCH v3 23/43 minikconfig: add semantic analysis
In reply to Yang ZhongFrom: Paolo Bonzini <[email protected]>
There are three parts in the semantic analysis:
1) evaluating expressions. This is done as a simple visit of the Expr nodes.
2) ordering clauses. This is done by constructing a graph of variables. There is an edge from X to Y if Y depends on X, if X selects Y, or if X appears in a conditional selection of Y; in other words, if the value of X can affect the value of Y. Each clause has a "destination" variable whose value can be affected by the clause, and clauses will be processed according to a topological sorting of their destination variables. Defaults are processed after all other clauses with the same destination.
3) deriving the value of the variables. This is done by processing the clauses in the topological order provided by the previous step. A "depends on" clause will force a variable to False, a "select" clause will force a variable to True, an assignment will force a variable to its RHS. A default will set a variable to its RHS if it has not been set before. Because all variables have a default, after visiting all clauses all variables will have been set.
--- scripts/minikconf.py | 129 +++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 124 insertions(+), 5 deletions(-)
scripts/minikconf.py +124 -5
@@ -15,6 +15,10 @@ import sys __all__ = [ 'KconfigParserError', 'KconfigData', 'KconfigParser' ] +def debug_print(*args): + #print ' '.join(str(x) for x in args) + pass + # ------------------------------------------- # KconfigData implements the Kconfig semantics. For now it can only # detect undefined symbols, i.e. symbols that were referenced in
@@ -34,6 +38,12 @@ class KconfigData: def __invert__(self): return KconfigData.NOT(self) + # Abstract methods + def add_edges_to(self, var): + pass + def evaluate(self): + assert False + class AND(Expr): def __init__(self, lhs, rhs): self.lhs = lhs
@@ -41,6 +51,12 @@ class KconfigData: def __str__(self): return "(%s && %s)" % (self.lhs, self.rhs) + def add_edges_to(self, var): + self.lhs.add_edges_to(var) + self.rhs.add_edges_to(var) + def evaluate(self): + return self.lhs.evaluate() and self.rhs.evaluate() + class OR(Expr): def __init__(self, lhs, rhs): self.lhs = lhs
@@ -48,22 +64,62 @@ class KconfigData: def __str__(self): return "(%s || %s)" % (self.lhs, self.rhs) + def add_edges_to(self, var): + self.lhs.add_edges_to(var) + self.rhs.add_edges_to(var) + def evaluate(self): + return self.lhs.evaluate() or self.rhs.evaluate() + class NOT(Expr): def __init__(self, lhs): self.lhs = lhs def __str__(self): return "!%s" % (self.lhs) + def add_edges_to(self, var): + self.lhs.add_edges_to(var) + def evaluate(self): + return not self.lhs.evaluate() + class Var(Expr): def __init__(self, name): self.name = name self.value = None + self.outgoing = set() def __str__(self): return self.name + def has_value(self): + return not (self.value is None) + def set_value(self, val): + if self.has_value() and self.value != val: + raise Exception('contradiction between clauses when setting %s' % self) + debug_print("=> %s is now %s" % (self.name, val)) + self.value = val + + # depth first search of the dependency graph + def dfs(self, visited, f): + if self in visited: + return + visited.add(self) + for v in self.outgoing: + v.dfs(visited, f) + f(self) + + def add_edges_to(self, var): + self.outgoing.add(var) + def evaluate(self): + if not self.has_value(): + raise Exception('cycle found including %s' % self) + return self.value + class Clause: def __init__(self, dest): self.dest = dest + def priority(self): + return 0 + def process(self): + pass class AssignmentClause(Clause): def __init__(self, dest, value):
@@ -72,11 +128,16 @@ class KconfigData: def __str__(self): return "%s=%s" % (self.dest, 'y' if self.value else 'n') + def process(self): + self.dest.set_value(self.value) + class DefaultClause(Clause): def __init__(self, dest, value, cond=None): KconfigData.Clause.__init__(self, dest) self.value = value self.cond = cond + if not (self.cond is None): + self.cond.add_edges_to(self.dest) def __str__(self): value = 'y' if self.value else 'n' if self.cond is None:
@@ -84,20 +145,38 @@ class KconfigData: else: return "config %s default %s if %s" % (self.dest, value, self.cond) + def priority(self): + # Defaults are processed just before leaving the variable + return -1 + def process(self): + if not self.dest.has_value() and \ + (self.cond is None or self.cond.evaluate()): + self.dest.set_value(self.value) + class DependsOnClause(Clause): def __init__(self, dest, expr): KconfigData.Clause.__init__(self, dest) self.expr = expr + self.expr.add_edges_to(self.dest) def __str__(self): return "config %s depends on %s" % (self.dest, self.expr) + def process(self): + if not self.expr.evaluate(): + self.dest.set_value(False) + class SelectClause(Clause): def __init__(self, dest, cond): KconfigData.Clause.__init__(self, dest) self.cond = cond + self.cond.add_edges_to(self.dest) def __str__(self): return "select %s if %s" % (self.dest, self.cond) + def process(self): + if self.cond.evaluate(): + self.dest.set_value(True) + def __init__(self): self.previously_included = [] self.incl_info = None
@@ -115,6 +194,50 @@ class KconfigData: undef = True return undef + def compute_config(self): + if self.check_undefined(): + raise Exception(parser, "there were undefined symbols") + return None + + debug_print("Input:") + for clause in self.clauses: + debug_print(clause) + + debug_print("\nDependency graph:") + for i in self.referenced_vars: + debug_print(i, "->", [str(x) for x in self.referenced_vars[i].outgoing]) + + # The reverse of the depth-first order is the topological sort + dfo = dict() + visited = set() + debug_print("\n") + def visit_fn(var): + debug_print(var, "has DFS number", len(dfo)) + dfo[var] = len(dfo) + + for name in self.referenced_vars: + v = self.referenced_vars[name] + v.dfs(visited, visit_fn) + + # Put higher DFS numbers and higher priorities first. This + # places the clauses in topological order and places defaults + # after assignments and dependencies. + self.clauses.sort(key=lambda x: (-dfo[x.dest], -x.priority())) + + debug_print("\nSorted clauses:") + for clause in self.clauses: + debug_print(clause) + clause.process() + + debug_print("") + values = dict() + for name in self.referenced_vars: + debug_print("Evaluating", name) + v = self.referenced_vars[name] + values[name] = v.evaluate() + + return values + # semantic actions ------------- def do_declaration(self, var):
@@ -188,9 +311,6 @@ class KconfigParser: data = KconfigData() parser = KconfigParser(data) parser.parse_file(fp) - if data.check_undefined(): - raise KconfigParserError(parser, "there were undefined symbols") - return data def __init__(self, data):
@@ -499,5 +619,4 @@ class KconfigParser: if __name__ == '__main__': fname = len(sys.argv) > 1 and sys.argv[1] or 'Kconfig.test' data = KconfigParser.parse(open(fname, 'r')) - for i in data.clauses: - print i + print data.compute_config()
Signature · 1 line
2.17.1
RFC PATCH v3 24/43 hw/display: make edid configurable
In reply to Yang ZhongUse CONFIG_EDID to make edid-generate.c and edid-region.c configurable.
--- default-configs/pci.mak | 1 + hw/display/Makefile.objs | 4 +--- 2 files changed, 2 insertions(+), 3 deletions(-)
default-configs/pci.mak +1 -0
@@ -47,3 +47,4 @@ CONFIG_VGA_PCI=y CONFIG_BOCHS_DISPLAY=y CONFIG_IVSHMEM_DEVICE=$(CONFIG_IVSHMEM) CONFIG_ROCKER=y +CONFIG_EDID=y
hw/display/Makefile.objs +1 -3
@@ -1,4 +1,4 @@ -common-obj-y += edid-generate.o +common-obj-$(CONFIG_EDID) += edid-generate.o edid-region.o common-obj-$(CONFIG_FW_CFG_DMA) += ramfb.o common-obj-$(CONFIG_FW_CFG_DMA) += ramfb-standalone.o
@@ -15,12 +15,10 @@ common-obj-$(CONFIG_SSD0323) += ssd0323.o common-obj-$(CONFIG_XEN) += xenfb.o common-obj-$(CONFIG_VGA_PCI) += vga-pci.o -common-obj-$(CONFIG_VGA_PCI) += edid-region.o common-obj-$(CONFIG_VGA_ISA) += vga-isa.o common-obj-$(CONFIG_VGA_ISA_MM) += vga-isa-mm.o common-obj-$(CONFIG_VMWARE_VGA) += vmware_vga.o common-obj-$(CONFIG_BOCHS_DISPLAY) += bochs-display.o -common-obj-$(CONFIG_BOCHS_DISPLAY) += edid-region.o common-obj-$(CONFIG_BLIZZARD) += blizzard.o common-obj-$(CONFIG_EXYNOS4) += exynos4210_fimd.o
Signature · 1 line
2.17.1
RFC PATCH v3 25/43 kconfig: introduce kconfig files
In reply to Yang ZhongFrom: Paolo Bonzini <[email protected]>
The Kconfig files were generated mostly with this script:
for i in grep -ho CONFIG_[A-Z0-9_]* default-configs/* | sort -u; do
set fnord git grep -lw $i -- 'hw/*/Makefile.objs' shift
if test $# = 1; then
cat >> $(dirname $1)/Kconfig << EOF
config ${i#CONFIG_}
bool
EOF
git add $(dirname $1)/Kconfig
else
echo $i $*
fi done
sed -i '$d' hw/*/Kconfig
for i in hw/*; do
if test -d $i && ! test -f $i/Kconfig; then
touch $i/Kconfig
git add $i/Kconfig
fi
done
Whenever a symbol is referenced from multiple subdirectories, the script prints the list of directories that reference the symbol. These symbols have to be added manually to the Kconfig files.
Kconfig.host and hw/Kconfig were created manually.
--- Kconfig.host | 17 +++++++ hw/9pfs/Kconfig | 2 + hw/Kconfig | 67 +++++++++++++++++++++++++ hw/acpi/Kconfig | 23 +++++++++ hw/adc/Kconfig | 2 + hw/alpha/Kconfig | 5 ++ hw/arm/Kconfig | 113 ++++++++++++++++++++++++++++++++++++++++++ hw/audio/Kconfig | 35 +++++++++++++ hw/block/Kconfig | 29 +++++++++++ hw/bt/Kconfig | 2 + hw/char/Kconfig | 32 ++++++++++++ hw/core/Kconfig | 11 ++++ hw/cpu/Kconfig | 8 +++ hw/cris/Kconfig | 2 + hw/display/Kconfig | 77 ++++++++++++++++++++++++++++ hw/dma/Kconfig | 20 ++++++++ hw/gpio/Kconfig | 8 +++ hw/hppa/Kconfig | 5 ++ hw/hyperv/Kconfig | 5 ++ hw/i2c/Kconfig | 20 ++++++++ hw/i386/Kconfig | 23 +++++++++ hw/ide/Kconfig | 35 +++++++++++++ hw/input/Kconfig | 23 +++++++++ hw/intc/Kconfig | 47 ++++++++++++++++++ hw/ipack/Kconfig | 2 + hw/ipmi/Kconfig | 14 ++++++ hw/isa/Kconfig | 23 +++++++++ hw/lm32/Kconfig | 5 ++ hw/m68k/Kconfig | 8 +++ hw/mem/Kconfig | 8 +++ hw/microblaze/Kconfig | 8 +++ hw/mips/Kconfig | 20 ++++++++ hw/misc/Kconfig | 92 ++++++++++++++++++++++++++++++++++ hw/misc/macio/Kconfig | 11 ++++ hw/moxie/Kconfig | 2 + hw/net/Kconfig | 92 ++++++++++++++++++++++++++++++++++ hw/nios2/Kconfig | 5 ++ hw/nvram/Kconfig | 8 +++ hw/openrisc/Kconfig | 2 + hw/pci-bridge/Kconfig | 20 ++++++++ hw/pci-host/Kconfig | 35 +++++++++++++ hw/pci/Kconfig | 2 + hw/pcmcia/Kconfig | 2 + hw/ppc/Kconfig | 56 +++++++++++++++++++++ hw/riscv/Kconfig | 14 ++++++ hw/scsi/Kconfig | 26 ++++++++++ hw/sd/Kconfig | 11 ++++ hw/sh4/Kconfig | 11 ++++ hw/smbios/Kconfig | 2 + hw/sparc/Kconfig | 11 ++++ hw/sparc64/Kconfig | 5 ++ hw/ssi/Kconfig | 14 ++++++ hw/timer/Kconfig | 53 ++++++++++++++++++++ hw/tpm/Kconfig | 14 ++++++ hw/tricore/Kconfig | 2 + hw/unicore32/Kconfig | 2 + hw/usb/Kconfig | 53 ++++++++++++++++++++ hw/vfio/Kconfig | 11 ++++ hw/virtio/Kconfig | 17 +++++++ hw/watchdog/Kconfig | 11 ++++ hw/xtensa/Kconfig | 5 ++ 61 files changed, 1288 insertions(+) create mode 100644 Kconfig.host create mode 100644 hw/9pfs/Kconfig create mode 100644 hw/Kconfig create mode 100644 hw/acpi/Kconfig create mode 100644 hw/adc/Kconfig create mode 100644 hw/alpha/Kconfig create mode 100644 hw/arm/Kconfig create mode 100644 hw/audio/Kconfig create mode 100644 hw/block/Kconfig create mode 100644 hw/bt/Kconfig create mode 100644 hw/char/Kconfig create mode 100644 hw/core/Kconfig create mode 100644 hw/cpu/Kconfig create mode 100644 hw/cris/Kconfig create mode 100644 hw/display/Kconfig create mode 100644 hw/dma/Kconfig create mode 100644 hw/gpio/Kconfig create mode 100644 hw/hppa/Kconfig create mode 100644 hw/hyperv/Kconfig create mode 100644 hw/i2c/Kconfig create mode 100644 hw/i386/Kconfig create mode 100644 hw/ide/Kconfig create mode 100644 hw/input/Kconfig create mode 100644 hw/intc/Kconfig create mode 100644 hw/ipack/Kconfig create mode 100644 hw/ipmi/Kconfig create mode 100644 hw/isa/Kconfig create mode 100644 hw/lm32/Kconfig create mode 100644 hw/m68k/Kconfig create mode 100644 hw/mem/Kconfig create mode 100644 hw/microblaze/Kconfig create mode 100644 hw/mips/Kconfig create mode 100644 hw/misc/Kconfig create mode 100644 hw/misc/macio/Kconfig create mode 100644 hw/moxie/Kconfig create mode 100644 hw/net/Kconfig create mode 100644 hw/nios2/Kconfig create mode 100644 hw/nvram/Kconfig create mode 100644 hw/openrisc/Kconfig create mode 100644 hw/pci-bridge/Kconfig create mode 100644 hw/pci-host/Kconfig create mode 100644 hw/pci/Kconfig create mode 100644 hw/pcmcia/Kconfig create mode 100644 hw/ppc/Kconfig create mode 100644 hw/riscv/Kconfig create mode 100644 hw/scsi/Kconfig create mode 100644 hw/sd/Kconfig create mode 100644 hw/sh4/Kconfig create mode 100644 hw/smbios/Kconfig create mode 100644 hw/sparc/Kconfig create mode 100644 hw/sparc64/Kconfig create mode 100644 hw/ssi/Kconfig create mode 100644 hw/timer/Kconfig create mode 100644 hw/tpm/Kconfig create mode 100644 hw/tricore/Kconfig create mode 100644 hw/unicore32/Kconfig create mode 100644 hw/usb/Kconfig create mode 100644 hw/vfio/Kconfig create mode 100644 hw/virtio/Kconfig create mode 100644 hw/watchdog/Kconfig create mode 100644 hw/xtensa/Kconfig
Kconfig.host new file +17 -0
@@ -0,0 +1,17 @@ +# These are "proxy" symbols used to pass config-host.mak values +# down to Kconfig. + +config KVM + bool + +config OPENGL + bool + +config SPICE + bool + +config TPM + bool + +config XEN + bool
hw/9pfs/Kconfig new file +2 -0
@@ -0,0 +1,2 @@ +config VIRTIO_9P + bool
hw/Kconfig new file +67 -0
67 lines not on this page · raw message
hw/acpi/Kconfig new file +23 -0
@@ -0,0 +1,23 @@ +config ACPI + bool + +config ACPI_X86 + bool + +config ACPI_X86_ICH + bool + +config ACPI_CPU_HOTPLUG + bool + +config ACPI_MEMORY_HOTPLUG + bool + +config ACPI_NVDIMM + bool + +config ACPI_VMGENID + bool + +config IPMI + bool
hw/adc/Kconfig new file +2 -0
@@ -0,0 +1,2 @@ +config STM32F2XX_ADC + bool
hw/alpha/Kconfig new file +5 -0
@@ -0,0 +1,5 @@ +config DP264 + bool + +config TYPHOON + bool
hw/arm/Kconfig new file +113 -0
113 lines not on this page · raw message
hw/audio/Kconfig new file +35 -0
@@ -0,0 +1,35 @@ +config SB16 + bool + +config ES1370 + bool + +config AC97 + bool + +config ADLIB + bool + +config GUS + bool + +config CS4231A + bool + +config HDA + bool + +config PCSPK + bool + +config WM8750 + bool + +config PL041 + bool + +config CS4231 + bool + +config MARVELL_88W8618 + bool
hw/block/Kconfig new file +29 -0
@@ -0,0 +1,29 @@ +config FDC + bool + +config SSI_M25P80 + bool + +config NAND + bool + +config PFLASH_CFI01 + bool + +config PFLASH_CFI02 + bool + +config ECC + bool + +config ONENAND + bool + +config NVME_PCI + bool + +config VIRTIO_BLK + bool + +config VHOST_USER_BLK + bool
hw/bt/Kconfig new file +2 -0
@@ -0,0 +1,2 @@ +config BLUETOOTH + bool
hw/char/Kconfig new file +32 -0
@@ -0,0 +1,32 @@ +config ESCC + bool + +config PARALLEL + bool + +config PL011 + bool + +config SERIAL + bool + +config SERIAL_ISA + bool + +config SERIAL_PCI + bool + +config VIRTIO_SERIAL + bool + +config STM32F2XX_USART + bool + +config CMSDK_APB_UART + bool + +config SCLPCONSOLE + bool + +config TERMINAL3270 + bool
hw/core/Kconfig new file +11 -0
@@ -0,0 +1,11 @@ +config EMPTY_SLOT + bool + +config PTIMER + bool + +config FITLOADER + bool + +config PLATFORM_BUS + bool
hw/cpu/Kconfig new file +8 -0
@@ -0,0 +1,8 @@ +config ARM11MPCORE + bool + +config A9MPCORE + bool + +config A15MPCORE + bool
hw/cris/Kconfig new file +2 -0
@@ -0,0 +1,2 @@ +config AXIS + bool
hw/display/Kconfig new file +77 -0
77 lines not on this page · raw message
hw/dma/Kconfig new file +20 -0
@@ -0,0 +1,20 @@ +config RC4030 + bool + +config PL080 + bool + +config PL330 + bool + +config I82374 + bool + +config I8257 + bool + +config ZYNQ_DEVCFG + bool + +config STP2000 + bool
hw/gpio/Kconfig new file +8 -0
@@ -0,0 +1,8 @@ +config MAX7310 + bool + +config PL061 + bool + +config GPIO_KEY + bool
hw/hppa/Kconfig new file +5 -0
@@ -0,0 +1,5 @@ +config HPPA + bool + +config DINO + bool
hw/hyperv/Kconfig new file +5 -0
@@ -0,0 +1,5 @@ +config HYPERV + bool + +config HYPERV_TESTDEV + bool
hw/i2c/Kconfig new file +20 -0
@@ -0,0 +1,20 @@ +config I2C + bool + +config SMBUS_EEPROM + bool + +config DDC + bool + +config VERSATILE_I2C + bool + +config ACPI_SMBUS + bool + +config BITBANG_I2C + bool + +config IMX_I2C + bool
hw/i386/Kconfig new file +23 -0
@@ -0,0 +1,23 @@ +config KVM + bool + +config I440FX + bool + +config ISAPC + bool + +config Q35 + bool + +config VTD + bool + +config AMD_IOMMU + bool + +config VMPORT + bool + +config VMMOUSE + bool
hw/ide/Kconfig new file +35 -0
@@ -0,0 +1,35 @@ +config IDE_CORE + bool + +config IDE_QDEV + bool + +config IDE_PCI + bool + +config IDE_ISA + bool + +config IDE_PIIX + bool + +config IDE_CMD646 + bool + +config IDE_MACIO + bool + +config IDE_MMIO + bool + +config IDE_VIA + bool + +config MICRODRIVE + bool + +config AHCI + bool + +config IDE_SII3112 + bool
hw/input/Kconfig new file +23 -0
@@ -0,0 +1,23 @@ +config ADB + bool + +config LM832X + bool + +config PCKBD + bool + +config PL050 + bool + +config STELLARIS_INPUT + bool + +config TSC2005 + bool + +config VIRTIO_INPUT + bool + +config TSC210X + bool
hw/intc/Kconfig new file +47 -0
47 lines not on this page · raw message
hw/ipack/Kconfig new file +2 -0
@@ -0,0 +1,2 @@ +config IPACK + bool
hw/ipmi/Kconfig new file +14 -0
@@ -0,0 +1,14 @@ +config IPMI + bool + +config IPMI_LOCAL + bool + +config IPMI_EXTERN + bool + +config ISA_IPMI_KCS + bool + +config ISA_IPMI_BT + bool
hw/isa/Kconfig new file +23 -0
@@ -0,0 +1,23 @@ +config ISA_BUS + bool + +config APM + bool + +config I82378 + bool + +config PC87312 + bool + +config PIIX4 + bool + +config VT82C686 + bool + +config SMC37C669 + bool + +config LPC_ICH9 + bool
hw/lm32/Kconfig new file +5 -0
@@ -0,0 +1,5 @@ +config LM32 + bool + +config MILKYMIST + bool
hw/m68k/Kconfig new file +8 -0
@@ -0,0 +1,8 @@ +config AN5206 + bool + +config MCF5206 + bool + +config MCF5208 + bool
hw/mem/Kconfig new file +8 -0
@@ -0,0 +1,8 @@ +config DIMM + bool + +config MEM_DEVICE + bool + +config NVDIMM + bool
hw/microblaze/Kconfig new file +8 -0
@@ -0,0 +1,8 @@ +config PETALOGIX_S3ADSP1800 + bool + +config PETALOGIX_ML605 + bool + +config XLNX_ZYNQMP_PMU + bool
hw/mips/Kconfig new file +20 -0
@@ -0,0 +1,20 @@ +config R4K + bool + +config MALTA + bool + +config MIPSSIM + bool + +config JAZZ + bool + +config FULONG + bool + +config MIPS_CPS + bool + +config MIPS_BOSTON + bool
hw/misc/Kconfig new file +92 -0
92 lines not on this page · raw message
hw/misc/macio/Kconfig new file +11 -0
@@ -0,0 +1,11 @@ +config CUDA + bool + +config MAC_PMU + bool + +config MAC_DBDMA + bool + +config MACIO_GPIO + bool
hw/moxie/Kconfig new file +2 -0
@@ -0,0 +1,2 @@ +config MOXIE + bool
hw/net/Kconfig new file +92 -0
92 lines not on this page · raw message
hw/nios2/Kconfig new file +5 -0
@@ -0,0 +1,5 @@ +config NIOS2_10M50 + bool + +config NIOS2 + bool
hw/nvram/Kconfig new file +8 -0
@@ -0,0 +1,8 @@ +config DS1225Y + bool + +config AT24C + bool + +config MAC_NVRAM + bool
hw/openrisc/Kconfig new file +2 -0
@@ -0,0 +1,2 @@ +config OPENRISC + bool
hw/pci-bridge/Kconfig new file +20 -0
@@ -0,0 +1,20 @@ +config PCIE_PORT + bool + +config PXB + bool + +config XIO3130 + bool + +config IOH3420 + bool + +config I82801B11 + bool + +config DEC_PCI + bool + +config SIMBA + bool
hw/pci-host/Kconfig new file +35 -0
@@ -0,0 +1,35 @@ +config PAM + bool + +config PREP_PCI + bool + +config GRACKLE_PCI + bool + +config UNIN_PCI + bool + +config PPCE500_PCI + bool + +config VERSATILE_PCI + bool + +config PCI_SABRE + bool + +config PCI_PIIX + bool + +config PCI_Q35 + bool + +config PCI_GENERIC + bool + +config PCI_XILINX + bool + +config PCI_DESIGNWARE + bool
hw/pci/Kconfig new file +2 -0
@@ -0,0 +1,2 @@ +config PCI + bool
hw/pcmcia/Kconfig new file +2 -0
@@ -0,0 +1,2 @@ +config PCMCIA + bool
hw/ppc/Kconfig new file +56 -0
56 lines not on this page · raw message
hw/riscv/Kconfig new file +14 -0
@@ -0,0 +1,14 @@ +config HTIF + bool + +config HART + bool + +config SIFIVE + bool + +config SPIKE + bool + +config RISCV_VIRTIO + bool
hw/scsi/Kconfig new file +26 -0
@@ -0,0 +1,26 @@ +config SCSI + bool + +config LSI_SCSI_PCI + bool + +config MPTSAS_SCSI_PCI + bool + +config MEGASAS_SCSI_PCI + bool + +config VMW_PVSCSI_SCSI_PCI + bool + +config ESP + bool + +config ESP_PCI + bool + +config VIRTIO_SCSI + bool + +config VHOST_USER_SCSI + bool
hw/sd/Kconfig new file +11 -0
@@ -0,0 +1,11 @@ +config PL181 + bool + +config SSI_SD + bool + +config SD + bool + +config SDHCI + bool
hw/sh4/Kconfig new file +11 -0
@@ -0,0 +1,11 @@ +config R2D + bool + +config SHIX + bool + +config SH7750 + bool + +config SH4 + bool
hw/smbios/Kconfig new file +2 -0
@@ -0,0 +1,2 @@ +config SMBIOS + bool
hw/sparc/Kconfig new file +11 -0
@@ -0,0 +1,11 @@ +config SUN4M + bool + +config LEON3 + bool + +config GRLIB + bool + +config SLAVIO + bool
hw/sparc64/Kconfig new file +5 -0
@@ -0,0 +1,5 @@ +config SUN4U + bool + +config NIAGARA + bool
hw/ssi/Kconfig new file +14 -0
@@ -0,0 +1,14 @@ +config PL022 + bool + +config SSI + bool + +config XILINX_SPI + bool + +config XILINX_SPIPS + bool + +config STM32F2XX_SPI + bool
hw/timer/Kconfig new file +53 -0
53 lines not on this page · raw message
hw/tpm/Kconfig new file +14 -0
@@ -0,0 +1,14 @@ +config TPM + bool + +config TPM_TIS + bool + +config TPM_CRB + bool + +config TPM_PASSTHROUGH + bool + +config TPM_EMULATOR + bool
hw/tricore/Kconfig new file +2 -0
@@ -0,0 +1,2 @@ +config TRICORE + bool
hw/unicore32/Kconfig new file +2 -0
@@ -0,0 +1,2 @@ +config PUV3 + bool
hw/usb/Kconfig new file +53 -0
53 lines not on this page · raw message
hw/vfio/Kconfig new file +11 -0
@@ -0,0 +1,11 @@ +config VFIO_CCW + bool + +config VFIO_XGMAC + bool + +config VFIO_AMD_XGBE + bool + +config VFIO_AP + bool
hw/virtio/Kconfig new file +17 -0
@@ -0,0 +1,17 @@ +config VIRTIO + bool + +config VIRTIO_RNG + bool + +config VIRTIO_PCI + bool + +config VIRTIO_MMIO + bool + +config VIRTIO_BALLOON + bool + +config VIRTIO_CRYPTO + bool
hw/watchdog/Kconfig new file +11 -0
@@ -0,0 +1,11 @@ +config CMSDK_APB_WATCHDOG + bool + +config WDT_IB6300ESB + bool + +config WDT_IB700 + bool + +config WDT_DIAG288 + bool
hw/xtensa/Kconfig new file +5 -0
@@ -0,0 +1,5 @@ +config XTENSA_SIM + bool + +config XTENSA_FPGA + bool
Signature · 1 line
2.17.1
RFC PATCH v3 26/43 build: switch to Kconfig
In reply to Yang ZhongFrom: Paolo Bonzini <[email protected]>
The make_device_config.sh script is replaced by minikconf, which is modified to support the same command line as its predecessor.
The roots of the parsing are default-configs/*.mak, Kconfig.host and hw/Kconfig. One difference with make_device_config.sh is that all symbols have to be defined in a Kconfig file, including those coming from the configure script. This is the reason for the Kconfig.host file introduced in the previous patch. Whenever a file in default-configs/*.mak used $(...) to refer to a config-host.mak symbol, this is replaced by a Kconfig dependency.
--- Kconfig.host | 3 ++- Makefile | 14 +++++++++++-- Makefile.target | 7 ++++++- default-configs/i386-softmmu.mak | 3 --- hw/display/Kconfig | 2 ++ hw/i386/Kconfig | 6 ++++++ hw/intc/Kconfig | 8 ++++++++ hw/misc/Kconfig | 2 ++ hw/tpm/Kconfig | 1 + rules.mak | 2 +- scripts/make_device_config.sh | 30 --------------------------- scripts/minikconf.py | 35 +++++++++++++++++++++++++++++--- 12 files changed, 72 insertions(+), 41 deletions(-) delete mode 100644 scripts/make_device_config.sh
Kconfig.host +2 -1
@@ -1,5 +1,6 @@ # These are "proxy" symbols used to pass config-host.mak values -# down to Kconfig. +# down to Kconfig. See also MINIKCONF_ARGS in the Makefile: +# these two need to be kept in sync. config KVM bool
Makefile +12 -2
@@ -326,9 +326,19 @@ endif -include $(SUBDIR_DEVICES_MAK_DEP) -%/config-devices.mak: default-configs/%.mak $(SRC_PATH)/scripts/make_device_config.sh +# This has to be kept in sync with Kconfig.host. +MINIKCONF_ARGS = \ + CONFIG_KVM=$(CONFIG_KVM) \ + CONFIG_SPICE=$(CONFIG_SPICE) \ + CONFIG_TPM=$(CONFIG_TPM) \ + CONFIG_XEN=$(CONFIG_XEN) \ + CONFIG_OPENGL=$(CONFIG_OPENGL) + +MINIKCONF = $(SHELL) $(SRC_PATH)/scripts/minikconf.sh + +%/config-devices.mak: default-configs/%-softmmu.mak Kconfig.host hw/Kconfig $(call quiet-command, \ - $(SHELL) $(SRC_PATH)/scripts/make_device_config.sh $< $*-config-devices.mak.d $@ > [email protected],"GEN","[email protected]") + $(MINIKCONF) $@ $*-config-devices.mak.d $^ $(MINIKCONF_ARGS) > [email protected], " GEN [email protected]") $(call quiet-command, if test -f $@; then \ if cmp -s [email protected] $@; then \ mv [email protected] $@; \
Makefile.target +6 -1
@@ -4,9 +4,12 @@ BUILD_DIR?=$(CURDIR)/.. include ../config-host.mak include config-target.mak -include config-devices.mak include $(SRC_PATH)/rules.mak +ifdef CONFIG_SOFTMMU +include config-devices.mak +endif + $(call set-vpath, $(SRC_PATH):$(BUILD_DIR)) ifdef CONFIG_LINUX QEMU_CFLAGS += -I../linux-headers
@@ -187,7 +190,9 @@ all-obj-$(CONFIG_USER_ONLY) += $(crypto-aes-obj-y) all-obj-$(CONFIG_SOFTMMU) += $(crypto-obj-y) all-obj-$(CONFIG_SOFTMMU) += $(io-obj-y) +ifdef CONFIG_SOFTMMU $(QEMU_PROG_BUILD): config-devices.mak +endif COMMON_LDADDS = ../libqemuutil.a
default-configs/i386-softmmu.mak +0 -3
@@ -4,7 +4,6 @@ include pci.mak include sound.mak include usb.mak include hyperv.mak -CONFIG_QXL=$(CONFIG_SPICE) CONFIG_VGA_ISA=y CONFIG_VGA_CIRRUS=y CONFIG_VMWARE_VGA=y
@@ -37,8 +36,6 @@ CONFIG_HPET=y CONFIG_APPLESMC=y CONFIG_I8259=y CONFIG_PFLASH_CFI01=y -CONFIG_TPM_TIS=$(CONFIG_TPM) -CONFIG_TPM_CRB=$(CONFIG_TPM) CONFIG_MC146818RTC=y CONFIG_PCI_PIIX=y CONFIG_WDT_IB700=y
hw/display/Kconfig +2 -0
@@ -51,6 +51,7 @@ config FRAMEBUFFER config MILKYMIST_TMU2 bool + depends on OPENGL config SM501 bool
@@ -66,6 +67,7 @@ config VGA config QXL bool + depends on SPICE config VIRTIO_GPU bool
hw/i386/Kconfig +6 -0
@@ -3,12 +3,18 @@ config KVM config I440FX bool + select QXL if SPICE + select TPM_TIS if TPM + select XEN_I386 if XEN config ISAPC bool config Q35 bool + select QXL if SPICE + select TPM_TIS if TPM + select XEN_I386 if XEN config VTD bool
hw/intc/Kconfig +8 -0
@@ -21,9 +21,13 @@ config APIC config ARM_GIC_KVM bool + default y + depends on ARM_GIC && KVM config OPENPIC_KVM bool + default y + depends on OPENPIC && KVM config XICS bool
@@ -33,6 +37,8 @@ config XICS_SPAPR config XICS_KVM bool + default y + depends on XICS && KVM config ALLWINNER_A10_PIC bool
@@ -42,6 +48,8 @@ config S390_FLIC config S390_FLIC_KVM bool + default y + depends on S390_FLIC && KVM config OMPIC bool
hw/misc/Kconfig +2 -0
@@ -48,6 +48,8 @@ config MACIO config IVSHMEM_DEVICE bool + default y + depends on PCI config ECCMEMCTL bool
hw/tpm/Kconfig +1 -0
@@ -3,6 +3,7 @@ config TPM config TPM_TIS bool + depends on TPM config TPM_CRB bool
rules.mak +1 -1
@@ -144,7 +144,7 @@ cc-option = $(if $(shell $(CC) $1 $2 -S -o /dev/null -xc /dev/null \ cc-c-option = $(if $(shell $(CC) $1 $2 -c -o /dev/null -xc /dev/null \ >/dev/null 2>&1 && echo OK), $2, $3) -VPATH_SUFFIXES = %.c %.h %.S %.cc %.cpp %.m %.mak %.texi %.sh %.rc +VPATH_SUFFIXES = %.c %.h %.S %.cc %.cpp %.m %.mak %.texi %.sh %.rc Kconfig% set-vpath = $(if $1,$(foreach PATTERN,$(VPATH_SUFFIXES),$(eval vpath $(PATTERN) $1))) # install-prog list, dir
scripts/make_device_config.sh deleted +0 -30
@@ -1,30 +0,0 @@ -#! /bin/sh -# Writes a target device config file to stdout, from a default and from -# include directives therein. Also emits Makefile dependencies. -# -# Usage: make_device_config.sh SRC DEPFILE-NAME DEPFILE-TARGET > DEST - -src=$1 -dep=$2 -target=$3 -src_dir=$(dirname $src) -all_includes= - -process_includes () { - cat $1 | grep '^include' | \ - while read include file ; do - all_includes="$all_includes $src_dir/$file" - process_includes $src_dir/$file - done -} - -f=$src -while [ -n "$f" ] ; do - f=$(cat $f | tr -d '\r' | awk '/^include / {printf "'$src_dir'/%s ", $2}') - [ $? = 0 ] || exit 1 - all_includes="$all_includes $f" -done -process_includes $src - -cat $src $all_includes | grep -v '^include' -echo "$target: $all_includes" > $dep
scripts/minikconf.py +32 -3
@@ -12,6 +12,7 @@ import os import sys +import re __all__ = [ 'KconfigParserError', 'KconfigData', 'KconfigParser' ]
@@ -329,6 +330,12 @@ class KconfigParser: self.get_token() self.parse_config() + def do_assignment(self, var, val): + if not var.startswith("CONFIG_"): + raise Error('assigned variable should start with CONFIG_') + var = self.data.do_var(var[7:]) + self.data.do_assignment(var, val) + # file management ----- def error_path(self):
@@ -617,6 +624,28 @@ class KconfigParser: return None if __name__ == '__main__': - fname = len(sys.argv) > 1 and sys.argv[1] or 'Kconfig.test' - data = KconfigParser.parse(open(fname, 'r')) - print data.compute_config() + argv = sys.argv + if len(argv) == 1: + print >>sys.stderr, "%s: at least one argument is required" % argv[0] + os.exit(1) + + data = KconfigData() + parser = KconfigParser(data) + for arg in argv[3:]: + m = re.match(r'^(CONFIG_[A-Z0-9_]+)=([yn]?)$', arg) + if m is not None: + name, value = m.groups() + parser.do_assignment(name, value == 'y') + else: + fp = open(arg, 'r') + parser.parse_file(fp) + fp.close() + + config = data.compute_config() + for key in sorted(config.keys()): + print 'CONFIG_%s=%s'% (key, (config[key] and 'y' or 'n')) + + deps = open(argv[2], 'w') + for fname in data.previously_included: + print >>deps, '%s: %s' % (argv[1], fname) + deps.close()
Signature · 1 line
2.17.1
RFC PATCH v3 27/43 ide: express dependencies with Kconfig
In reply to Yang ZhongFrom: Paolo Bonzini <[email protected]>
--- default-configs/alpha-softmmu.mak | 2 -- default-configs/pci.mak | 3 --- hw/ide/Kconfig | 15 +++++++++++++++ 3 files changed, 15 insertions(+), 5 deletions(-)
default-configs/alpha-softmmu.mak +0 -2
@@ -11,8 +11,6 @@ CONFIG_PARALLEL=y CONFIG_FDC=y CONFIG_PCKBD=y CONFIG_VGA_CIRRUS=y -CONFIG_IDE_CORE=y -CONFIG_IDE_QDEV=y CONFIG_VMWARE_VGA=y CONFIG_IDE_CMD646=y CONFIG_I8259=y
default-configs/pci.mak +0 -3
@@ -23,9 +23,6 @@ CONFIG_MPTSAS_SCSI_PCI=y CONFIG_RTL8139_PCI=y CONFIG_E1000_PCI=y CONFIG_E1000E_PCI=y -CONFIG_IDE_CORE=y -CONFIG_IDE_QDEV=y -CONFIG_IDE_PCI=y CONFIG_AHCI=y CONFIG_ESP=y CONFIG_ESP_PCI=y
hw/ide/Kconfig +15 -0
@@ -3,33 +3,48 @@ config IDE_CORE config IDE_QDEV bool + select IDE_CORE config IDE_PCI bool + select IDE_CORE config IDE_ISA bool + select IDE_QDEV config IDE_PIIX bool + select IDE_PCI + select IDE_QDEV config IDE_CMD646 bool + select IDE_PCI + select IDE_QDEV config IDE_MACIO bool + select IDE_QDEV config IDE_MMIO bool + select IDE_QDEV config IDE_VIA bool + select IDE_PCI + select IDE_QDEV config MICRODRIVE bool + select IDE_QDEV config AHCI bool + select IDE_QDEV config IDE_SII3112 bool + select IDE_PCI + select IDE_QDEV
Signature · 1 line
2.17.1
RFC PATCH v3 28/43 hw/pci/Makefile.objs: make pcie configurable
In reply to Yang ZhongMake pcie splited from pci and make it configurable.
--- default-configs/pci.mak | 1 + hw/pci/Kconfig | 3 +++ hw/pci/Makefile.objs | 5 +++-- 3 files changed, 7 insertions(+), 2 deletions(-)
default-configs/pci.mak +1 -0
@@ -1,4 +1,5 @@ CONFIG_PCI=y +CONFIG_PCIE=y # For now, CONFIG_IDE_CORE requires ISA, so we enable it here CONFIG_ISA_BUS=y CONFIG_VIRTIO_PCI=y
hw/pci/Kconfig +3 -0
@@ -1,2 +1,5 @@ config PCI bool + +config PCIE + bool
hw/pci/Makefile.objs +3 -2
@@ -2,8 +2,9 @@ common-obj-$(CONFIG_PCI) += pci.o pci_bridge.o common-obj-$(CONFIG_PCI) += msix.o msi.o common-obj-$(CONFIG_PCI) += shpc.o common-obj-$(CONFIG_PCI) += slotid_cap.o -common-obj-$(CONFIG_PCI) += pci_host.o pcie_host.o -common-obj-$(CONFIG_PCI) += pcie.o pcie_aer.o pcie_port.o +common-obj-$(CONFIG_PCI) += pci_host.o +common-obj-$(CONFIG_PCIE) += pcie.o pcie_aer.o +common-obj-$(CONFIG_PCIE) += pcie_port.o pcie_host.o common-obj-$(call lnot,$(CONFIG_PCI)) += pci-stub.o common-obj-$(CONFIG_ALL) += pci-stub.o
Signature · 1 line
2.17.1
Re: [Qemu-devel] [RFC PATCH v3 28/43] hw/pci/Makefile.objs: make pcie configurable
Quoted 29 lines · Yang Zhong
Make pcie splited from pci and make it configurable.
Signed-off-by Yang Zhong <[email protected]>Reviewed-by Thomas Huth <[email protected]>--- default-configs/pci.mak | 1 + hw/pci/Kconfig | 3 +++ hw/pci/Makefile.objs | 5 +++-- 3 files changed, 7 insertions(+), 2 deletions(-)default-configs/pci.mak +1
-0@@ -1,4 +1,5 @@ CONFIG_PCI=y +CONFIG_PCIE=y # For now, CONFIG_IDE_CORE requires ISA, so we enable it here CONFIG_ISA_BUS=y CONFIG_VIRTIO_PCI=yhw/pci/Kconfig +0
-0
hw/pci/Kconfig line 5
Quoted 5 lines
hw/pci/Kconfig +3
-0@@ -1,2 +1,5 @@ config PCI bool + +config PCIE + bool
I think PCIE should depend on PCI or something like this. That's because there are places in code that test CONFIG_PCI, you want PCIE to enable them as well.
Quoted 19 lines
hw/pci/Makefile.objs +3
-2@@ -2,8 +2,9 @@ common-obj-$(CONFIG_PCI) += pci.o pci_bridge.o common-obj-$(CONFIG_PCI) += msix.o msi.o common-obj-$(CONFIG_PCI) += shpc.o common-obj-$(CONFIG_PCI) += slotid_cap.o -common-obj-$(CONFIG_PCI) += pci_host.o pcie_host.o -common-obj-$(CONFIG_PCI) += pcie.o pcie_aer.o pcie_port.o +common-obj-$(CONFIG_PCI) += pci_host.o +common-obj-$(CONFIG_PCIE) += pcie.o pcie_aer.o +common-obj-$(CONFIG_PCIE) += pcie_port.o pcie_host.o common-obj-$(call lnot,$(CONFIG_PCI)) += pci-stub.o common-obj-$(CONFIG_ALL) += pci-stub.oSignature · 1 line
2.17.1
Re: [Qemu-devel] [RFC PATCH v3 28/43] hw/pci/Makefile.objs: make pcie configurable
Quoted 7 lines
I think PCIE should depend on PCI or something like this. That's because there are places in code that test
CONFIG_PCI, you want PCIE to enable them as well.
I agree, it should select PCI, so that PCIe bridges only need to select PCIE (the model in QEMU is that you enable boards and pluggable devices; everything else, especially buses, is then selected automatically based on whether any controllers/bridges are enabled for those buses).
Paolo
Quoted 1 line
Re: [Qemu-devel] [RFC PATCH v3 28/43] hw/pci/Makefile.objs: make pcie configurable
Quoted 7 lines · Paolo Bonzini
I think PCIE should depend on PCI or something like this. That's because there are places in code that test
CONFIG_PCI, you want PCIE to enable them as well.
Quoted 7 lines
I agree, it should select PCI, so that PCIe bridges only need to select PCIE (the model in QEMU is that you enable boards and pluggable devices; everything else, especially buses, is then selected automatically based on whether any controllers/bridges are enabled for those buses).
Paolo
OK, and I also think we should rename it PCIE -> PCI_EXPRESS_, this way everything PCI starts with PCI.
Signature · 1 line
MST
Re: [Qemu-devel] [RFC PATCH v3 28/43] hw/pci/Makefile.objs: make pcie configurable
Quoted 2 lines · Michael S. Tsirkin
OK, and I also think we should rename it PCIE ->
PCI_EXPRESS_, this way everything PCI starts with PCI.
I have no preference for PCIE vs. PCI_EXPRESS (PCIE is universally known and shorter, but it's okay either way), but I agree it makes sense to rename everything that selects PCIE so that it starts with either PCIE or PCI_EXPRESS. Yang, can you place a patch to do that before your series to do the rename?
Thanks,
Paolo
Re: [Qemu-devel] [RFC PATCH v3 28/43] hw/pci/Makefile.objs: make pcie configurable
Quoted 10 lines · Paolo Bonzini
Quoted 2 lines · Michael S. Tsirkin
OK, and I also think we should rename it PCIE ->
PCI_EXPRESS_, this way everything PCI starts with PCI.I have no preference for PCIE vs.
PCI_EXPRESS(PCIE is universally known and shorter, but it's okay either way), but I agree it makes sense to rename everything that selects PCIE so that it starts with either PCIE orPCI_EXPRESS. Yang, can you place a patch to do that before your series to do the rename?
Hello Paolo,
Yes, i can change PCIE to PCI_EXPRESS per Michael's comments. How can i share this patch ?, or i will send this patches with another changes(patch 41) in v4 ? thanks!
Regards,
Yang
Quoted 3 lines
Thanks,
Paolo
Re: [Qemu-devel] [RFC PATCH v3 28/43] hw/pci/Makefile.objs: make pcie configurable
Quoted 11 lines · Yang Zhong
Quoted 10 lines · Paolo Bonzini
Quoted 2 lines · Michael S. Tsirkin
OK, and I also think we should rename it PCIE ->
PCI_EXPRESS_, this way everything PCI starts with PCI.I have no preference for PCIE vs.
PCI_EXPRESS(PCIE is universally known and shorter, but it's okay either way), but I agree it makes sense to rename everything that selects PCIE so that it starts with either PCIE orPCI_EXPRESS. Yang, can you place a patch to do that before your series to do the rename?
Quoted 4 lines
Hello Paolo,
Yes, i can change PCIE to
PCI_EXPRESSper Michael's comments. How can i share this patch ?, or i will send this patches with another changes(patch 41) in v4 ? thanks!
You can place it as patch 1 in v4.
Paolo
RFC PATCH v3 29/43 build: convert pci.mak to Kconfig
In reply to Yang ZhongFrom: Paolo Bonzini <[email protected]>
Instead of including the same list of devices for each target, set CONFIG_PCI to true, and make the devices default to present whenever PCI is available.
Done mostly with the following script:
while read i; do
i=${i%=y}; i=${i#CONFIG_}
sed -i -e'/^config '$i'$/!b' -en \
-e'a\' -e' default y\' -e' depends on PCI' \
`grep -lw $i hw/*/Kconfig`
done < default-configs/pci.makfollowed by replacing a few "depends on" clauses with "select" whenever the symbol is not really related to PCI.
--- default-configs/alpha-softmmu.mak | 2 +- default-configs/arm-softmmu.mak | 2 +- default-configs/hppa-softmmu.mak | 2 +- default-configs/i386-softmmu.mak | 4 +-- default-configs/mips-softmmu-common.mak | 2 +- default-configs/pci.mak | 48 ------------------------- default-configs/ppc-softmmu.mak | 2 +- default-configs/riscv32-softmmu.mak | 3 +- default-configs/riscv64-softmmu.mak | 3 +- default-configs/sh4-softmmu.mak | 2 +- default-configs/sh4eb-softmmu.mak | 2 +- default-configs/sparc64-softmmu.mak | 2 +- hw/audio/Kconfig | 6 ++++ hw/block/Kconfig | 2 ++ hw/char/Kconfig | 2 ++ hw/display/Kconfig | 15 +++++++- hw/ide/Kconfig | 3 ++ hw/ipack/Kconfig | 2 ++ hw/misc/Kconfig | 4 +++ hw/net/Kconfig | 23 ++++++++++++ hw/pci-bridge/Kconfig | 4 +++ hw/pci-host/Kconfig | 4 +++ hw/scsi/Kconfig | 11 ++++++ hw/sd/Kconfig | 3 ++ hw/usb/Kconfig | 10 ++++++ hw/virtio/Kconfig | 3 ++ hw/watchdog/Kconfig | 2 ++ 27 files changed, 104 insertions(+), 64 deletions(-) delete mode 100644 default-configs/pci.mak
default-configs/alpha-softmmu.mak +1 -1
@@ -1,7 +1,7 @@ # Default configuration for alpha-softmmu -include pci.mak include usb.mak +CONFIG_PCI=y CONFIG_SERIAL=y CONFIG_SERIAL_ISA=y CONFIG_I82374=y
default-configs/arm-softmmu.mak +1 -1
@@ -1,7 +1,7 @@ # Default configuration for arm-softmmu -include pci.mak include usb.mak +CONFIG_PCI=y CONFIG_VGA=y CONFIG_NAND=y CONFIG_ECC=y
default-configs/hppa-softmmu.mak +1 -1
@@ -1,5 +1,5 @@ -include pci.mak include usb.mak +CONFIG_PCI=y CONFIG_SERIAL=y CONFIG_SERIAL_ISA=y CONFIG_ISA_BUS=y
default-configs/i386-softmmu.mak +1 -3
@@ -1,11 +1,10 @@ # Default configuration for i386-softmmu -include pci.mak +CONFIG_PCI=y include sound.mak include usb.mak include hyperv.mak CONFIG_VGA_ISA=y -CONFIG_VGA_CIRRUS=y CONFIG_VMWARE_VGA=y CONFIG_VMXNET3_PCI=y CONFIG_VIRTIO_VGA=y
@@ -52,7 +51,6 @@ CONFIG_MEM_DEVICE=y CONFIG_DIMM=y CONFIG_NVDIMM=y CONFIG_ACPI_NVDIMM=y -CONFIG_PCIE_PORT=y CONFIG_XIO3130=y CONFIG_IOH3420=y CONFIG_I82801B11=y
default-configs/mips-softmmu-common.mak +1 -1
@@ -1,8 +1,8 @@ # Common mips*-softmmu CONFIG defines -include pci.mak include sound.mak include usb.mak +CONFIG_PCI=y CONFIG_ESP=y CONFIG_SCSI=y CONFIG_VGA_ISA=y
default-configs/pci.mak deleted +0 -48
48 lines not on this page · raw message
default-configs/ppc-softmmu.mak +1 -1
@@ -1,8 +1,8 @@ # Default configuration for ppc-softmmu -include pci.mak include sound.mak include usb.mak +CONFIG_PCI=y # For embedded PPCs: CONFIG_PPC4XX=y
default-configs/riscv32-softmmu.mak +1 -2
@@ -1,8 +1,7 @@ # Default configuration for riscv-softmmu -include pci.mak include usb.mak - +CONFIG_PCI=y CONFIG_SERIAL=y CONFIG_VIRTIO_MMIO=y
default-configs/riscv64-softmmu.mak +1 -2
@@ -1,8 +1,7 @@ # Default configuration for riscv-softmmu -include pci.mak include usb.mak - +CONFIG_PCI=y CONFIG_SERIAL=y CONFIG_VIRTIO_MMIO=y
default-configs/sh4-softmmu.mak +1 -1
@@ -1,7 +1,7 @@ # Default configuration for sh4-softmmu -include pci.mak include usb.mak +CONFIG_PCI=y CONFIG_SERIAL=y CONFIG_SERIAL_ISA=y CONFIG_PTIMER=y
default-configs/sh4eb-softmmu.mak +1 -1
@@ -1,7 +1,7 @@ # Default configuration for sh4eb-softmmu -include pci.mak include usb.mak +CONFIG_PCI=y CONFIG_SERIAL=y CONFIG_SERIAL_ISA=y CONFIG_PTIMER=y
default-configs/sparc64-softmmu.mak +1 -1
@@ -1,7 +1,7 @@ # Default configuration for sparc64-softmmu -include pci.mak include usb.mak +CONFIG_PCI=y CONFIG_M48T59=y CONFIG_PTIMER=y CONFIG_SERIAL=y
hw/audio/Kconfig +6 -0
@@ -3,9 +3,13 @@ config SB16 config ES1370 bool + default y + depends on PCI config AC97 bool + default y + depends on PCI config ADLIB bool
@@ -18,6 +22,8 @@ config CS4231A config HDA bool + default y + depends on PCI config PCSPK bool
hw/block/Kconfig +2 -0
@@ -21,6 +21,8 @@ config ONENAND config NVME_PCI bool + default y + depends on PCI config VIRTIO_BLK bool
hw/char/Kconfig +2 -0
@@ -15,6 +15,8 @@ config SERIAL_ISA config SERIAL_PCI bool + default y + depends on PCI config VIRTIO_SERIAL bool
hw/display/Kconfig +14 -1
@@ -9,6 +9,9 @@ config ADS7846 config VGA_CIRRUS bool + default y + depends on PCI + select VGA config G364FB bool
@@ -30,6 +33,9 @@ config SSD0323 config VGA_PCI bool + default y + depends on PCI + select VGA config VGA_ISA bool
@@ -39,9 +45,15 @@ config VGA_ISA_MM config VMWARE_VGA bool + default y + depends on PCI + select VGA config BOCHS_DISPLAY bool + default y + depends on PCI + select VGA config BLIZZARD bool
@@ -67,7 +79,8 @@ config VGA config QXL bool - depends on SPICE + depends on SPICE && PCI + select VGA config VIRTIO_GPU bool
hw/ide/Kconfig +3 -0
@@ -7,6 +7,7 @@ config IDE_QDEV config IDE_PCI bool + depends on PCI select IDE_CORE config IDE_ISA
@@ -42,6 +43,8 @@ config MICRODRIVE config AHCI bool + default y + depends on PCI select IDE_QDEV config IDE_SII3112
hw/ipack/Kconfig +2 -0
@@ -1,2 +1,4 @@ config IPACK bool + default y + depends on PCI
hw/misc/Kconfig +4 -0
@@ -21,9 +21,13 @@ config ISA_TESTDEV config PCI_TESTDEV bool + default y + depends on PCI config EDU bool + default y + depends on PCI config PCA9552 bool
hw/net/Kconfig +23 -0
@@ -3,27 +3,42 @@ config DP8393X config NE2000_PCI bool + default y + depends on PCI config EEPRO100_PCI bool + default y + depends on PCI config PCNET_PCI bool + default y + depends on PCI + select PCNET_COMMON config PCNET_COMMON bool config E1000_PCI bool + default y + depends on PCI config E1000E_PCI bool + default y + depends on PCIE config RTL8139_PCI bool + default y + depends on PCI config VMXNET3_PCI bool + default y + depends on PCI config SMC91C111 bool
@@ -81,12 +96,20 @@ config ETSEC config ROCKER bool + default y + depends on PCI config CAN_BUS bool config CAN_PCI bool + default y + depends on PCI + select CAN_BUS config CAN_SJA1000 bool + default y + depends on PCI + select CAN_BUS
hw/pci-bridge/Kconfig +4 -0
@@ -1,14 +1,18 @@ config PCIE_PORT bool + default y + depends on PCIE config PXB bool config XIO3130 bool + depends on PCIE config IOH3420 bool + depends on PCIE config I82801B11 bool
hw/pci-host/Kconfig +4 -0
@@ -24,12 +24,16 @@ config PCI_PIIX config PCI_Q35 bool + select PCIE config PCI_GENERIC bool + select PCIE config PCI_XILINX bool + select PCIE config PCI_DESIGNWARE bool + select PCIE
hw/scsi/Kconfig +11 -0
@@ -3,21 +3,32 @@ config SCSI config LSI_SCSI_PCI bool + default y + depends on PCI config MPTSAS_SCSI_PCI bool + default y + depends on PCI config MEGASAS_SCSI_PCI bool + default y + depends on PCI config VMW_PVSCSI_SCSI_PCI bool + default y + depends on PCI config ESP bool config ESP_PCI bool + default y + depends on PCI + select ESP config VIRTIO_SCSI bool
hw/sd/Kconfig +3 -0
@@ -9,3 +9,6 @@ config SD config SDHCI bool + default y + depends on PCI + select SD
hw/usb/Kconfig +10 -0
@@ -3,21 +3,31 @@ config USB config USB_UHCI bool + default y + depends on PCI config USB_OHCI bool + default y + depends on PCI config USB_EHCI bool + default y + depends on PCI config USB_EHCI_SYSBUS bool config USB_XHCI bool + default y + depends on PCI config USB_XHCI_NEC bool + default y + depends on PCI config USB_MUSB bool
hw/virtio/Kconfig +3 -0
@@ -6,6 +6,9 @@ config VIRTIO_RNG config VIRTIO_PCI bool + default y + depends on PCI + select VIRTIO config VIRTIO_MMIO bool
hw/watchdog/Kconfig +2 -0
@@ -3,6 +3,8 @@ config CMSDK_APB_WATCHDOG config WDT_IB6300ESB bool + default y + depends on PCI config WDT_IB700 bool
Signature · 1 line
2.17.1
Re: [Qemu-devel] [RFC PATCH v3 29/43] build: convert pci.mak to Kconfig
Quoted 15 lines · Yang Zhong
From: Paolo Bonzini <[email protected]>
Instead of including the same list of devices for each target, set
CONFIG_PCIto true, and make the devices default to present whenever PCI is available.Done mostly with the following script:
while read i; do i=${i%=y}; i=${i#CONFIG_} sed -i -e'/^config '$i'$/!b' -en \ -e'a\' -e' default y\' -e' depends on PCI' \ `grep -lw $i hw/*/Kconfig` done < default-configs/pci.mak
Quoted 6 lines
followed by replacing a few "depends on" clauses with "select" whenever the symbol is not really related to PCI.
Signed-off-by Paolo Bonzini <[email protected]>Signed-off-by Yang Zhong <[email protected]>Reviewed-by Thomas Huth <[email protected]>
Pls CC me directly on pci patches.
Quoted 489 lines
--- default-configs/alpha-softmmu.mak | 2 +- default-configs/arm-softmmu.mak | 2 +- default-configs/hppa-softmmu.mak | 2 +- default-configs/i386-softmmu.mak | 4 +-- default-configs/mips-softmmu-common.mak | 2 +- default-configs/pci.mak | 48 ------------------------- default-configs/ppc-softmmu.mak | 2 +- default-configs/riscv32-softmmu.mak | 3 +- default-configs/riscv64-softmmu.mak | 3 +- default-configs/sh4-softmmu.mak | 2 +- default-configs/sh4eb-softmmu.mak | 2 +- default-configs/sparc64-softmmu.mak | 2 +- hw/audio/Kconfig | 6 ++++ hw/block/Kconfig | 2 ++ hw/char/Kconfig | 2 ++ hw/display/Kconfig | 15 +++++++- hw/ide/Kconfig | 3 ++ hw/ipack/Kconfig | 2 ++ hw/misc/Kconfig | 4 +++ hw/net/Kconfig | 23 ++++++++++++ hw/pci-bridge/Kconfig | 4 +++ hw/pci-host/Kconfig | 4 +++ hw/scsi/Kconfig | 11 ++++++ hw/sd/Kconfig | 3 ++ hw/usb/Kconfig | 10 ++++++ hw/virtio/Kconfig | 3 ++ hw/watchdog/Kconfig | 2 ++ 27 files changed, 104 insertions(+), 64 deletions(-) delete mode 100644 default-configs/pci.makdefault-configs/alpha-softmmu.mak +1
-1@@ -1,7 +1,7 @@ # Default configuration for alpha-softmmu -include pci.mak include usb.mak +CONFIG_PCI=y CONFIG_SERIAL=y CONFIG_SERIAL_ISA=y CONFIG_I82374=ydefault-configs/arm-softmmu.mak +1
-1@@ -1,7 +1,7 @@ # Default configuration for arm-softmmu -include pci.mak include usb.mak +CONFIG_PCI=y CONFIG_VGA=y CONFIG_NAND=y CONFIG_ECC=ydefault-configs/hppa-softmmu.mak +1
-1@@ -1,5 +1,5 @@ -include pci.mak include usb.mak +CONFIG_PCI=y CONFIG_SERIAL=y CONFIG_SERIAL_ISA=y CONFIG_ISA_BUS=ydefault-configs/i386-softmmu.mak +1
-3@@ -1,11 +1,10 @@ # Default configuration for i386-softmmu -include pci.mak +CONFIG_PCI=y include sound.mak include usb.mak include hyperv.mak CONFIG_VGA_ISA=y -CONFIG_VGA_CIRRUS=y CONFIG_VMWARE_VGA=y CONFIG_VMXNET3_PCI=y CONFIG_VIRTIO_VGA=y@@ -52,7 +51,6 @@ CONFIG_MEM_DEVICE=y CONFIG_DIMM=y CONFIG_NVDIMM=y CONFIG_ACPI_NVDIMM=y -CONFIG_PCIE_PORT=y CONFIG_XIO3130=y CONFIG_IOH3420=y CONFIG_I82801B11=ydefault-configs/mips-softmmu-common.mak +1
-1@@ -1,8 +1,8 @@ # Common mips*-softmmu CONFIG defines -include pci.mak include sound.mak include usb.mak +CONFIG_PCI=y CONFIG_ESP=y CONFIG_SCSI=y CONFIG_VGA_ISA=ydefault-configs/pci.mak deleted +0
-48@@ -1,48 +0,0 @@ -CONFIG_PCI=y -CONFIG_PCIE=y -# For now, CONFIG_IDE_CORE requires ISA, so we enable it here -CONFIG_ISA_BUS=y -CONFIG_VIRTIO_PCI=y -include virtio.mak -CONFIG_USB_UHCI=y -CONFIG_USB_OHCI=y -CONFIG_USB_EHCI=y -CONFIG_USB_XHCI=y -CONFIG_USB_XHCI_NEC=y -CONFIG_NE2000_PCI=y -CONFIG_EEPRO100_PCI=y -CONFIG_PCNET_PCI=y -CONFIG_PCNET_COMMON=y -CONFIG_AC97=y -CONFIG_HDA=y -CONFIG_ES1370=y -CONFIG_SCSI=y -CONFIG_LSI_SCSI_PCI=y -CONFIG_VMW_PVSCSI_SCSI_PCI=y -CONFIG_MEGASAS_SCSI_PCI=y -CONFIG_MPTSAS_SCSI_PCI=y -CONFIG_RTL8139_PCI=y -CONFIG_E1000_PCI=y -CONFIG_E1000E_PCI=y -CONFIG_AHCI=y -CONFIG_ESP=y -CONFIG_ESP_PCI=y -CONFIG_SERIAL=y -CONFIG_SERIAL_ISA=y -CONFIG_SERIAL_PCI=y -CONFIG_CAN_BUS=y -CONFIG_CAN_SJA1000=y -CONFIG_CAN_PCI=y -CONFIG_IPACK=y -CONFIG_WDT_IB6300ESB=y -CONFIG_PCI_TESTDEV=y -CONFIG_NVME_PCI=y -CONFIG_SD=y -CONFIG_SDHCI=y -CONFIG_EDU=y -CONFIG_VGA=y -CONFIG_VGA_PCI=y -CONFIG_BOCHS_DISPLAY=y -CONFIG_IVSHMEM_DEVICE=$(CONFIG_IVSHMEM) -CONFIG_ROCKER=y -CONFIG_EDID=ydefault-configs/ppc-softmmu.mak +1
-1@@ -1,8 +1,8 @@ # Default configuration for ppc-softmmu -include pci.mak include sound.mak include usb.mak +CONFIG_PCI=y # For embedded PPCs: CONFIG_PPC4XX=ydefault-configs/riscv32-softmmu.mak +1
-2@@ -1,8 +1,7 @@ # Default configuration for riscv-softmmu -include pci.mak include usb.mak - +CONFIG_PCI=y CONFIG_SERIAL=y CONFIG_VIRTIO_MMIO=ydefault-configs/riscv64-softmmu.mak +1
-2@@ -1,8 +1,7 @@ # Default configuration for riscv-softmmu -include pci.mak include usb.mak - +CONFIG_PCI=y CONFIG_SERIAL=y CONFIG_VIRTIO_MMIO=ydefault-configs/sh4-softmmu.mak +1
-1@@ -1,7 +1,7 @@ # Default configuration for sh4-softmmu -include pci.mak include usb.mak +CONFIG_PCI=y CONFIG_SERIAL=y CONFIG_SERIAL_ISA=y CONFIG_PTIMER=ydefault-configs/sh4eb-softmmu.mak +1
-1@@ -1,7 +1,7 @@ # Default configuration for sh4eb-softmmu -include pci.mak include usb.mak +CONFIG_PCI=y CONFIG_SERIAL=y CONFIG_SERIAL_ISA=y CONFIG_PTIMER=ydefault-configs/sparc64-softmmu.mak +1
-1@@ -1,7 +1,7 @@ # Default configuration for sparc64-softmmu -include pci.mak include usb.mak +CONFIG_PCI=y CONFIG_M48T59=y CONFIG_PTIMER=y CONFIG_SERIAL=yhw/audio/Kconfig +6
-0@@ -3,9 +3,13 @@ config SB16 config ES1370 bool + default y + depends on PCI config AC97 bool + default y + depends on PCI config ADLIB bool@@ -18,6 +22,8 @@ config CS4231A config HDA bool + default y + depends on PCI config PCSPK boolhw/block/Kconfig +2
-0@@ -21,6 +21,8 @@ config ONENAND config NVME_PCI bool + default y + depends on PCI config VIRTIO_BLK boolhw/char/Kconfig +2
-0@@ -15,6 +15,8 @@ config SERIAL_ISA config SERIAL_PCI bool + default y + depends on PCI config VIRTIO_SERIAL boolhw/display/Kconfig +14
-1@@ -9,6 +9,9 @@ config ADS7846 config VGA_CIRRUS bool + default y + depends on PCI + select VGA config G364FB bool@@ -30,6 +33,9 @@ config SSD0323 config VGA_PCI bool + default y + depends on PCI + select VGA config VGA_ISA bool@@ -39,9 +45,15 @@ config VGA_ISA_MM config VMWARE_VGA bool + default y + depends on PCI + select VGA config BOCHS_DISPLAY bool + default y + depends on PCI + select VGA config BLIZZARD bool@@ -67,7 +79,8 @@ config VGA config QXL bool - depends on SPICE + depends on SPICE && PCI + select VGA config VIRTIO_GPU boolhw/ide/Kconfig +3
-0@@ -7,6 +7,7 @@ config IDE_QDEV config IDE_PCI bool + depends on PCI select IDE_CORE config IDE_ISA@@ -42,6 +43,8 @@ config MICRODRIVE config AHCI bool + default y + depends on PCI select IDE_QDEV config IDE_SII3112hw/ipack/Kconfig +2
-0@@ -1,2 +1,4 @@ config IPACK bool + default y + depends on PCIhw/misc/Kconfig +4
-0@@ -21,9 +21,13 @@ config ISA_TESTDEV config PCI_TESTDEV bool + default y + depends on PCI config EDU bool + default y + depends on PCI config PCA9552 boolhw/net/Kconfig +23
-0@@ -3,27 +3,42 @@ config DP8393X config NE2000_PCI bool + default y + depends on PCI config EEPRO100_PCI bool + default y + depends on PCI config PCNET_PCI bool + default y + depends on PCI + select PCNET_COMMON config PCNET_COMMON bool config E1000_PCI bool + default y + depends on PCI config E1000E_PCI bool + default y + depends on PCIE config RTL8139_PCI bool + default y + depends on PCI config VMXNET3_PCI bool + default y + depends on PCI config SMC91C111 bool@@ -81,12 +96,20 @@ config ETSEC config ROCKER bool + default y + depends on PCI config CAN_BUS bool config CAN_PCI bool + default y + depends on PCI + select CAN_BUS config CAN_SJA1000 bool + default y + depends on PCI + select CAN_BUShw/pci-bridge/Kconfig +4
-0@@ -1,14 +1,18 @@ config PCIE_PORT bool + default y + depends on PCIE config PXB bool config XIO3130 bool + depends on PCIE config IOH3420 bool + depends on PCIE config I82801B11 boolhw/pci-host/Kconfig +0
-0
hw/pci-host/Kconfig config PCI_PIIX · line 27
Quoted 4 lines
hw/pci-host/Kconfig +1
-0@@ -24,12 +24,16 @@ config PCI_PIIX config PCI_Q35 bool + select PCIE
ok...
hw/pci-host/Kconfig config PCI_PIIX · line 32
Quoted 4 lines
hw/pci-host/Kconfig +1
-0config PCI_GENERIC bool + select PCIE
why is this?
hw/pci-host/Kconfig config PCI_PIIX · line 39
Quoted 7 lines
hw/pci-host/Kconfig +2
-0config PCI_XILINX bool + select PCIE config PCI_DESIGNWARE bool + select PCIE
sure about the above?
Quoted 114 lines
hw/scsi/Kconfig +11
-0@@ -3,21 +3,32 @@ config SCSI config LSI_SCSI_PCI bool + default y + depends on PCI config MPTSAS_SCSI_PCI bool + default y + depends on PCI config MEGASAS_SCSI_PCI bool + default y + depends on PCI config VMW_PVSCSI_SCSI_PCI bool + default y + depends on PCI config ESP bool config ESP_PCI bool + default y + depends on PCI + select ESP config VIRTIO_SCSI boolhw/sd/Kconfig +3
-0@@ -9,3 +9,6 @@ config SD config SDHCI bool + default y + depends on PCI + select SDhw/usb/Kconfig +10
-0@@ -3,21 +3,31 @@ config USB config USB_UHCI bool + default y + depends on PCI config USB_OHCI bool + default y + depends on PCI config USB_EHCI bool + default y + depends on PCI config USB_EHCI_SYSBUS bool config USB_XHCI bool + default y + depends on PCI config USB_XHCI_NEC bool + default y + depends on PCI config USB_MUSB boolhw/virtio/Kconfig +3
-0@@ -6,6 +6,9 @@ config VIRTIO_RNG config VIRTIO_PCI bool + default y + depends on PCI + select VIRTIO config VIRTIO_MMIO boolhw/watchdog/Kconfig +2
-0@@ -3,6 +3,8 @@ config CMSDK_APB_WATCHDOG config WDT_IB6300ESB bool + default y + depends on PCI config WDT_IB700 boolSignature · 1 line
2.17.1
Re: [Qemu-devel] [RFC PATCH v3 29/43] build: convert pci.mak to Kconfig
Quoted 7 lines · Michael S. Tsirkin
Quoted 4 lines
config
PCI_GENERIC
bool
+ select PCIEwhy is this?
PCI_GENERIC is hw/pci-host/gpex.c, the "QEMU Generic PCI Express Bridge Emulation".
Quoted 10 lines
hw/pci-host/Kconfig config PCI_PIIX · line 39
Quoted 7 lines
config
PCI_XILINX
boolhw/pci-host/Kconfig +2
-0+ select PCIE config PCI_DESIGNWARE bool + select PCIEsure about the above?
The comments at the top of the two files say they are PCIe.
Paolo
Re: [Qemu-devel] [RFC PATCH v3 29/43] build: convert pci.mak to Kconfig
Quoted 11 lines · Paolo Bonzini
Quoted 7 lines · Michael S. Tsirkin
Quoted 4 lines
config
PCI_GENERIC
bool
+ select PCIEwhy is this?
PCI_GENERICishw/pci-host/gpex.c, the "QEMU Generic PCI Express Bridge Emulation".
Oh. Not really descriptive.
I guess we should rename it to PCI_EXPRESS_GENERIC_BRIDGE or something?
Quoted 9 lines
Quoted 9 lines
Quoted 7 lines
config
PCI_XILINX
boolhw/pci-host/Kconfig +2
-0+ select PCIE config PCI_DESIGNWARE bool + select PCIE
Quoted 5 lines
Quoted 1 line
sure about the above?
The comments at the top of the two files say they are PCIe.
Paolo
So I guess the part that I find confusing is which module it is. Module should be a prefix. So if module is PCI then everything should be PCI_ and PCIE should be PCI_EXPRESS. If PCIE is the module then all these guys should be renamed.
Signature · 1 line
MST
RFC PATCH v3 30/43 build: convert sound.mak to Kconfig
In reply to Yang ZhongFrom: Paolo Bonzini <[email protected]>
There is really nothing special in these devices; they are just ISA devices. Instead of including them for each target, set CONFIG_ISA_BUS to true, and make the devices default to present whenever ISA is available. More conversion of ISA devices will follow.
Done with the following script:
while read i; do
i=${i%=y}; i=${i#CONFIG_}
sed -i -e'/^config '$i'$/!b' -en \
-e'a\' -e' default y\' -e' depends on ISA_BUS' \
`grep -lw $i hw/*/Kconfig`
done < default-configs/sound.mak--- default-configs/i386-softmmu.mak | 2 +- default-configs/mips-softmmu-common.mak | 2 +- default-configs/ppc-softmmu.mak | 2 +- default-configs/sound.mak | 4 ---- hw/audio/Kconfig | 8 ++++++++ 5 files changed, 11 insertions(+), 7 deletions(-) delete mode 100644 default-configs/sound.mak
default-configs/i386-softmmu.mak +1 -1
@@ -1,7 +1,7 @@ # Default configuration for i386-softmmu CONFIG_PCI=y -include sound.mak +CONFIG_ISA_BUS=y include usb.mak include hyperv.mak CONFIG_VGA_ISA=y
default-configs/mips-softmmu-common.mak +1 -1
@@ -1,7 +1,7 @@ # Common mips*-softmmu CONFIG defines -include sound.mak include usb.mak +CONFIG_ISA_BUS=y CONFIG_PCI=y CONFIG_ESP=y CONFIG_SCSI=y
default-configs/ppc-softmmu.mak +1 -1
@@ -1,8 +1,8 @@ # Default configuration for ppc-softmmu -include sound.mak include usb.mak CONFIG_PCI=y +CONFIG_ISA_BUS=y # For embedded PPCs: CONFIG_PPC4XX=y
default-configs/sound.mak deleted +0 -4
@@ -1,4 +0,0 @@ -CONFIG_SB16=y -CONFIG_ADLIB=y -CONFIG_GUS=y -CONFIG_CS4231A=y
hw/audio/Kconfig +8 -0
@@ -1,5 +1,7 @@ config SB16 bool + default y + depends on ISA_BUS config ES1370 bool
@@ -13,12 +15,18 @@ config AC97 config ADLIB bool + default y + depends on ISA_BUS config GUS bool + default y + depends on ISA_BUS config CS4231A bool + default y + depends on ISA_BUS config HDA bool
Signature · 1 line
2.17.1
RFC PATCH v3 31/43 build: convert usb.mak to Kconfig
In reply to Yang ZhongFrom: Paolo Bonzini <[email protected]>
Instead of including the same list of devices for each target, let the host controllers select CONFIG_USB and make the devices default to present whenever USB is available.
Done with the following script:
while read i; do
i=${i%=y}; i=${i#CONFIG_}
sed -i -e'/^config '$i'$/!b' -en \
-e'a\' -e' default y\' -e' depends on USB' \
`grep -lw $i hw/*/Kconfig`done < default-configs/usb.mak
followed by adding "select USB" on the host controllers.
--- default-configs/alpha-softmmu.mak | 1 - default-configs/arm-softmmu.mak | 2 -- default-configs/hppa-softmmu.mak | 1 - default-configs/i386-softmmu.mak | 1 - default-configs/mips-softmmu-common.mak | 1 - default-configs/ppc-softmmu.mak | 1 - default-configs/riscv32-softmmu.mak | 1 - default-configs/riscv64-softmmu.mak | 1 - default-configs/sh4-softmmu.mak | 1 - default-configs/sh4eb-softmmu.mak | 1 - default-configs/sparc64-softmmu.mak | 1 - default-configs/usb.mak | 11 ----------- hw/usb/Kconfig | 26 +++++++++++++++++++++++++ 13 files changed, 26 insertions(+), 23 deletions(-) delete mode 100644 default-configs/usb.mak
default-configs/alpha-softmmu.mak +0 -1
@@ -1,6 +1,5 @@ # Default configuration for alpha-softmmu -include usb.mak CONFIG_PCI=y CONFIG_SERIAL=y CONFIG_SERIAL_ISA=y
default-configs/arm-softmmu.mak +0 -2
@@ -1,6 +1,5 @@ # Default configuration for arm-softmmu -include usb.mak CONFIG_PCI=y CONFIG_VGA=y CONFIG_NAND=y
@@ -38,7 +37,6 @@ CONFIG_DS1338=y CONFIG_PFLASH_CFI01=y CONFIG_PFLASH_CFI02=y CONFIG_MICRODRIVE=y -CONFIG_USB=y CONFIG_USB_MUSB=y CONFIG_USB_EHCI_SYSBUS=y CONFIG_PLATFORM_BUS=y
default-configs/hppa-softmmu.mak +0 -1
@@ -1,4 +1,3 @@ -include usb.mak CONFIG_PCI=y CONFIG_SERIAL=y CONFIG_SERIAL_ISA=y
default-configs/i386-softmmu.mak +0 -1
@@ -2,7 +2,6 @@ CONFIG_PCI=y CONFIG_ISA_BUS=y -include usb.mak include hyperv.mak CONFIG_VGA_ISA=y CONFIG_VMWARE_VGA=y
default-configs/mips-softmmu-common.mak +0 -1
@@ -1,6 +1,5 @@ # Common mips*-softmmu CONFIG defines -include usb.mak CONFIG_ISA_BUS=y CONFIG_PCI=y CONFIG_ESP=y
default-configs/ppc-softmmu.mak +0 -1
@@ -1,6 +1,5 @@ # Default configuration for ppc-softmmu -include usb.mak CONFIG_PCI=y CONFIG_ISA_BUS=y
default-configs/riscv32-softmmu.mak +0 -1
@@ -1,6 +1,5 @@ # Default configuration for riscv-softmmu -include usb.mak CONFIG_PCI=y CONFIG_SERIAL=y CONFIG_VIRTIO_MMIO=y
default-configs/riscv64-softmmu.mak +0 -1
@@ -1,6 +1,5 @@ # Default configuration for riscv-softmmu -include usb.mak CONFIG_PCI=y CONFIG_SERIAL=y CONFIG_VIRTIO_MMIO=y
default-configs/sh4-softmmu.mak +0 -1
@@ -1,6 +1,5 @@ # Default configuration for sh4-softmmu -include usb.mak CONFIG_PCI=y CONFIG_SERIAL=y CONFIG_SERIAL_ISA=y
default-configs/sh4eb-softmmu.mak +0 -1
@@ -1,6 +1,5 @@ # Default configuration for sh4eb-softmmu -include usb.mak CONFIG_PCI=y CONFIG_SERIAL=y CONFIG_SERIAL_ISA=y
default-configs/sparc64-softmmu.mak +0 -1
@@ -1,6 +1,5 @@ # Default configuration for sparc64-softmmu -include usb.mak CONFIG_PCI=y CONFIG_M48T59=y CONFIG_PTIMER=y
default-configs/usb.mak deleted +0 -11
@@ -1,11 +0,0 @@ -CONFIG_USB=y -CONFIG_USB_TABLET_WACOM=y -CONFIG_USB_STORAGE_BOT=y -CONFIG_USB_STORAGE_UAS=y -CONFIG_USB_STORAGE_MTP=y -CONFIG_SCSI=y -CONFIG_USB_SMARTCARD=y -CONFIG_USB_AUDIO=y -CONFIG_USB_SERIAL=y -CONFIG_USB_NETWORK=y -CONFIG_USB_BLUETOOTH=y
hw/usb/Kconfig +26 -0
@@ -5,59 +5,85 @@ config USB_UHCI bool default y depends on PCI + select USB config USB_OHCI bool default y depends on PCI + select USB config USB_EHCI bool default y depends on PCI + select USB config USB_EHCI_SYSBUS bool + select USB config USB_XHCI bool default y depends on PCI + select USB config USB_XHCI_NEC bool default y depends on PCI + select USB config USB_MUSB bool + select USB config TUSB6010 bool + select USB_MUSB config USB_TABLET_WACOM bool + default y + depends on USB config USB_STORAGE_BOT bool + default y + depends on USB config USB_STORAGE_UAS bool + default y + depends on USB config USB_AUDIO bool + default y + depends on USB config USB_SERIAL bool + default y + depends on USB config USB_NETWORK bool + default y + depends on USB config USB_BLUETOOTH bool + default y + depends on USB config USB_SMARTCARD bool + default y + depends on USB config USB_STORAGE_MTP bool + default y + depends on USB
Signature · 1 line
2.17.1
RFC PATCH v3 32/43 scsi: express dependencies with Kconfig
In reply to Yang ZhongFrom: Paolo Bonzini <[email protected]>
This automatically removes the SCSI subsystem from the binary altogether if no controllers are selected.
--- hw/scsi/Kconfig | 12 ++++++++++++ hw/scsi/Makefile.objs | 2 +- hw/usb/Kconfig | 2 ++ 3 files changed, 15 insertions(+), 1 deletion(-)
hw/scsi/Kconfig +12 -0
@@ -5,24 +5,29 @@ config LSI_SCSI_PCI bool default y depends on PCI + select SCSI config MPTSAS_SCSI_PCI bool default y depends on PCI + select SCSI config MEGASAS_SCSI_PCI bool default y depends on PCI + select SCSI config VMW_PVSCSI_SCSI_PCI bool default y depends on PCI + select SCSI config ESP bool + select SCSI config ESP_PCI bool
@@ -30,8 +35,15 @@ config ESP_PCI depends on PCI select ESP +config SPAPR_VSCSI + bool + depends on PSERIES + select SCSI + config VIRTIO_SCSI bool + default y + select SCSI config VHOST_USER_SCSI bool
hw/scsi/Makefile.objs +1 -1
@@ -6,7 +6,7 @@ common-obj-$(CONFIG_MEGASAS_SCSI_PCI) += megasas.o common-obj-$(CONFIG_VMW_PVSCSI_SCSI_PCI) += vmw_pvscsi.o common-obj-$(CONFIG_ESP) += esp.o common-obj-$(CONFIG_ESP_PCI) += esp-pci.o -obj-$(CONFIG_PSERIES) += spapr_vscsi.o +obj-$(CONFIG_SPAPR_VSCSI) += spapr_vscsi.o ifeq ($(CONFIG_VIRTIO_SCSI),y) obj-y += virtio-scsi.o virtio-scsi-dataplane.o
hw/usb/Kconfig +2 -0
@@ -52,11 +52,13 @@ config USB_STORAGE_BOT bool default y depends on USB + select SCSI config USB_STORAGE_UAS bool default y depends on USB + select SCSI config USB_AUDIO bool
Signature · 1 line
2.17.1
RFC PATCH v3 33/43 bluetooth: express dependencies with Kconfig
In reply to Yang ZhongFrom: Paolo Bonzini <[email protected]>
--- hw/Makefile.objs | 2 +- hw/usb/Kconfig | 1 + 2 files changed, 2 insertions(+), 1 deletion(-)
hw/Makefile.objs +1 -1
@@ -3,7 +3,7 @@ devices-dirs-$(CONFIG_SOFTMMU) += acpi/ devices-dirs-$(CONFIG_SOFTMMU) += adc/ devices-dirs-$(CONFIG_SOFTMMU) += audio/ devices-dirs-$(CONFIG_SOFTMMU) += block/ -devices-dirs-$(CONFIG_SOFTMMU) += bt/ +devices-dirs-$(CONFIG_BLUETOOTH) += bt/ devices-dirs-$(CONFIG_SOFTMMU) += char/ devices-dirs-$(CONFIG_SOFTMMU) += cpu/ devices-dirs-$(CONFIG_SOFTMMU) += display/
hw/usb/Kconfig +1 -0
@@ -79,6 +79,7 @@ config USB_BLUETOOTH bool default y depends on USB + select BLUETOOTH config USB_SMARTCARD bool
Signature · 1 line
2.17.1
RFC PATCH v3 34/43 isa: express dependencies with kconfig
In reply to Yang ZhongFrom: Paolo Bonzini <[email protected]>
--- default-configs/i386-softmmu.mak | 9 --------- hw/audio/Kconfig | 2 ++ hw/block/Kconfig | 2 ++ hw/char/Kconfig | 6 ++++++ hw/display/Kconfig | 3 +++ hw/i386/Kconfig | 1 + hw/ide/Kconfig | 1 + hw/input/Kconfig | 2 ++ hw/isa/Kconfig | 5 +++++ hw/misc/Kconfig | 4 ++++ hw/net/Kconfig | 3 +++ hw/watchdog/Kconfig | 2 ++ 12 files changed, 31 insertions(+), 9 deletions(-)
default-configs/i386-softmmu.mak +0 -9
@@ -7,19 +7,12 @@ CONFIG_VGA_ISA=y CONFIG_VMWARE_VGA=y CONFIG_VMXNET3_PCI=y CONFIG_VIRTIO_VGA=y -CONFIG_VMMOUSE=y CONFIG_IPMI=y CONFIG_IPMI_LOCAL=y CONFIG_IPMI_EXTERN=y CONFIG_ISA_IPMI_KCS=y CONFIG_ISA_IPMI_BT=y -CONFIG_SERIAL=y -CONFIG_SERIAL_ISA=y -CONFIG_PARALLEL=y CONFIG_I8254=y -CONFIG_PCSPK=y -CONFIG_PCKBD=y -CONFIG_FDC=y CONFIG_ACPI=y CONFIG_ACPI_X86=y CONFIG_ACPI_X86_ICH=y
@@ -29,14 +22,12 @@ CONFIG_APM=y CONFIG_I8257=y CONFIG_IDE_ISA=y CONFIG_IDE_PIIX=y -CONFIG_NE2000_ISA=y CONFIG_HPET=y CONFIG_APPLESMC=y CONFIG_I8259=y CONFIG_PFLASH_CFI01=y CONFIG_MC146818RTC=y CONFIG_PCI_PIIX=y -CONFIG_WDT_IB700=y CONFIG_ISA_DEBUG=y CONFIG_ISA_TESTDEV=y CONFIG_VMPORT=y
hw/audio/Kconfig +2 -0
@@ -35,6 +35,8 @@ config HDA config PCSPK bool + default y + depends on ISA_BUS config WM8750 bool
hw/block/Kconfig +2 -0
@@ -1,5 +1,7 @@ config FDC bool + default y + depends on ISA_BUS config SSI_M25P80 bool
hw/char/Kconfig +6 -0
@@ -3,6 +3,8 @@ config ESCC config PARALLEL bool + default y + depends on ISA_BUS config PL011 bool
@@ -12,11 +14,15 @@ config SERIAL config SERIAL_ISA bool + default y + depends on ISA_BUS + select SERIAL config SERIAL_PCI bool default y depends on PCI + select SERIAL config VIRTIO_SERIAL bool
hw/display/Kconfig +3 -0
@@ -39,9 +39,12 @@ config VGA_PCI config VGA_ISA bool + depends on ISA_BUS + select VGA config VGA_ISA_MM bool + select VGA config VMWARE_VGA bool
hw/i386/Kconfig +1 -0
@@ -9,6 +9,7 @@ config I440FX config ISAPC bool + select ISA_BUS config Q35 bool
hw/ide/Kconfig +1 -0
@@ -12,6 +12,7 @@ config IDE_PCI config IDE_ISA bool + depends on ISA_BUS select IDE_QDEV config IDE_PIIX
hw/input/Kconfig +2 -0
@@ -6,6 +6,8 @@ config LM832X config PCKBD bool + default y + depends on ISA_BUS config PL050 bool
hw/isa/Kconfig +5 -0
@@ -9,15 +9,20 @@ config I82378 config PC87312 bool + select ISA_BUS config PIIX4 bool + select ISA_BUS config VT82C686 bool + select ISA_BUS config SMC37C669 bool config LPC_ICH9 bool + select ISA_BUS + select ACPI_X86_ICH
hw/misc/Kconfig +4 -0
@@ -1,5 +1,6 @@ config APPLESMC bool + depends on ISA_BUS config MAX111X bool
@@ -12,9 +13,11 @@ config TMP421 config ISA_DEBUG bool + depends on ISA_BUS config SGA bool + depends on ISA_BUS config ISA_TESTDEV bool
@@ -93,6 +96,7 @@ config IOTKIT_SYSINFO config PVPANIC bool + depends on ISA_BUS config AUX bool
hw/net/Kconfig +3 -0
@@ -48,6 +48,9 @@ config LAN9118 config NE2000_ISA bool + default y + depends on ISA_BUS + depends on PCI # for NE2000State config OPENCORES_ETH bool
hw/watchdog/Kconfig +2 -0
@@ -8,6 +8,8 @@ config WDT_IB6300ESB config WDT_IB700 bool + default y + depends on ISA_BUS config WDT_DIAG288 bool
Signature · 1 line
2.17.1
RFC PATCH v3 35/43 i386: express dependencies with Kconfig
In reply to Yang ZhongFrom: Paolo Bonzini <[email protected]>
This way, the default-configs file only need to specify the boards and any optional devices.
--- default-configs/i386-softmmu.mak | 39 ++++---------------- hw/acpi/Kconfig | 3 ++ hw/display/Kconfig | 1 + hw/i2c/Makefile.objs | 4 +- hw/i386/Kconfig | 63 +++++++++++++++++++++++++++++--- hw/isa/Kconfig | 1 + hw/pci-host/Kconfig | 5 +++ hw/tpm/Kconfig | 5 ++- 8 files changed, 80 insertions(+), 41 deletions(-)
default-configs/i386-softmmu.mak +7 -32
@@ -1,10 +1,6 @@ # Default configuration for i386-softmmu -CONFIG_PCI=y -CONFIG_ISA_BUS=y include hyperv.mak -CONFIG_VGA_ISA=y -CONFIG_VMWARE_VGA=y CONFIG_VMXNET3_PCI=y CONFIG_VIRTIO_VGA=y CONFIG_IPMI=y
@@ -12,46 +8,25 @@ CONFIG_IPMI_LOCAL=y CONFIG_IPMI_EXTERN=y CONFIG_ISA_IPMI_KCS=y CONFIG_ISA_IPMI_BT=y -CONFIG_I8254=y -CONFIG_ACPI=y -CONFIG_ACPI_X86=y -CONFIG_ACPI_X86_ICH=y -CONFIG_ACPI_MEMORY_HOTPLUG=y -CONFIG_ACPI_CPU_HOTPLUG=y -CONFIG_APM=y -CONFIG_I8257=y -CONFIG_IDE_ISA=y -CONFIG_IDE_PIIX=y + +# Optional devices: +# CONFIG_HPET=y CONFIG_APPLESMC=y -CONFIG_I8259=y CONFIG_PFLASH_CFI01=y -CONFIG_MC146818RTC=y -CONFIG_PCI_PIIX=y -CONFIG_ISA_DEBUG=y CONFIG_ISA_TESTDEV=y -CONFIG_VMPORT=y CONFIG_SGA=y -CONFIG_LPC_ICH9=y -CONFIG_PCI_Q35=y -CONFIG_APIC=y -CONFIG_IOAPIC=y CONFIG_PVPANIC=y CONFIG_MEM_DEVICE=y -CONFIG_DIMM=y CONFIG_NVDIMM=y CONFIG_ACPI_NVDIMM=y -CONFIG_XIO3130=y -CONFIG_IOH3420=y -CONFIG_I82801B11=y -CONFIG_SMBIOS=y CONFIG_PXB=y CONFIG_ACPI_VMGENID=y -CONFIG_FW_CFG_DMA=y CONFIG_I2C=y CONFIG_SEV=$(CONFIG_KVM) -CONFIG_VTD=y -CONFIG_AMD_IOMMU=y -CONFIG_PAM=y + +# Boards: +# +CONFIG_ISAPC=y CONFIG_I440FX=y CONFIG_Q35=y
hw/acpi/Kconfig +3 -0
@@ -3,15 +3,18 @@ config ACPI config ACPI_X86 bool + select ACPI config ACPI_X86_ICH bool + select ACPI_X86 config ACPI_CPU_HOTPLUG bool config ACPI_MEMORY_HOTPLUG bool + select MEM_DEVICE config ACPI_NVDIMM bool
hw/display/Kconfig +1 -0
@@ -82,6 +82,7 @@ config VGA config QXL bool + default y if PC depends on SPICE && PCI select VGA
hw/i2c/Makefile.objs +2 -2
@@ -1,8 +1,8 @@ common-obj-$(CONFIG_I2C) += core.o smbus.o smbus_eeprom.o common-obj-$(CONFIG_DDC) += i2c-ddc.o common-obj-$(CONFIG_VERSATILE_I2C) += versatile_i2c.o -common-obj-$(CONFIG_ACPI_X86) += smbus_ich9.o -common-obj-$(CONFIG_APM) += pm_smbus.o +common-obj-$(CONFIG_ACPI_X86_ICH) += smbus_ich9.o +common-obj-$(CONFIG_ACPI_SMBUS) += pm_smbus.o common-obj-$(CONFIG_BITBANG_I2C) += bitbang_i2c.o common-obj-$(CONFIG_EXYNOS4) += exynos4210_i2c.o common-obj-$(CONFIG_IMX_I2C) += imx_i2c.o
hw/i386/Kconfig +57 -6
81 lines not on this page · raw message
hw/isa/Kconfig +1 -0
@@ -25,4 +25,5 @@ config SMC37C669 config LPC_ICH9 bool select ISA_BUS + select ACPI_SMBUS select ACPI_X86_ICH
hw/pci-host/Kconfig +5 -0
@@ -21,10 +21,15 @@ config PCI_SABRE config PCI_PIIX bool + select PCI config PCI_Q35 bool select PCIE + select PCI + select XIO3130 + select IOH3420 + select I82801B11 config PCI_GENERIC bool
hw/tpm/Kconfig +4 -1
@@ -3,10 +3,13 @@ config TPM config TPM_TIS bool - depends on TPM + default y + depends on TPM && PC config TPM_CRB bool + default y + depends on TPM && PC config TPM_PASSTHROUGH bool
Signature · 1 line
2.17.1
RFC PATCH v3 36/43 i2c: express dependencies with Kconfig
In reply to Yang ZhongFrom: Paolo Bonzini <[email protected]>
--- default-configs/i386-softmmu.mak | 1 - hw/Makefile.objs | 2 +- hw/audio/Kconfig | 1 + hw/display/Kconfig | 3 +++ hw/gpio/Kconfig | 1 + hw/i2c/Kconfig | 6 ++++++ hw/i2c/Makefile.objs | 3 ++- hw/i386/Kconfig | 1 + hw/input/Kconfig | 1 + hw/isa/Kconfig | 1 + hw/misc/Kconfig | 4 ++++ hw/timer/Kconfig | 3 +++ 12 files changed, 24 insertions(+), 3 deletions(-)
default-configs/i386-softmmu.mak +0 -1
@@ -22,7 +22,6 @@ CONFIG_NVDIMM=y CONFIG_ACPI_NVDIMM=y CONFIG_PXB=y CONFIG_ACPI_VMGENID=y -CONFIG_I2C=y CONFIG_SEV=$(CONFIG_KVM) # Boards:
hw/Makefile.objs +1 -1
@@ -10,7 +10,7 @@ devices-dirs-$(CONFIG_SOFTMMU) += display/ devices-dirs-$(CONFIG_SOFTMMU) += dma/ devices-dirs-$(CONFIG_SOFTMMU) += gpio/ devices-dirs-$(CONFIG_HYPERV) += hyperv/ -devices-dirs-$(CONFIG_SOFTMMU) += i2c/ +devices-dirs-$(CONFIG_I2C) += i2c/ devices-dirs-$(CONFIG_SOFTMMU) += ide/ devices-dirs-$(CONFIG_SOFTMMU) += input/ devices-dirs-$(CONFIG_SOFTMMU) += intc/
hw/audio/Kconfig +1 -0
@@ -40,6 +40,7 @@ config PCSPK config WM8750 bool + depends on I2C config PL041 bool
hw/display/Kconfig +3 -0
@@ -24,9 +24,11 @@ config PL110 config SII9022 bool + depends on I2C config SSD0303 bool + depends on I2C config SSD0323 bool
@@ -70,6 +72,7 @@ config MILKYMIST_TMU2 config SM501 bool + depends on I2C config TCX bool
hw/gpio/Kconfig +1 -0
@@ -1,5 +1,6 @@ config MAX7310 bool + depends on I2C config PL061 bool
hw/i2c/Kconfig +6 -0
@@ -3,18 +3,24 @@ config I2C config SMBUS_EEPROM bool + depends on I2C config DDC bool + depends on I2C config VERSATILE_I2C bool + select I2C config ACPI_SMBUS bool + select I2C config BITBANG_I2C bool + select I2C config IMX_I2C bool + select I2C
hw/i2c/Makefile.objs +2 -1
@@ -1,4 +1,5 @@ -common-obj-$(CONFIG_I2C) += core.o smbus.o smbus_eeprom.o +common-obj-$(CONFIG_I2C) += core.o smbus.o +common-obj-$(CONFIG_SMBUS_EEPROM) += smbus_eeprom.o common-obj-$(CONFIG_DDC) += i2c-ddc.o common-obj-$(CONFIG_VERSATILE_I2C) += versatile_i2c.o common-obj-$(CONFIG_ACPI_X86_ICH) += smbus_ich9.o
hw/i386/Kconfig +1 -0
@@ -24,6 +24,7 @@ config PC_ACPI select ACPI_X86 select ACPI_CPU_HOTPLUG select ACPI_MEMORY_HOTPLUG + select SMBUS_EEPROM depends on ACPI_SMBUS config I440FX
hw/input/Kconfig +1 -0
@@ -3,6 +3,7 @@ config ADB config LM832X bool + depends on I2C config PCKBD bool
hw/isa/Kconfig +1 -0
@@ -18,6 +18,7 @@ config PIIX4 config VT82C686 bool select ISA_BUS + select ACPI_SMBUS config SMC37C669 bool
hw/misc/Kconfig +4 -0
@@ -7,9 +7,11 @@ config MAX111X config TMP105 bool + depends on I2C config TMP421 bool + depends on I2C config ISA_DEBUG bool
@@ -34,6 +36,7 @@ config EDU config PCA9552 bool + depends on I2C config PL310 bool
@@ -100,3 +103,4 @@ config PVPANIC config AUX bool + select I2C
hw/timer/Kconfig +3 -0
@@ -9,6 +9,7 @@ config A9_GTIMER config DS1338 bool + depends on I2C config HPET bool
@@ -18,6 +19,7 @@ config I8254 config M41T80 bool + depends on I2C config M48T59 bool
@@ -27,6 +29,7 @@ config PL031 config TWL92230 bool + depends on I2C config XLNX_ZYNQMP bool
Signature · 1 line
2.17.1
RFC PATCH v3 37/43 ptimer: express dependencies with Kconfig
In reply to Yang ZhongFrom: Paolo Bonzini <[email protected]>
--- hw/Kconfig | 2 ++ hw/net/Kconfig | 2 ++ hw/timer/Kconfig | 6 ++++++ 3 files changed, 10 insertions(+)
hw/Kconfig +2 -0
@@ -62,6 +62,8 @@ source xtensa/Kconfig # Symbols used by multiple targets config XILINX bool + select PTIMER # for hw/timer/xilinx_timer.c config XILINX_AXI bool + select PTIMER # for hw/dma/xilinx_axidma.c
hw/net/Kconfig +2 -0
@@ -45,6 +45,7 @@ config SMC91C111 config LAN9118 bool + select PTIMER config NE2000_ISA bool
@@ -96,6 +97,7 @@ config VIRTIO_NET config ETSEC bool + select PTIMER config ROCKER bool
hw/timer/Kconfig +6 -0
@@ -1,8 +1,10 @@ config ARM_TIMER bool + select PTIMER config ARM_MPTIMER bool + select PTIMER config A9_GTIMER bool
@@ -36,12 +38,14 @@ config XLNX_ZYNQMP config ALTERA_TIMER bool + select PTIMER config MC146818RTC bool config ALLWINNER_A10_PIT bool + select PTIMER config STM32F2XX_TIMER bool
@@ -51,6 +55,8 @@ config SUN4V_RTC config CMSDK_APB_TIMER bool + select PTIMER config CMSDK_APB_DUALTIMER bool + select PTIMER
Signature · 1 line
2.17.1
RFC PATCH v3 38/43 edid: express dependencies with kconfig
In reply to Yang Zhong--- hw/display/Kconfig | 2 ++ hw/i2c/Kconfig | 1 + 2 files changed, 3 insertions(+)
hw/display/Kconfig +2 -0
@@ -38,6 +38,7 @@ config VGA_PCI default y depends on PCI select VGA + select EDID config VGA_ISA bool
@@ -59,6 +60,7 @@ config BOCHS_DISPLAY default y depends on PCI select VGA + select EDID config BLIZZARD bool
hw/i2c/Kconfig +1 -0
@@ -8,6 +8,7 @@ config SMBUS_EEPROM config DDC bool depends on I2C + select EDID config VERSATILE_I2C bool
Signature · 1 line
2.17.1
RFC PATCH v3 39/43 hyperv: express dependencies with kconfig
In reply to Yang Zhongremove default-configs/hyperv.mak and make dependencies with Kconfig.
--- default-configs/hyperv.mak | 2 -- default-configs/i386-softmmu.mak | 1 - hw/hyperv/Kconfig | 4 ++++ 3 files changed, 4 insertions(+), 3 deletions(-) delete mode 100644 default-configs/hyperv.mak
default-configs/hyperv.mak deleted +0 -2
@@ -1,2 +0,0 @@ -CONFIG_HYPERV=$(CONFIG_KVM) -CONFIG_HYPERV_TESTDEV=y
default-configs/i386-softmmu.mak +0 -1
@@ -1,6 +1,5 @@ # Default configuration for i386-softmmu -include hyperv.mak CONFIG_VMXNET3_PCI=y CONFIG_VIRTIO_VGA=y CONFIG_IPMI=y
hw/hyperv/Kconfig +4 -0
@@ -1,5 +1,9 @@ config HYPERV bool + default y if PC + depends on KVM config HYPERV_TESTDEV bool + default y if PC + depends on HYPERV
Signature · 1 line
2.17.1
RFC PATCH v3 40/43 virtio: make virtio dependencies with Kconfig
In reply to Yang Zhong--- default-configs/i386-softmmu.mak | 1 - default-configs/s390x-softmmu.mak | 1 - default-configs/virtio.mak | 14 -------------- hw/9pfs/Kconfig | 2 ++ hw/block/Kconfig | 2 ++ hw/char/Kconfig | 2 ++ hw/display/Kconfig | 5 +++++ hw/input/Kconfig | 2 ++ hw/net/Kconfig | 2 ++ hw/pci-host/Kconfig | 2 ++ hw/scsi/Kconfig | 1 + hw/virtio/Kconfig | 9 ++++++++- 12 files changed, 26 insertions(+), 17 deletions(-) delete mode 100644 default-configs/virtio.mak
default-configs/i386-softmmu.mak +0 -1
@@ -1,7 +1,6 @@ # Default configuration for i386-softmmu CONFIG_VMXNET3_PCI=y -CONFIG_VIRTIO_VGA=y CONFIG_IPMI=y CONFIG_IPMI_LOCAL=y CONFIG_IPMI_EXTERN=y
default-configs/s390x-softmmu.mak +0 -1
@@ -1,6 +1,5 @@ CONFIG_PCI=y CONFIG_VIRTIO_PCI=$(CONFIG_PCI) -include virtio.mak CONFIG_SCLPCONSOLE=y CONFIG_TERMINAL3270=y CONFIG_S390_FLIC=y
default-configs/virtio.mak deleted +0 -14
@@ -1,14 +0,0 @@ -CONFIG_VHOST_USER_SCSI=$(call land,$(CONFIG_VHOST_USER),$(CONFIG_LINUX)) -CONFIG_VHOST_USER_BLK=$(call land,$(CONFIG_VHOST_USER),$(CONFIG_LINUX)) -CONFIG_VIRTIO=y -CONFIG_VIRTIO_9P=y -CONFIG_VIRTIO_BALLOON=y -CONFIG_VIRTIO_BLK=y -CONFIG_VIRTIO_CRYPTO=y -CONFIG_VIRTIO_GPU=y -CONFIG_VIRTIO_INPUT=y -CONFIG_VIRTIO_NET=y -CONFIG_VIRTIO_RNG=y -CONFIG_SCSI=y -CONFIG_VIRTIO_SCSI=y -CONFIG_VIRTIO_SERIAL=y
hw/9pfs/Kconfig +2 -0
@@ -1,2 +1,4 @@ config VIRTIO_9P bool + default y + depends on VIRTIO
hw/block/Kconfig +2 -0
@@ -28,6 +28,8 @@ config NVME_PCI config VIRTIO_BLK bool + default y + depends on VIRTIO config VHOST_USER_BLK bool
hw/char/Kconfig +2 -0
@@ -26,6 +26,8 @@ config SERIAL_PCI config VIRTIO_SERIAL bool + default y + depends on VIRTIO config STM32F2XX_USART bool
hw/display/Kconfig +5 -0
@@ -93,9 +93,14 @@ config QXL config VIRTIO_GPU bool + default y + depends on VIRTIO config VIRTIO_VGA bool + default y + depends on VIRTIO && PCI + select VGA config DPCD bool
hw/input/Kconfig +2 -0
@@ -21,6 +21,8 @@ config TSC2005 config VIRTIO_INPUT bool + default y + depends on VIRTIO config TSC210X bool
hw/net/Kconfig +2 -0
@@ -94,6 +94,8 @@ config XILINX_ETHLITE config VIRTIO_NET bool + default y + depends on VIRTIO config ETSEC bool
hw/pci-host/Kconfig +2 -0
@@ -22,6 +22,7 @@ config PCI_SABRE config PCI_PIIX bool select PCI + select VIRTIO config PCI_Q35 bool
@@ -30,6 +31,7 @@ config PCI_Q35 select XIO3130 select IOH3420 select I82801B11 + select VIRTIO config PCI_GENERIC bool
hw/scsi/Kconfig +1 -0
@@ -43,6 +43,7 @@ config SPAPR_VSCSI config VIRTIO_SCSI bool default y + depends on VIRTIO select SCSI config VHOST_USER_SCSI
hw/virtio/Kconfig +8 -1
@@ -3,18 +3,25 @@ config VIRTIO config VIRTIO_RNG bool + default y + depends on VIRTIO config VIRTIO_PCI bool default y depends on PCI - select VIRTIO + depends on VIRTIO config VIRTIO_MMIO bool + depends on VIRTIO config VIRTIO_BALLOON bool + default y + depends on VIRTIO config VIRTIO_CRYPTO bool + default y + depends on VIRTIO
Signature · 1 line
2.17.1
RFC PATCH v3 41/43 i386-softmmu.mak: remove all CONFIG_* except boards definitions
In reply to Yang Zhong%-softmmu.mak only keep boards definitions in Kconfig mode.
--- default-configs/i386-softmmu.mak | 22 ---------------------- hw/acpi/Kconfig | 4 ++++ hw/i386/Kconfig | 5 +++++ hw/ipmi/Kconfig | 8 ++++++++ hw/mem/Kconfig | 2 ++ hw/misc/Kconfig | 4 ++++ hw/pci-bridge/Kconfig | 1 + hw/timer/Kconfig | 1 + 8 files changed, 25 insertions(+), 22 deletions(-)
default-configs/i386-softmmu.mak +0 -22
@@ -1,27 +1,5 @@ # Default configuration for i386-softmmu -CONFIG_VMXNET3_PCI=y -CONFIG_IPMI=y -CONFIG_IPMI_LOCAL=y -CONFIG_IPMI_EXTERN=y -CONFIG_ISA_IPMI_KCS=y -CONFIG_ISA_IPMI_BT=y - -# Optional devices: -# -CONFIG_HPET=y -CONFIG_APPLESMC=y -CONFIG_PFLASH_CFI01=y -CONFIG_ISA_TESTDEV=y -CONFIG_SGA=y -CONFIG_PVPANIC=y -CONFIG_MEM_DEVICE=y -CONFIG_NVDIMM=y -CONFIG_ACPI_NVDIMM=y -CONFIG_PXB=y -CONFIG_ACPI_VMGENID=y -CONFIG_SEV=$(CONFIG_KVM) - # Boards: # CONFIG_ISAPC=y
hw/acpi/Kconfig +4 -0
@@ -18,9 +18,13 @@ config ACPI_MEMORY_HOTPLUG config ACPI_NVDIMM bool + default y + depends on I440FX || Q35 config ACPI_VMGENID bool + default y + depends on I440FX || Q35 config IPMI bool
hw/i386/Kconfig +5 -0
@@ -1,6 +1,10 @@ config KVM bool +config SEV + bool + default y if PC && KVM + config PC bool select ISA_DEBUG
@@ -25,6 +29,7 @@ config PC_ACPI select ACPI_CPU_HOTPLUG select ACPI_MEMORY_HOTPLUG select SMBUS_EEPROM + select PFLASH_CFI01 depends on ACPI_SMBUS config I440FX
hw/ipmi/Kconfig +8 -0
@@ -3,12 +3,20 @@ config IPMI config IPMI_LOCAL bool + default y + depends on IPMI config IPMI_EXTERN bool + default y + depends on IPMI config ISA_IPMI_KCS bool + default y if PC + select IPMI config ISA_IPMI_BT bool + default y if PC + select IPMI
hw/mem/Kconfig +2 -0
@@ -6,3 +6,5 @@ config MEM_DEVICE config NVDIMM bool + default y + depends on I440FX || Q35
hw/misc/Kconfig +4 -0
@@ -1,5 +1,6 @@ config APPLESMC bool + default y if PC depends on ISA_BUS config MAX111X
@@ -19,10 +20,12 @@ config ISA_DEBUG config SGA bool + default y if PC depends on ISA_BUS config ISA_TESTDEV bool + default y if PC config PCI_TESTDEV bool
@@ -99,6 +102,7 @@ config IOTKIT_SYSINFO config PVPANIC bool + default y if PC depends on ISA_BUS config AUX
hw/pci-bridge/Kconfig +1 -0
@@ -5,6 +5,7 @@ config PCIE_PORT config PXB bool + default y if PC config XIO3130 bool
hw/timer/Kconfig +1 -0
@@ -15,6 +15,7 @@ config DS1338 config HPET bool + default y if PC config I8254 bool
Signature · 1 line
2.17.1
Re: [Qemu-devel] [RFC PATCH v3 41/43] i386-softmmu.mak: remove all CONFIG_* except boards definitions
Review
Quoted 4 lines · Yang Zhong
config
ACPI_NVDIMM
bool(quoted diff) +2
-0+ default y + depends on I440FX || Q35
This is "depends on PC".
hw/acpi/Kconfig config ACPI_MEMORY_HOTPLUG · line 30
Quoted 7 lines
config
ACPI_VMGENID
boolhw/acpi/Kconfig +2
-0+ default y + depends on I440FX || Q35 config IPMI bool
IPMI should have a "depends on PC" too.
Paolo
Re: [Qemu-devel] [RFC PATCH v3 41/43] i386-softmmu.mak: remove all CONFIG_* except boards definitions
Quoted 13 lines · Paolo Bonzini
Review
Quoted 4 lines · Yang Zhong
config
ACPI_NVDIMM
bool(quoted diff) +2
-0+ default y + depends on I440FX || Q35This is "depends on PC".
Quoted 5 lines
config
ACPI_VMGENID
bool(quoted diff) +2
-0+ default y + depends on I440FX || Q35
Quoted 4 lines
Quoted 2 lines
config IPMI
boolIPMI should have a "depends on PC" too.
config ISAPC selects PC, too, and I don't think that ISAPC has ACPI, has it?
Thomas
RFC PATCH v3 42/43 minikconf: implement allyesconfig, allnoconfig, randconfig, defconfig
In reply to Yang ZhongFrom: Paolo Bonzini <[email protected]>
Apart from defconfig (which is a no-op), the others are implemented implemented simply by ignoring the RHS of assignments and "default" statements. The RHS is replaced respectively by "true", "false" or a random value.
--- Makefile | 5 +++++ scripts/minikconf.py | 43 ++++++++++++++++++++++++++++++++++++------- 2 files changed, 41 insertions(+), 7 deletions(-)
Makefile +5 -0
@@ -336,6 +336,11 @@ MINIKCONF_ARGS = \ MINIKCONF = $(SHELL) $(SRC_PATH)/scripts/minikconf.sh +.PHONY: allyesconfig allnoconfig defconfig randconfig +allyesconfig allnoconfig defconfig randconfig: + rm */config-devices.mak config-all-devices.mak + $(MAKE) MINIKCONF="$(MINIKCONF) --$<" config-all-devices.mak + %/config-devices.mak: default-configs/%-softmmu.mak Kconfig.host hw/Kconfig $(call quiet-command, \ $(MINIKCONF) $@ $*-config-devices.mak.d $^ $(MINIKCONF_ARGS) > [email protected], " GEN [email protected]")
scripts/minikconf.py +36 -7
87 lines not on this page · raw message
Signature · 1 line
2.17.1
RFC PATCH v3 43/43 Makefile: only support defconfig
In reply to Yang Zhongadd CONFIG_VHOST_USER and CONFIG_LINUX in Kconfig.host, the current Makefile only support defconfig because of randconfig does not work.
--- Kconfig.host | 6 ++++++ Makefile | 16 ++++++++-------- hw/block/Kconfig | 2 ++ hw/scsi/Kconfig | 2 ++ hw/tpm/Kconfig | 2 ++ 5 files changed, 20 insertions(+), 8 deletions(-)
Kconfig.host +6 -0
@@ -16,3 +16,9 @@ config TPM config XEN bool + +config VHOST_USER + bool + +config LINUX + bool
Makefile +8 -8
@@ -312,6 +312,9 @@ endif SUBDIR_MAKEFLAGS=$(if $(V),,--no-print-directory --quiet) BUILD_DIR=$(BUILD_DIR) SUBDIR_DEVICES_MAK=$(patsubst %, %/config-devices.mak, $(TARGET_DIRS)) SUBDIR_DEVICES_MAK_DEP=$(patsubst %, %-config-devices.mak.d, $(TARGET_DIRS)) +SUBDIR_TARGET_MAK=$(patsubst %, %/config-target.mak, $(TARGET_DIRS)) + +-include $(SUBDIR_TARGET_MAK) ifeq ($(SUBDIR_DEVICES_MAK),) config-all-devices.mak:
@@ -332,16 +335,13 @@ MINIKCONF_ARGS = \ CONFIG_SPICE=$(CONFIG_SPICE) \ CONFIG_TPM=$(CONFIG_TPM) \ CONFIG_XEN=$(CONFIG_XEN) \ - CONFIG_OPENGL=$(CONFIG_OPENGL) - -MINIKCONF = $(SHELL) $(SRC_PATH)/scripts/minikconf.sh + CONFIG_OPENGL=$(CONFIG_OPENGL) \ + CONFIG_VHOST_USER=$(CONFIG_VHOST_USER) \ + CONFIG_LINUX=$(CONFIG_LINUX) -.PHONY: allyesconfig allnoconfig defconfig randconfig -allyesconfig allnoconfig defconfig randconfig: - rm */config-devices.mak config-all-devices.mak - $(MAKE) MINIKCONF="$(MINIKCONF) --$<" config-all-devices.mak +MINIKCONF = $(PYTHON) $(SRC_PATH)/scripts/minikconf.py --defconfig -%/config-devices.mak: default-configs/%-softmmu.mak Kconfig.host hw/Kconfig +%/config-devices.mak: default-configs/%.mak Kconfig.host $(SRC_PATH)/hw/Kconfig $(call quiet-command, \ $(MINIKCONF) $@ $*-config-devices.mak.d $^ $(MINIKCONF_ARGS) > [email protected], " GEN [email protected]") $(call quiet-command, if test -f $@; then \
hw/block/Kconfig +2 -0
@@ -33,3 +33,5 @@ config VIRTIO_BLK config VHOST_USER_BLK bool + default y + depends on VHOST_USER && LINUX
hw/scsi/Kconfig +2 -0
@@ -48,3 +48,5 @@ config VIRTIO_SCSI config VHOST_USER_SCSI bool + default y + depends on VHOST_USER && LINUX
hw/tpm/Kconfig +2 -0
@@ -13,6 +13,8 @@ config TPM_CRB config TPM_PASSTHROUGH bool + depends on TPM config TPM_EMULATOR bool + depends on TPM
Signature · 1 line
2.17.1
Quoted 43 lines · Yang Zhong
This
Kconfigimplementation is rebased from Paolo's branch
https://github.com/bonzini/qemu/commits/kconfigI rebased most of patches except non-x86 ARCHs dependency definitions this time.
https://github.com/yangzhon/qemu/commits/topic/upstream/KconfigThe current RFC patches only support
(*)x86_64platform build
Once design is fixed, we can do other archs.(*) defconfig
"randconfig" build has some issues, which are mostly related with CONFIG* inKconfig.hostabd configure. In randconfig mode, some CONFIG* has different setting value in config-host.mak and %/config-device.mak, which make QEMU build failure.(*)
Kconfigin hw/ directoryThe current configure and build command are same with previous commands and if we want to disable or enable some features, like "tcg", we still need add "--enable/--disable-tcg" in configure command line. If we want to disable one emulation device, we can disable this in related
Kconfigfile in hw/ directory.The current build command:
(*) ./configure --target-list=x86_64-softmmu
(*) make -j8Since the
Kconfiglanguage replace traditional CONFIG_* in default-config/%-softmmu.mak, the %-softmmu.mak file only define embeded boards or machines, like 440fx and Q35 inx86_64platform. TheKconfighas already defined dependency topology between differentKconfigfiles, but there are still some issues(*)
Kconfigfor configure(config-host.mak)
Some CONFIG* in configure need some logic to generate, those are hard to input this CONFIG* inKconfig.hostor Kconfig* file.(*)
Kconfigfor %config-target.mak
The CONFIG* in %/config-target.mak file, this is still related with configure.
Quoted 6 lines
(*) randconfig support issue.
Before this RFC patches, we have talked
Kconfigin another thread
http://lists.nongnu.org/archive/html/qemu-devel/2018-09/msg02827.htmlPlease give your comments on this RFC thread, many thanks!
I wonder whether we can support menuconfig as well? Right now entries have no description for menuconfig - can that be added?
Quoted 292 lines
Changes in v3:
patch 3: resume CONFIG_ACPI=y for ARM (Thomas Huth) patch 4: CONFIG_AN5206 for an5206.o and mcf5206.o (Thomas Huth) patch 6: CONFIG_VT82C686 is only in mips64el-softmmu.mak (Thomas Huth) patch 7: sort the new config switches into "# For Macs" and "# For embedded PPC" section (Thomas Huth) patch 8: sh7750.o and sh7750_regnames.o are "common" code, no need to define new CONFIG.(Thomas Huth) patch 12: CONFIG_NIOS2_10M50 replace CONFIG_NIOS2_10M50_BOARD(Thomas Huth) patch 13: added new CONFIGs for sifive_e.o and sifive_u.o(Thomas Huth)
CONFIG_RISCV_VIRTfor virt.o
patch 15~20:added for other non-x86 platforms(alpha/Kconfig, cris/Kconfig
hppa/Kconfig,unicore32/Kconfig,tricore/Kconfig,moxie/Kconfig openrisc/Kconfig)(Thomas Huth)
patch 25: sort the sources/*/Kconfig entries alphabetically(Thomas Huth)
added the new configs for arm/nios2/ppc/sh4/sparcpatch 29: E1000E_PCI with PCIE dependency(Thomas Huth) patch 30: CONFIG_ISA_BUS replace CONFIG_ISA(Thomas Huth) patch 32: changed the commit message (Paolo)(Thomas Huth) patch 41: "I440FX && Q35" was changedto "I440FX || Q35"(Thomas Huth)"default y" for
IPMI_LOCALandIPMI_EXTERNChanges in v2:
patch 1: added "CONFIG_PAM=y" in default-configs/i386-softmmu.mak
(Thomas Huth)
patch 3~14: added support for other ARCHs configurable(Paolo)patch 15: changed the annotate (Paolo) patch 16: changed the python code (Paolo) patch 19: added other ARCHs Kconfig files(Paolo) patch 21: added "select IDE_PCI" for CMD646, PIIX, VIA and SII3112(Thomas Huth) patch 22: added new patch for PCIE configurable. patch 23: moved "select IDE_PCI" from CMD646, PIIX, VIA to 21 patch(Thomas Huth)added "select
CAN_BUS" for net/Kconfig (Thomas Huth)
added "depends on PCI" forCAN_SJA1000(Paolo)
removedCONFIG_PCIE=yand add dependency for pcie(Paolo)
patch 26: added "depends on PSERIES" for "configSPAPR_VSCSI" (Thomas Huth)
USB_STORAGE_BOTandUSB_STORAGE_UASmust also "select SCSI"(Paolo)
patch 28: added "select SERIAL" into "configSERIAL_PCI" (Thomas Huth)
removed "depend onISA_BUS" from "config VGA_CIRRUS"(Thomas Huth)
patch 30: "configXLNX_ZYNQMP_ARM" is defined in hw/arm/Kconfig(Thomas Huth)
CONFIG_AUXshould select I2C(Paolo)
patch 33: depends on HYPERV forHYPERV_TESTDEV(Thomas Huth)
removed "select HYPERV" and "selectHYPERV_TESTDEV" with "default y if PC" in "config HYPERV" and "config HYPERV_TESTDEV"(Paolo)
patch 34: deleted default-configs/virtio.mak(Thomas Huth)
removed "y" in "config VIRTIO_MMIO"(Thomas Huth)
patch 35: removed remaining CONFIG_* and removed "select xxxx" from hw/i386/Kconfig
to other Kconfigs(Paolo)Paolo Bonzini (18):
build: actually useCONFIG_PAM
hw/i386/Makefile.objs: Build pc_piix* andpc_q35boards
minikconfig: add parser skeleton
minikconfig: add AST
minikconfig: add semantic analysis
kconfig: introduce kconfig files
build: switch toKconfig
ide: express dependencies withKconfig
build: convert pci.mak toKconfig
build: convert sound.mak toKconfig
build: convert usb.mak toKconfig
scsi: express dependencies withKconfig
bluetooth: express dependencies withKconfig
isa: express dependencies with kconfig
i386: express dependencies withKconfig
i2c: express dependencies withKconfig
ptimer: express dependencies withKconfig
minikconf: implement allyesconfig, allnoconfig, randconfig, defconfigYang Zhong (17):
hw/arm/Makefile.objs:CONFIG_VIRTcreated for virt board hw/nios2/Makefile.objs: Conditionally build nios2 hw/riscv/Makefile.objs: Create CONFIG_* for riscv boards hw/sparc64/Makefile.objs: Create CONFIG_* for sparc64 hw/alpha/Makefile.objs: Create CONFIG_* for alpha hw/cris/Makefile.objs: Create CONFIG_* for cris hw/hppa/Makefile.objs: Create CONFIG_* for hppa hw/moxie/Makefile.objs: Conditionally build moxie hw/openrisc/Makefile.objs: Create CONFIG_* for openrisc hw/tricore/Makefile.objs: Create CONFIG_* for tricore hw/display: make edid configurable hw/pci/Makefile.objs: make pcie configurable
edid: express dependencies with kconfig
hyperv: express dependencies with kconfig
virtio: make virtio dependencies withKconfigi386-softmmu.mak: remove all CONFIG_* except boards definitions
Makefile: only support defconfigÁkos Kovács (8):
hw/m68k/Makefile.objs: Conditionally build boards hw/microblaze/Makefile.objs: Create configs for petalogix and xilinx
boards
hw/mips/Makefile.objs: Create CONFIG_* for r4k, malta,mipssim boards hw/ppc/Makefile.objs: Build all boards conditinally with CONFIG_* hw/sh4/Makefile.objs: New CONFIG_* varibales created for sh4 boards
and device
hw/sparc/Makefile.objs: CONFIG_* for sun4m and leon3 created hw/lm32/Makefile.objs: Conditionally build lm32 and milkmyst hw/xtensa/Makefile.objs: Buildxtensa_simandxtensa_fpga
conditionallyKconfig.host | 24 + Makefile | 19 +- Makefile.target | 7 +- default-configs/alpha-softmmu.mak | 7 +- default-configs/arm-softmmu.mak | 5 +- default-configs/cris-softmmu.mak | 1 + default-configs/hppa-softmmu.mak | 5 +- default-configs/hyperv.mak | 2 - default-configs/i386-softmmu.mak | 72 +-- default-configs/m68k-softmmu.mak | 2 + default-configs/microblaze-softmmu.mak | 3 + default-configs/mips-softmmu-common.mak | 8 +- default-configs/moxie-softmmu.mak | 1 + default-configs/nios2-softmmu.mak | 1 + default-configs/or1k-softmmu.mak | 1 + default-configs/pci.mak | 49 -- default-configs/ppc-softmmu.mak | 12 +- default-configs/riscv32-softmmu.mak | 11 +- default-configs/riscv64-softmmu.mak | 11 +- default-configs/s390x-softmmu.mak | 1 - default-configs/sh4-softmmu.mak | 5 +- default-configs/sh4eb-softmmu.mak | 5 +- default-configs/sound.mak | 4 - default-configs/sparc-softmmu.mak | 2 + default-configs/sparc64-softmmu.mak | 5 +- default-configs/tricore-softmmu.mak | 1 + default-configs/usb.mak | 11 - default-configs/virtio.mak | 14 - default-configs/xtensa-softmmu.mak | 3 + default-configs/xtensaeb-softmmu.mak | 3 + hw/9pfs/Kconfig | 4 + hw/Kconfig | 69 +++ hw/Makefile.objs | 4 +- hw/acpi/Kconfig | 30 ++ hw/adc/Kconfig | 2 + hw/alpha/Kconfig | 5 + hw/alpha/Makefile.objs | 4 +- hw/arm/Kconfig | 113 ++++ hw/arm/Makefile.objs | 3 +- hw/audio/Kconfig | 52 ++ hw/block/Kconfig | 37 ++ hw/bt/Kconfig | 2 + hw/char/Kconfig | 42 ++ hw/core/Kconfig | 11 + hw/cpu/Kconfig | 8 + hw/cris/Kconfig | 2 + hw/cris/Makefile.objs | 2 +- hw/display/Kconfig | 106 ++++ hw/display/Makefile.objs | 4 +- hw/dma/Kconfig | 20 + hw/gpio/Kconfig | 9 + hw/hppa/Kconfig | 5 + hw/hppa/Makefile.objs | 4 +- hw/hyperv/Kconfig | 9 + hw/i2c/Kconfig | 27 + hw/i2c/Makefile.objs | 7 +- hw/i386/Kconfig | 87 +++ hw/i386/Makefile.objs | 4 +- hw/ide/Kconfig | 54 ++ hw/input/Kconfig | 28 + hw/intc/Kconfig | 55 ++ hw/ipack/Kconfig | 4 + hw/ipmi/Kconfig | 22 + hw/isa/Kconfig | 30 ++ hw/lm32/Kconfig | 5 + hw/lm32/Makefile.objs | 4 +- hw/m68k/Kconfig | 8 + hw/m68k/Makefile.objs | 4 +- hw/mem/Kconfig | 10 + hw/microblaze/Kconfig | 8 + hw/microblaze/Makefile.objs | 6 +- hw/mips/Kconfig | 20 + hw/mips/Makefile.objs | 6 +- hw/misc/Kconfig | 110 ++++ hw/misc/macio/Kconfig | 11 + hw/moxie/Kconfig | 2 + hw/moxie/Makefile.objs | 2 +- hw/net/Kconfig | 122 +++++ hw/nios2/Kconfig | 5 + hw/nios2/Makefile.objs | 3 +- hw/nvram/Kconfig | 8 + hw/openrisc/Kconfig | 2 + hw/openrisc/Makefile.objs | 2 +- hw/pci-bridge/Kconfig | 25 + hw/pci-host/Kconfig | 46 ++ hw/pci-host/Makefile.objs | 2 +- hw/pci/Kconfig | 5 + hw/pci/Makefile.objs | 5 +- hw/pcmcia/Kconfig | 2 + hw/ppc/Kconfig | 56 ++ hw/ppc/Makefile.objs | 12 +- hw/riscv/Kconfig | 14 + hw/riscv/Makefile.objs | 22 +- hw/scsi/Kconfig | 52 ++ hw/scsi/Makefile.objs | 2 +- hw/sd/Kconfig | 14 + hw/sh4/Kconfig | 11 + hw/sh4/Makefile.objs | 4 +- hw/smbios/Kconfig | 2 + hw/sparc/Kconfig | 11 + hw/sparc/Makefile.objs | 4 +- hw/sparc64/Kconfig | 5 + hw/sparc64/Makefile.objs | 6 +- hw/ssi/Kconfig | 14 + hw/timer/Kconfig | 63 +++ hw/tpm/Kconfig | 20 + hw/tricore/Kconfig | 2 + hw/tricore/Makefile.objs | 2 +- hw/unicore32/Kconfig | 2 + hw/usb/Kconfig | 92 ++++ hw/vfio/Kconfig | 11 + hw/virtio/Kconfig | 27 + hw/watchdog/Kconfig | 15 + hw/xtensa/Kconfig | 5 + hw/xtensa/Makefile.objs | 4 +- rules.mak | 2 +- scripts/make_device_config.sh | 30 -- scripts/minikconf.py | 680 ++++++++++++++++++++++++ 118 files changed, 2502 insertions(+), 265 deletions(-) create mode 100644 Kconfig.host delete mode 100644 default-configs/hyperv.mak delete mode 100644 default-configs/pci.mak delete mode 100644 default-configs/sound.mak delete mode 100644 default-configs/usb.mak delete mode 100644 default-configs/virtio.mak create mode 100644 hw/9pfs/Kconfig create mode 100644 hw/Kconfig create mode 100644 hw/acpi/Kconfig create mode 100644 hw/adc/Kconfig create mode 100644 hw/alpha/Kconfig create mode 100644 hw/arm/Kconfig create mode 100644 hw/audio/Kconfig create mode 100644 hw/block/Kconfig create mode 100644 hw/bt/Kconfig create mode 100644 hw/char/Kconfig create mode 100644 hw/core/Kconfig create mode 100644 hw/cpu/Kconfig create mode 100644 hw/cris/Kconfig create mode 100644 hw/display/Kconfig create mode 100644 hw/dma/Kconfig create mode 100644 hw/gpio/Kconfig create mode 100644 hw/hppa/Kconfig create mode 100644 hw/hyperv/Kconfig create mode 100644 hw/i2c/Kconfig create mode 100644 hw/i386/Kconfig create mode 100644 hw/ide/Kconfig create mode 100644 hw/input/Kconfig create mode 100644 hw/intc/Kconfig create mode 100644 hw/ipack/Kconfig create mode 100644 hw/ipmi/Kconfig create mode 100644 hw/isa/Kconfig create mode 100644 hw/lm32/Kconfig create mode 100644 hw/m68k/Kconfig create mode 100644 hw/mem/Kconfig create mode 100644 hw/microblaze/Kconfig create mode 100644 hw/mips/Kconfig create mode 100644 hw/misc/Kconfig create mode 100644 hw/misc/macio/Kconfig create mode 100644 hw/moxie/Kconfig create mode 100644 hw/net/Kconfig create mode 100644 hw/nios2/Kconfig create mode 100644 hw/nvram/Kconfig create mode 100644 hw/openrisc/Kconfig create mode 100644 hw/pci-bridge/Kconfig create mode 100644 hw/pci-host/Kconfig create mode 100644 hw/pci/Kconfig create mode 100644 hw/pcmcia/Kconfig create mode 100644 hw/ppc/Kconfig create mode 100644 hw/riscv/Kconfig create mode 100644 hw/scsi/Kconfig create mode 100644 hw/sd/Kconfig create mode 100644 hw/sh4/Kconfig create mode 100644 hw/smbios/Kconfig create mode 100644 hw/sparc/Kconfig create mode 100644 hw/sparc64/Kconfig create mode 100644 hw/ssi/Kconfig create mode 100644 hw/timer/Kconfig create mode 100644 hw/tpm/Kconfig create mode 100644 hw/tricore/Kconfig create mode 100644 hw/unicore32/Kconfig create mode 100644 hw/usb/Kconfig create mode 100644 hw/vfio/Kconfig create mode 100644 hw/virtio/Kconfig create mode 100644 hw/watchdog/Kconfig create mode 100644 hw/xtensa/Kconfig delete mode 100644 scripts/make_device_config.sh create mode 100644 scripts/minikconf.pySignature · 1 line
2.17.1
Quoted 4 lines · Michael S. Tsirkin
I wonder whether we can support menuconfig as well? Right now entries have no description for menuconfig - can that be added?
The problem with menuconfig is that QEMU has many configurations (one per target), not just one. Also, Kconfig has some Linux quirks that are different from QEMU quirks (for example QEMU needs to know about symbols found by probing the host in ./configure), so it's difficult to use it as is; we tried it in Google Summer of Code 2013 and it was not successful.
Paolo