hv: io: add unregister_mmio_emulation_handler API

Since guest could re-program PCI device MSI-X table BAR, we should add mmio
emulation handler unregister.
However, after add unregister_mmio_emulation_handler API, emul_mmio_regions
is no longer accurate. Just replace it with max_emul_mmio_regions which records
the max index of the emul_mmio_node.

Tracked-On: #3475
Signed-off-by: Li, Fei1 <fei1.li@intel.com>
This commit is contained in:
Li, Fei1
2019-10-25 18:23:56 +08:00
committed by wenlingz
parent dc1e2adaec
commit 2c158d5ad4
4 changed files with 113 additions and 33 deletions

View File

@@ -125,7 +125,7 @@ struct acrn_vm {
struct iommu_domain *iommu; /* iommu domain of this VM */
spinlock_t vm_lock; /* Spin-lock used to protect VM modifications */
uint16_t emul_mmio_regions; /* Number of emulated mmio regions */
uint16_t max_emul_mmio_regions; /* max index of the emulated mmio_region */
struct mem_io_node emul_mmio[CONFIG_MAX_EMULATED_MMIO_REGIONS];
struct vm_io_handler_desc emul_pio[EMUL_PIO_IDX_MAX];