mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-23 09:47:44 +00:00
hv: implement msi.c to handle MSI remapping for vm0
Emulate MSI Capability structure for vm0 in sharing mode: - it intercepts the IO requests for MSI Capability structure, emulates the Message Control word, and bypasses all other I/O requests to the physical device. - criteria to trigger MSI remapping: MSI Enable bit is being changed, Message Data/Addr is being changed when MSI Enable is set. Tracked-On: #1568 Signed-off-by: dongshen <dongsheng.x.zhang@intel.com> Signed-off-by: Zide Chen <zide.chen@intel.com> Reviewed-by: Zhao Yakui <yakui.zhao@intel.com> Acked-by: Anthony Xu <anthony.xu@intel.com>
This commit is contained in:
@@ -161,6 +161,7 @@ static inline bool pci_bar_access(uint32_t offset)
|
||||
|
||||
uint32_t pci_pdev_read_cfg(union pci_bdf bdf, uint32_t offset, uint32_t bytes);
|
||||
void pci_pdev_write_cfg(union pci_bdf bdf, uint32_t offset, uint32_t bytes, uint32_t val);
|
||||
void enable_disable_pci_intx(union pci_bdf bdf, bool enable);
|
||||
|
||||
void pci_scan_bus(pci_enumeration_cb cb, void *data);
|
||||
|
||||
|
@@ -59,6 +59,12 @@ struct pci_pdev {
|
||||
union pci_bdf bdf;
|
||||
};
|
||||
|
||||
/* MSI capability structure */
|
||||
struct msi {
|
||||
uint32_t capoff;
|
||||
uint32_t caplen;
|
||||
};
|
||||
|
||||
struct pci_vdev {
|
||||
struct pci_vdev_ops *ops;
|
||||
struct vpci *vpci;
|
||||
@@ -71,6 +77,10 @@ struct pci_vdev {
|
||||
|
||||
/* The bar info of the virtual PCI device. */
|
||||
struct pci_bar bar[PCI_BAR_COUNT];
|
||||
|
||||
#ifndef CONFIG_PARTITION_MODE
|
||||
struct msi msi;
|
||||
#endif
|
||||
};
|
||||
|
||||
struct pci_addr_info {
|
||||
|
Reference in New Issue
Block a user