hv: vpci: split vPCI device from SOS for post-launched VM

When assgined a PCI PTDev to post-launched VM from SOS, using a pointer to point to
the real struct pci_vdev. When post-launched VM access its PTDev configure space in
SOS address space, using this real struct pci_vdev.

Tracked-On: #3475
Signed-off-by: Li, Fei1 <fei1.li@intel.com>
This commit is contained in:
Li, Fei1
2019-08-09 22:16:50 +08:00
committed by wenlingz
parent 13de9a4cf6
commit 90480db553
5 changed files with 34 additions and 56 deletions

View File

@@ -96,6 +96,9 @@ struct pci_vdev {
/* Pointer to corressponding operations */
const struct pci_vdev_ops *vdev_ops;
/* For SOS, if the device is latterly assigned to a UOS, we use this field to track the new owner. */
struct pci_vdev *new_owner;
};
struct pci_addr_info {
@@ -114,7 +117,7 @@ struct acrn_vpci {
extern const struct pci_vdev_ops vhostbridge_ops;
void vpci_init(struct acrn_vm *vm);
void vpci_cleanup(const struct acrn_vm *vm);
void vpci_set_ptdev_intr_info(const struct acrn_vm *target_vm, uint16_t vbdf, uint16_t pbdf);
void vpci_set_ptdev_intr_info(struct acrn_vm *target_vm, uint16_t vbdf, uint16_t pbdf);
void vpci_reset_ptdev_intr_info(const struct acrn_vm *target_vm, uint16_t vbdf, uint16_t pbdf);
#endif /* VPCI_H_ */