The note is available in HackMD.
This is the original method in kvm-host (src/pci.c
, commit: 93f1fee):
Usage:
In src/virtio-pci.c
:
Definitions:
In /usr/include/linux/pci_regs.h
:
In src/pci.h
:
Therefore, the pci_set_bar()
in virtio_pci_init()
does the followings:
According to the BAR settings, we have to configure:
PCI_BASE_ADDRESS_SPACE_MEMORY = 0x00
to bool bar_is_io_space[6];
The fix applied in commit c4b325e replaces individual BAR flags with one layout
parameter.
Users are required to indicate the correct flags via layout
, as demonstrated below:
The pci_set_bar()
function writes the layout directly into the BAR and extracts the boolean bar_is_io_space
from bit 0 of the layout.
VIRTIO_NET_IRQ
is defined in src/arch/x86/desc.h
:
but not in arm64.
Below is the compliation error log in arm64 platform.