mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
A virtqueue notification (doorbell) is normally delivered to the device through an ioeventfd registered on the notify address, so a plain MMIO write to the notify register is consumed by the hypervisor and never reaches write_bar(). It does reach write_bar() when the driver rings the doorbell through the VIRTIO_PCI_CAP_PCI_CFG window (write_cap_pci_cfg -> write_bar) instead of a mapped BAR, or on backends that deliver the write to the VMM such as SEV-SNP. The notification arm of write_bar() only re-signalled the matching queue eventfd under the sev_snp feature and logged an error otherwise, so a doorbell delivered through the PCI_CFG window was silently dropped on standard builds and the queue was never processed. The virtio spec allows driving the device purely through the PCI_CFG window, so signal the matching queue eventfd for any doorbell that reaches write_bar() on every build. Add unit tests that ring a queue's doorbell via write_bar() and assert only the addressed queue's eventfd is signalled. Signed-off-by: Wei Liu <liuwe@microsoft.com> Assisted-by: Copilot:Opus-4.8