@@ -290,6 +290,49 @@ $CFG --enable KVM
290290$CFG --enable KVM_INTEL
291291$CFG --enable KVM_AMD
292292
293+ # --- strip defconfig hardware a virtio guest has no bus to find --------------
294+ # Everything above *adds* to x86_64_defconfig, which is a general-purpose
295+ # desktop/server config: it pins a pile of physical-hardware drivers =y that
296+ # this kernel can never reach, on any of the hypervisors we target. They cost
297+ # image size and boot-time probing and buy nothing.
298+ #
299+ # This is deliberately the conservative subset. Plenty of other defconfig
300+ # leftovers (sound, HID/PS2, ATA/SATA, SELinux-without-an-LSM-entry, the debug
301+ # options) are just as unreachable, but each needs its own argument about what
302+ # userland might still poke at, so they stay for now.
303+
304+ # No wifi in a microVM; defconfig carries the whole 802.11 stack =y.
305+ nope CFG80211 MAC80211 RFKILL
306+
307+ # Physical NIC drivers: defconfig pins E1000/E1000E/IGB/R8169/TIGON3/SKY2/
308+ # FORCEDETH/8139TOO/E100/NET_TULIP =y. Only the vendor-driver menu goes —
309+ # NETDEVICES and VIRTIO_NET stay.
310+ nope ETHERNET
311+
312+ # The rootfs arrives over virtiofs or virtio-blk, never NFS. NETWORK_FILESYSTEMS
313+ # itself has to stay: 9P_FS lives under it, and 9p is wanted above.
314+ nope NFS_FS ROOT_NFS SUNRPC
315+
316+ # None of our hypervisors emulate a USB controller, so xhci/ehci/ohci/uhci plus
317+ # usb-storage and usb-hid are unreachable.
318+ nope USB_SUPPORT
319+
320+ # Assorted defconfig hardware with no virtio-guest analogue. Note VIRTIO_IOMMU
321+ # is a different symbol and is still wanted above — what goes here are the
322+ # drivers for real Intel/AMD IOMMUs.
323+ nope INTEL_IOMMU AMD_IOMMU
324+ nope PCCARD YENTA AGP HOTPLUG_PCI
325+ nope MACINTOSH_DRIVERS NVRAM WATCHDOG DMADEVICES
326+ nope BLK_DEV_MD # keep BLK_DEV_DM — wanted above
327+ nope HIBERNATION
328+ nope KEXEC CRASH_DUMP
329+ nope QUOTA
330+ nope I2C HPET
331+ # Not in that list: EFI_STUB. On x86 it's a promptable symbol and --disable
332+ # works, but on arm64 it's a bare `bool` that CONFIG_EFI selects, so the only
333+ # way to drop it there is to turn off UEFI support entirely — a much bigger
334+ # call on arm64 than the handful of KiB it saves.
335+
293336# Resolve any new dependencies / silently drop options renamed upstream.
294337make olddefconfig
295338
0 commit comments