Skip to content

Commit be1e3ac

Browse files
lifeixwenlingz
authored andcommitted
dm: remove vdev_update_bar_map callback for PCIe device
Since this callback is only useful for pass through PCIe device and now pass through PCIe device emulation has splited from DM to HV. we could remove this callback now. Tracked-On: #4371 Signed-off-by: Li Fei1 <fei1.li@intel.com>
1 parent 595cefe commit be1e3ac

File tree

3 files changed

+0
-44
lines changed

3 files changed

+0
-44
lines changed

devicemodel/hw/pci/core.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -689,7 +689,6 @@ update_bar_address(struct vmctx *ctx, struct pci_vdev *dev, uint64_t addr,
689689
int idx, int type, bool ignore_reg_unreg)
690690
{
691691
bool decode = false;
692-
uint64_t orig_addr = dev->bar[idx].addr;
693692

694693
if (!ignore_reg_unreg) {
695694
if (dev->bar[idx].type == PCIBAR_IO)
@@ -734,10 +733,6 @@ update_bar_address(struct vmctx *ctx, struct pci_vdev *dev, uint64_t addr,
734733

735734
if (decode)
736735
register_bar(dev, idx);
737-
738-
/* update bar mapping */
739-
if (dev->dev_ops->vdev_update_bar_map && decode)
740-
dev->dev_ops->vdev_update_bar_map(ctx, dev, idx, orig_addr);
741736
}
742737

743738
static struct mmio_rsvd_rgn *

devicemodel/hw/pci/passthrough.c

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -561,39 +561,6 @@ passthru_deinit(struct vmctx *ctx, struct pci_vdev *dev, char *opts)
561561
vm_deassign_pcidev(ctx, &pcidev);
562562
}
563563

564-
static void
565-
passthru_update_bar_map(struct vmctx *ctx, struct pci_vdev *dev,
566-
int idx, uint64_t orig_addr)
567-
{
568-
struct passthru_dev *ptdev;
569-
570-
if (!dev->arg) {
571-
warnx("%s: passthru_dev is NULL", __func__);
572-
return;
573-
}
574-
575-
ptdev = (struct passthru_dev *)dev->arg;
576-
577-
if (ptdev->bar[idx].size == 0 ||
578-
idx == ptdev_msix_table_bar(ptdev) ||
579-
ptdev->bar[idx].type == PCIBAR_IO)
580-
return;
581-
582-
if (dev->bar[idx].addr + dev->bar[idx].size > PCI_EMUL_MEMLIMIT64 ||
583-
orig_addr + dev->bar[idx].size > PCI_EMUL_MEMLIMIT64)
584-
return;
585-
586-
vm_unmap_ptdev_mmio(ctx, ptdev->sel.bus,
587-
ptdev->sel.dev, ptdev->sel.func,
588-
orig_addr, ptdev->bar[idx].size,
589-
ptdev->bar[idx].addr);
590-
591-
vm_map_ptdev_mmio(ctx, ptdev->sel.bus,
592-
ptdev->sel.dev, ptdev->sel.func,
593-
dev->bar[idx].addr, ptdev->bar[idx].size,
594-
ptdev->bar[idx].addr);
595-
}
596-
597564
/* bind pin info for pass-through device */
598565
static void
599566
passthru_bind_irq(struct vmctx *ctx, struct pci_vdev *dev)
@@ -1333,7 +1300,6 @@ struct pci_vdev_ops passthru = {
13331300
.vdev_barwrite = passthru_write,
13341301
.vdev_barread = passthru_read,
13351302
.vdev_phys_access = passthru_bind_irq,
1336-
.vdev_update_bar_map = passthru_update_bar_map,
13371303
.vdev_write_dsdt = passthru_write_dsdt,
13381304
};
13391305
DEFINE_PCI_DEVTYPE(passthru);

devicemodel/include/pci_core.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,6 @@ struct pci_vdev_ops {
7171
/* ops related to physical resources */
7272
void (*vdev_phys_access)(struct vmctx *ctx, struct pci_vdev *dev);
7373

74-
/* update BAR map callback */
75-
void (*vdev_update_bar_map)(struct vmctx *ctx,
76-
struct pci_vdev *dev, int idx,
77-
uint64_t orig_addr);
78-
7974
/* config space read/write callbacks */
8075
int (*vdev_cfgwrite)(struct vmctx *ctx, int vcpu,
8176
struct pci_vdev *pi, int offset,

0 commit comments

Comments
 (0)