dm: vPCI: add assign/deassign PCI device IC APIs

Add assign/deassign PCI device ioctl APIs assign a PCI device from SOS to
post-launched VM or deassign a PCI device from post-launched VM to SOS. This patch
is prepared for spliting passthrough PCI device from DM to HV.
The old assign/deassign ptdev APIs will be discarded.

Tracked-On: #4371
Signed-off-by: Li Fei1 <fei1.li@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Li Fei1
2020-01-19 19:11:41 +08:00
committed by wenlingz
parent fe3182ea05
commit aa38ed5b69
3 changed files with 48 additions and 0 deletions

View File

@@ -479,6 +479,18 @@ vm_unassign_ptdev(struct vmctx *ctx, int bus, int slot, int func)
return ioctl(ctx->fd, IC_DEASSIGN_PTDEV, &bdf);
}
int
vm_assign_pcidev(struct vmctx *ctx, struct acrn_assign_pcidev *pcidev)
{
return ioctl(ctx->fd, IC_ASSIGN_PCIDEV, pcidev);
}
int
vm_deassign_pcidev(struct vmctx *ctx, struct acrn_assign_pcidev *pcidev)
{
return ioctl(ctx->fd, IC_DEASSIGN_PCIDEV, pcidev);
}
int
vm_map_ptdev_mmio(struct vmctx *ctx, int bus, int slot, int func,
vm_paddr_t gpa, size_t len, vm_paddr_t hpa)