HV: add uint64_t bar_base_mapped[PCI_BAR_COUNT] to struct pci_vdev

To remember the previously mapped/registered vbar base

For the following reasons:
 register_mmio_emulation_handler() will throw an error if the the same addr_lo is
 alreayd registered before

 We are going to remove the base member from struct pci_bar, so we cannot use vdev->bar[idx].base
 in the code any more

 In subsequent commits, we will assume vdev_pt_remap_generic_mem_vbar() is called after a new
 vbar base is set, mainly because of 64-bit mmio bar handling, so we need a
 separate bar_base_mapped[] array to track the previously mapped vbar bases.

Tracked-On: #3241
Signed-off-by: dongshen <dongsheng.x.zhang@intel.com>
Reviewed-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
dongshen
2019-06-27 16:42:29 -07:00
committed by ACRN System Integration
parent 65ca6ae498
commit ed1bdcbbdf
2 changed files with 16 additions and 5 deletions

View File

@@ -77,6 +77,9 @@ struct pci_vdev {
uint32_t nr_bars; /* 6 for normal device, 2 for bridge, 1 for cardbus */
struct pci_bar bar[PCI_BAR_COUNT];
/* Remember the previously mapped/registered vbar base for undo purpose */
uint64_t bar_base_mapped[PCI_BAR_COUNT];
struct pci_msi msi;
struct pci_msix msix;