hv: vpci: define PCI CONFIG_ADDRESS Register as its physical layout

Refine PCI CONFIG_ADDRESS Register definition as its physical layout.
In this case, we could read/write PCI CONFIG_ADDRESS Register atomically.

Tracked-On: #3475
Signed-off-by: Li, Fei1 <fei1.li@intel.com>
This commit is contained in:
Li, Fei1
2019-10-22 17:47:05 +08:00
committed by wenlingz
parent c8fa8e15f8
commit f711d3a639
2 changed files with 28 additions and 37 deletions

View File

@@ -101,15 +101,19 @@ struct pci_vdev {
struct pci_vdev *new_owner;
};
struct pci_addr_info {
union pci_bdf cached_bdf;
uint32_t cached_reg;
bool cached_enable;
union pci_cfg_addr_reg {
uint32_t value;
struct {
uint32_t reg_num : 8; /* BITs 0-7, Register Number (BITs 0-1, always reserve to 0) */
uint32_t bdf : 16; /* BITs 8-23, BDF Number */
uint32_t resv : 7; /* BITs 24-30, Reserved */
uint32_t enable : 1; /* BITs 31, Enable bit */
} bits;
};
struct acrn_vpci {
struct acrn_vm *vm;
struct pci_addr_info addr_info;
union pci_cfg_addr_reg addr;
uint32_t pci_vdev_cnt;
struct pci_vdev pci_vdevs[CONFIG_MAX_PCI_DEV_NUM];
};