qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 00/10] Kconfig vs. default devices
@ 2023-02-08 19:26 Fabiano Rosas
  2023-02-08 19:26 ` [PATCH v2 04/10] hw/i386: Select E1000_PCI for i440fx Fabiano Rosas
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Fabiano Rosas @ 2023-02-08 19:26 UTC (permalink / raw)
  To: qemu-devel; +Cc: Thomas Huth

v2:
Applying the feedback received, all small tweaks.

Patch 6 still needs consensus on whether to apply the fix to Kconfig
or elsewhere. Link to the previous version:
https://lore.kernel.org/r/461ba038-31bf-49c4-758b-94ece36f136f@redhat.com

changelog:

- patch 1: moved isa-parallel to a build time check like the other
           patches;
- patch 3: tweaked commit message;
- patch 7: removed the default from XLNX_USB_SUBSYS.

v1:
https://lore.kernel.org/r/20230206140809.26028-1-farosas@suse.de

We currently have a situation where disabling a Kconfig might result
in a runtime error when QEMU selects the corresponding device as a
default value for an option. But first a disambiguation:

Kconfig default::
  a device "Foo" for which there's "config FOO default y" or "config X
  imply FOO" in Kconfig.

QEMU hardcoded default::
  a fallback; a device "Foo" that is chosen in case no corresponding
  option is given in the command line.

The issue I'm trying to solve is that there is no link between the two
"defaults" above, which means that when the user at build time
de-selects a Kconfig default, either via configs/devices/*/*.mak or
--without-default-devices, the subsequent invocation at runtime might
continue to try to create the missing device due to QEMU defaults.

Even a experienced user that tweaks the build via .mak files is not
required to know about what QEMU developers chose to use as fallbacks
in the code. Moreover, the person/entity that builds the code might
not be the same that runs it, which makes it even more confusing.

We do have -nodefaults in the command line, but that doesn't include
all types of fallbacks that might be set in the code. It also does not
cover individual CONFIGs and their respective use as a fallback in the
code.

So my proposal here is actually simple: Let's make sure every fallback
device creation *without* a validation check gets a hard dependency in
Kconfig. A validation check being something like:

if (has_defaults && object_get_class("foo") {
   create_foo();
}

Fabiano Rosas (10):
  hw/i386: Select CONFIG_PARALLEL for PC machines
  hw/i386: Select E1000E for q35
  hw/i386: Select VGA_PCI in Kconfig
  hw/i386: Select E1000_PCI for i440fx
  hw/arm: Select VIRTIO_NET for virt machine
  hw/arm: Select VIRTIO_BLK for virt machine
  hw/arm: Select XLNX_USB_SUBSYS for xlnx-zcu102 machine
  hw/arm: Select GICV3_TCG for sbsa-ref machine
  hw/arm: Select e1000e for sbsa-ref machine
  hw/arm: Select VGA_PCI for sbsa-ref machine

 hw/arm/Kconfig  | 7 +++++++
 hw/i386/Kconfig | 8 ++++----
 hw/usb/Kconfig  | 1 -
 3 files changed, 11 insertions(+), 5 deletions(-)

-- 
2.35.3



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-05-02 15:28 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-08 19:26 [PATCH v2 00/10] Kconfig vs. default devices Fabiano Rosas
2023-02-08 19:26 ` [PATCH v2 04/10] hw/i386: Select E1000_PCI for i440fx Fabiano Rosas
2023-02-08 19:26 ` [PATCH v2 05/10] hw/arm: Select VIRTIO_NET for virt machine Fabiano Rosas
2023-02-08 19:43 ` [PATCH v2 00/10] Kconfig vs. default devices Philippe Mathieu-Daudé
2023-02-09  5:43   ` Thomas Huth
2023-05-02 15:20     ` Alex Bennée
     [not found] ` <20230208192654.8854-2-farosas@suse.de>
2023-02-09 10:22   ` [PATCH v2 01/10] hw/i386: Select CONFIG_PARALLEL for PC machines Thomas Huth
2023-05-02 15:26 ` [PATCH v2 00/10] Kconfig vs. default devices Alex Bennée

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).