hv: vPCI: cache PCI BAR physical base address

PCI BAR physical base address will never changed. Cache it to avoid calculating
it every time when we access it.

Tracked-On: #3475
Signed-off-by: Li, Fei1 <fei1.li@intel.com>
Acked-by: Eddie Dong <eddie.dong@Intel.com>
This commit is contained in:
Li, Fei1
2019-09-10 21:42:35 +08:00
committed by ACRN System Integration
parent 5083aba379
commit 6ebc22210b
4 changed files with 17 additions and 31 deletions

View File

@@ -288,6 +288,7 @@ static uint32_t pci_pdev_read_bar(union pci_bdf bdf, uint32_t idx, struct pci_ba
}
bar->size = size;
bar->base_hpa = base;
return (type == PCIBAR_MEM64)?2U:1U;
}