STRUCT VIRTIO_PCI_MODERN_DEVICE(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 STRUCT VIRTIO_PCI_MODERN_DEVICE(9) 🌸

okay bestie, gather round πŸ’– so this is a page from the Kernel API Manual β€” it's the struct virtio_pci_modern_device, and it's literally just the info bucket for modern PCI virtio. that's the whole NAME vibe: lowkey the modern PCI virtio info holder, no cap ✨


✨ SYNOPSIS ✨

here's the whole struct, copied exactly, do not touch a single character or i stg πŸ‘‘

struct virtio_pci_modern_device {
    struct pci_dev *pci_dev;
    struct virtio_pci_common_cfg __iomem *common;
    void __iomem *device;
    void __iomem *notify_base;
    resource_size_t notify_pa;
    u8 __iomem *isr;
    size_t notify_len;
    size_t device_len;
    size_t common_len;
    int notify_map_cap;
    u32 notify_offset_multiplier;
    int modern_bars;
    struct virtio_device_id id;
    int (*device_id_check)(struct pci_dev *pdev);
    u64 dma_mask;
 };

πŸŽ€ Members πŸŽ€

these are the fields, and every single one matters, so let's go one by one like a proper group chat roll call 🫢

  • pci_dev β€” ptr to the PCI device struct πŸ’…
  • common β€” where the common capability lives in the PCI config
  • device β€” device-specific data (non-legacy mode), iconic behavior only πŸ¦‹
  • notify_base β€” base of vq notifications (non-legacy mode)
  • notify_pa β€” the physical base of vq notifications
  • isr β€” where to read and clear the interrupt ⭐
  • notify_len β€” so we can sanity-check accesses πŸ‘€
  • device_len β€” same deal, so we can sanity-check accesses πŸ‘€
  • notify_map_cap β€” capability for when we need to map notifications per-vq
  • notify_offset_multiplier β€” multiply queue_notify_off by this value (non-legacy mode).
  • modern_bars β€” bitmask of BARs
  • id β€” device and vendor id 🏷️
  • device_id_check β€” callback defined before vp_modern_probe, used to verify the PCI device is a vendor's expected device rather than the standard virtio PCI device. returns the found device id or ERRNO 😭
  • dma_mask β€” optional mask instead of the traditional DMA_BIT_MASK(64), for vendor devices with DMA space address limitations 🧚
ngl, that device_id_check one is doing a lot of work in one line, so read it twice bestie β€” it's the vendor-vs-standard-virtio check, and it hands back either the found device id or ERRNO. fr fr. πŸ’€

πŸ”₯ SEE ALSO πŸ”₯

  • Kernel file ./include/linux/virtio_pci_modern.h

and that's the whole thing, periodt πŸ’œ this lil' page is served straight from ./include/linux, dated October 2026, and yeah the header up top is abbreviated as struct virt...odern_device(9) because terminals are dramatic like that β€” anyway ily, go read the actual header, mwah πŸ“βœ¨

πŸ“¦ where this page comes from