[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: missing entries from docs/specs/pci-ids.txt ?

From: Gerd Hoffmann
Subject: Re: missing entries from docs/specs/pci-ids.txt ?
Date: Thu, 29 Sep 2022 15:31:44 +0200

On Tue, Sep 27, 2022 at 01:05:36PM +0100, Peter Maydell wrote:
> I noticed today that docs/specs/pci-ids.txt doesn't have
> an entry for the virtio-iommu, which is defined in pci.h as
> #define PCI_DEVICE_ID_VIRTIO_IOMMU       0x1014
> There seem to be a few other virtio ID values defined in the
> header but not in the txt file too -- do we need to update it?


> Conversely, none of the "modern" ID values in the txt file seem
> to have a #define. I suspect I'm missing something about how
> this works.

Added a short paragraph explaining this.

Not sure what to do with the modern device list.  Add everything ?
Or just point to include/standard-headers/linux/virtio_ids.h ?

take care,

commit 4dac16edd97dd7bdf499f3cedd725a6a87523510
Author: Gerd Hoffmann <kraxel@redhat.com>
Date:   Thu Sep 29 15:25:19 2022 +0200

    pci-ids: sync docs + header
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>

diff --git a/docs/specs/pci-ids.txt b/docs/specs/pci-ids.txt
index dd6859d039d0..628b87c29dfa 100644
--- a/docs/specs/pci-ids.txt
+++ b/docs/specs/pci-ids.txt
@@ -15,6 +15,9 @@ The 1000 -> 10ff device ID range is used as follows for 
virtio-pci devices.
 Note that this allocation separate from the virtio device IDs, which are
 maintained as part of the virtio specification.
+Modern virtio-pci devices have a strict id mapping and the rule is:
+pci-device-id = 0x1040 + virtio-device-id
 1af4:1000  network device (legacy)
 1af4:1001  block device (legacy)
 1af4:1002  balloon device (legacy)
@@ -22,6 +25,10 @@ maintained as part of the virtio specification.
 1af4:1004  SCSI host bus adapter device (legacy)
 1af4:1005  entropy generator device (legacy)
 1af4:1009  9p filesystem device (legacy)
+1af4:1012  vsock device (legacy)
+1af4:1013  pmem device (legacy)
+1af4:1014  iommu device (legacy)
+1af4:1015  mem device (legacy)
 1af4:1041  network device (modern)
 1af4:1042  block device (modern)
diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h
index b54b6ef88fc3..3b852199660c 100644
--- a/include/hw/pci/pci.h
+++ b/include/hw/pci/pci.h
@@ -71,7 +71,12 @@ extern bool pci_available;
 #define PCI_DEVICE_ID_INTEL_82557        0x1229
 #define PCI_DEVICE_ID_INTEL_82801IR      0x2922
-/* Red Hat / Qumranet (for QEMU) -- see pci-ids.txt */
+ * Red Hat / Qumranet (for QEMU)
+ *
+ * These are documented in docs/specs/pci-ids.txt
+ */
 #define PCI_SUBDEVICE_ID_QEMU            0x1100

reply via email to

[Prev in Thread] Current Thread [Next in Thread]