mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-16 22:39:29 +00:00
dm/VBS-U: implement virtio_set_modern_bar
virtio_set_modern_bar is an external interface that backend virtio driver can call to initialize the PCI capabilities and PCI bars defined in the virtio 1.0 spec. The following are done in the function: - 5 PCI capabilities are added to the PCI configuration space of the virtio PCI device. (common/isr/device_specific/notify/cfg_access) - A 64-bit MMIO bar is allocated to accommodate the registers defined in the 4 PCI capabilities. (cfg_access capability does not require MMIO.) - If use_notify_pio is true, a PIO notify capability is added to the PCI configuration space and a PIO bar is allocated for it accordingly. Signed-off-by: Jian Jun Chen <jian.jun.chen@intel.com> Reviewed-by: Hao Li <hao.l.li@intel.com> Reviewed-by: Zhao Yakui <yakui.zhao@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
@@ -839,6 +839,21 @@ uint64_t virtio_pci_read(struct vmctx *ctx, int vcpu, struct pci_vdev *dev,
|
||||
*/
|
||||
void virtio_pci_write(struct vmctx *ctx, int vcpu, struct pci_vdev *dev,
|
||||
int baridx, uint64_t offset, int size, uint64_t value);
|
||||
|
||||
/**
|
||||
* @brief Set modern BAR (usually 4) to map PCI config registers.
|
||||
*
|
||||
* Set modern MMIO BAR (usually 4) to map virtio 1.0 capabilities and optional
|
||||
* set modern PIO BAR (usually 2) to map notify capability. This interface is
|
||||
* only valid for modern virtio.
|
||||
*
|
||||
* @param base Pointer to struct virtio_base.
|
||||
* @param use_notify_pio Whether use pio for notify capability.
|
||||
*
|
||||
* @return 0 on success and non-zero on fail.
|
||||
*/
|
||||
int virtio_set_modern_bar(struct virtio_base *base, bool use_notify_pio);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
Reference in New Issue
Block a user