Skip to content

Commit caf02ab

Browse files
robbat2bjorn-helgaas
authored andcommitted
PCI: Add QEMU top-level IDs for (sub)vendor & device
Introduce PCI_VENDOR/PCI_SUBVENDOR/PCI_SUBDEVICE defines to replace the constants scattered in the kernel already used to detect QEMU. They are defined in the QEMU codebase per docs/specs/pci-ids.txt. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Reviewed-by: Takashi Iwai <tiwai@suse.de> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
1 parent 9289b9d commit caf02ab

File tree

5 files changed

+12
-7
lines changed

5 files changed

+12
-7
lines changed

drivers/gpu/drm/bochs/bochs_drv.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,8 @@ static const struct pci_device_id bochs_pci_tbl[] = {
182182
{
183183
.vendor = 0x1234,
184184
.device = 0x1111,
185-
.subvendor = 0x1af4,
186-
.subdevice = 0x1100,
185+
.subvendor = PCI_SUBVENDOR_ID_REDHAT_QUMRANET,
186+
.subdevice = PCI_SUBDEVICE_ID_QEMU,
187187
.driver_data = BOCHS_QEMU_STDVGA,
188188
},
189189
{

drivers/gpu/drm/cirrus/cirrus_drv.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,9 @@ static struct drm_driver driver;
3333

3434
/* only bind to the cirrus chip in qemu */
3535
static const struct pci_device_id pciidlist[] = {
36-
{ PCI_VENDOR_ID_CIRRUS, PCI_DEVICE_ID_CIRRUS_5446, 0x1af4, 0x1100, 0,
37-
0, 0 },
36+
{ PCI_VENDOR_ID_CIRRUS, PCI_DEVICE_ID_CIRRUS_5446,
37+
PCI_SUBVENDOR_ID_REDHAT_QUMRANET, PCI_SUBDEVICE_ID_QEMU,
38+
0, 0, 0 },
3839
{ PCI_VENDOR_ID_CIRRUS, PCI_DEVICE_ID_CIRRUS_5446, PCI_VENDOR_ID_XEN,
3940
0x0001, 0, 0, 0 },
4041
{0,}

drivers/virtio/virtio_pci_common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ static const struct dev_pm_ops virtio_pci_pm_ops = {
467467

468468
/* Qumranet donated their vendor ID for devices 0x1000 thru 0x10FF. */
469469
static const struct pci_device_id virtio_pci_id_table[] = {
470-
{ PCI_DEVICE(0x1af4, PCI_ANY_ID) },
470+
{ PCI_DEVICE(PCI_VENDOR_ID_REDHAT_QUMRANET, PCI_ANY_ID) },
471471
{ 0 }
472472
};
473473

include/linux/pci_ids.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2506,6 +2506,10 @@
25062506

25072507
#define PCI_VENDOR_ID_AZWAVE 0x1a3b
25082508

2509+
#define PCI_VENDOR_ID_REDHAT_QUMRANET 0x1af4
2510+
#define PCI_SUBVENDOR_ID_REDHAT_QUMRANET 0x1af4
2511+
#define PCI_SUBDEVICE_ID_QEMU 0x1100
2512+
25092513
#define PCI_VENDOR_ID_ASMEDIA 0x1b21
25102514

25112515
#define PCI_VENDOR_ID_CIRCUITCO 0x1cc8

sound/pci/intel8x0.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2980,8 +2980,8 @@ static int snd_intel8x0_inside_vm(struct pci_dev *pci)
29802980
goto fini;
29812981

29822982
/* check for known (emulated) devices */
2983-
if (pci->subsystem_vendor == 0x1af4 &&
2984-
pci->subsystem_device == 0x1100) {
2983+
if (pci->subsystem_vendor == PCI_SUBVENDOR_ID_REDHAT_QUMRANET &&
2984+
pci->subsystem_device == PCI_SUBDEVICE_ID_QEMU) {
29852985
/* KVM emulated sound, PCI SSID: 1af4:1100 */
29862986
msg = "enable KVM";
29872987
} else if (pci->subsystem_vendor == 0x1ab8) {

0 commit comments

Comments
 (0)