]> git.ipfire.org Git - thirdparty/qemu.git/commit
vfio/pci: Introduce x-pci-class-code option
authorTomita Moeko <tomitamoeko@gmail.com>
Tue, 8 Jul 2025 14:52:11 +0000 (22:52 +0800)
committerCédric Le Goater <clg@redhat.com>
Tue, 15 Jul 2025 15:11:12 +0000 (17:11 +0200)
commita59d06305fff9d10ddeeaebc66590af422362701
tree63c9a19753584f4e4271393faf73ad62b126ec45
parent622740aad9f39c4266ce00d7478b32c7506e6642
vfio/pci: Introduce x-pci-class-code option

Introduce x-pci-class-code option to allow users to override PCI class
code of a device, similar to the existing x-pci-vendor-id option. Only
the lower 24 bits of this option are used, though a uint32 is used here
for determining whether the value is valid and set by user.

Additionally, to ensure VGA ranges are only exposed on VGA devices,
pci_register_vga() is now called in vfio_pci_config_setup(), after
the class code override is completed.

This is mainly intended for IGD devices that expose themselves either
as VGA controller (primary display) or Display controller (non-primary
display). The UEFI GOP driver depends on the device reporting a VGA
controller class code (0x030000).

Signed-off-by: Tomita Moeko <tomitamoeko@gmail.com>
Reviewed-by: Alex Williamson <alex.williamson@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20250708145211.6179-1-tomitamoeko@gmail.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
hw/vfio/pci.c
hw/vfio/pci.h
hw/vfio/trace-events