STRUCT VIRTIO_PCI_MODERN_DEVICE(9)
πΈ 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 configdeviceβ 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 notificationsisrβ 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-vqnotify_offset_multiplierβ multiplyqueue_notify_offby this value (non-legacy mode).modern_barsβ bitmask of BARsidβ device and vendor id π·οΈdevice_id_checkβ callback defined beforevp_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 orERRNOπdma_maskβ optional mask instead of the traditionalDMA_BIT_MASK(64), for vendor devices with DMA space address limitations π§
ngl, thatdevice_id_checkone 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 orERRNO. 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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms