acrn-dm: Pass vbdf and pbdf info to vm_reset_ptdev_intx_info

ACRN interepts vm_set/reset_ptdev_intx_info hypercalls to set
the SOS vdev properties to indicate it is assigned to UOS. Today,
upon vm_reset_ptdev_intx_info hypercall ACRN does not revert the SOS
vdev properties back to that of SOS, as vbdf and pbdf were not
part of the API. This would leave ACRN data structures in an incorrect
state

Tracked-On: #2700
Signed-off-by: Sainath Grandhi <sainath.grandhi@intel.com>
Signed-off-by: Zide Chen <zide.chen@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Sainath Grandhi 2019-04-28 22:33:18 -07:00 committed by ACRN System Integration
parent 624185c3ca
commit 7a78e70eb3
3 changed files with 10 additions and 3 deletions

View File

@ -579,7 +579,8 @@ vm_set_ptdev_intx_info(struct vmctx *ctx, uint16_t virt_bdf, uint16_t phys_bdf,
}
int
vm_reset_ptdev_intx_info(struct vmctx *ctx, int virt_pin, bool pic_pin)
vm_reset_ptdev_intx_info(struct vmctx *ctx, uint16_t virt_bdf, uint16_t phys_bdf,
int virt_pin, bool pic_pin)
{
struct ic_ptdev_irq ptirq;
@ -587,6 +588,8 @@ vm_reset_ptdev_intx_info(struct vmctx *ctx, int virt_pin, bool pic_pin)
ptirq.type = IRQ_INTX;
ptirq.intx.virt_pin = virt_pin;
ptirq.intx.is_pic_pin = pic_pin;
ptirq.virt_bdf = virt_bdf;
ptirq.phys_bdf = phys_bdf;
return ioctl(ctx->fd, IC_RESET_PTDEV_INTR_INFO, &ptirq);
}

View File

@ -914,7 +914,10 @@ passthru_deinit(struct vmctx *ctx, struct pci_vdev *dev, char *opts)
printf("vm_reset_ptdev_intx:0x%x-%x, ioapic virpin=%d.\n",
virt_bdf, ptdev->phys_bdf, dev->lintr.ioapic_irq);
vm_reset_ptdev_intx_info(ctx, dev->lintr.ioapic_irq, false);
if (dev->lintr.pin != 0) {
vm_reset_ptdev_intx_info(ctx, virt_bdf, ptdev->phys_bdf, dev->lintr.ioapic_irq, false);
}
/* unmap the physical BAR in guest MMIO space */
for (i = 0; i <= PCI_BARMAX; i++) {

View File

@ -137,7 +137,8 @@ int vm_reset_ptdev_msix_info(struct vmctx *ctx, uint16_t virt_bdf, uint16_t phys
int vector_count);
int vm_set_ptdev_intx_info(struct vmctx *ctx, uint16_t virt_bdf,
uint16_t phys_bdf, int virt_pin, int phys_pin, bool pic_pin);
int vm_reset_ptdev_intx_info(struct vmctx *ctx, int virt_pin, bool pic_pin);
int vm_reset_ptdev_intx_info(struct vmctx *ctx, uint16_t virt_bdf,
uint16_t phys_bdf, int virt_pin, bool pic_pin);
int vm_create_vcpu(struct vmctx *ctx, uint16_t vcpu_id);
int vm_set_vcpu_regs(struct vmctx *ctx, struct acrn_set_vcpu_regs *cpu_regs);