Rename the ambiguously named 'vm_setup_msi()' and 'vm_setup_msix()' to
'vm_setup_pptdev_msi()' and 'vm_setup_pptdev_msix()' respectively. It should now be clear that these functions operate on passthru devices.
This commit is contained in:
parent
7159310fa6
commit
55888cfaa2
@ -563,8 +563,8 @@ vm_map_pptdev_mmio(struct vmctx *ctx, int bus, int slot, int func,
|
||||
}
|
||||
|
||||
int
|
||||
vm_setup_msi(struct vmctx *ctx, int vcpu, int bus, int slot, int func,
|
||||
uint64_t addr, uint64_t msg, int numvec)
|
||||
vm_setup_pptdev_msi(struct vmctx *ctx, int vcpu, int bus, int slot, int func,
|
||||
uint64_t addr, uint64_t msg, int numvec)
|
||||
{
|
||||
struct vm_pptdev_msi pptmsi;
|
||||
|
||||
@ -581,8 +581,8 @@ vm_setup_msi(struct vmctx *ctx, int vcpu, int bus, int slot, int func,
|
||||
}
|
||||
|
||||
int
|
||||
vm_setup_msix(struct vmctx *ctx, int vcpu, int bus, int slot, int func,
|
||||
int idx, uint64_t addr, uint64_t msg, uint32_t vector_control)
|
||||
vm_setup_pptdev_msix(struct vmctx *ctx, int vcpu, int bus, int slot, int func,
|
||||
int idx, uint64_t addr, uint64_t msg, uint32_t vector_control)
|
||||
{
|
||||
struct vm_pptdev_msix pptmsix;
|
||||
|
||||
|
@ -82,10 +82,11 @@ int vm_assign_pptdev(struct vmctx *ctx, int bus, int slot, int func);
|
||||
int vm_unassign_pptdev(struct vmctx *ctx, int bus, int slot, int func);
|
||||
int vm_map_pptdev_mmio(struct vmctx *ctx, int bus, int slot, int func,
|
||||
vm_paddr_t gpa, size_t len, vm_paddr_t hpa);
|
||||
int vm_setup_msi(struct vmctx *ctx, int vcpu, int bus, int slot, int func,
|
||||
uint64_t addr, uint64_t msg, int numvec);
|
||||
int vm_setup_msix(struct vmctx *ctx, int vcpu, int bus, int slot, int func,
|
||||
int idx, uint64_t addr, uint64_t msg, uint32_t vector_control);
|
||||
int vm_setup_pptdev_msi(struct vmctx *ctx, int vcpu, int bus, int slot,
|
||||
int func, uint64_t addr, uint64_t msg, int numvec);
|
||||
int vm_setup_pptdev_msix(struct vmctx *ctx, int vcpu, int bus, int slot,
|
||||
int func, int idx, uint64_t addr, uint64_t msg,
|
||||
uint32_t vector_control);
|
||||
|
||||
/*
|
||||
* Return a pointer to the statistics buffer. Note that this is not MT-safe.
|
||||
|
@ -345,12 +345,10 @@ msix_table_write(struct vmctx *ctx, int vcpu, struct passthru_softc *sc,
|
||||
/* If the entry is masked, don't set it up */
|
||||
if ((entry->vector_control & PCIM_MSIX_VCTRL_MASK) == 0 ||
|
||||
(vector_control & PCIM_MSIX_VCTRL_MASK) == 0) {
|
||||
error = vm_setup_msix(ctx, vcpu, sc->psc_sel.pc_bus,
|
||||
sc->psc_sel.pc_dev,
|
||||
sc->psc_sel.pc_func,
|
||||
index, entry->addr,
|
||||
entry->msg_data,
|
||||
entry->vector_control);
|
||||
error = vm_setup_pptdev_msix(ctx, vcpu,
|
||||
sc->psc_sel.pc_bus, sc->psc_sel.pc_dev,
|
||||
sc->psc_sel.pc_func, index, entry->addr,
|
||||
entry->msg_data, entry->vector_control);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -652,12 +650,12 @@ passthru_cfgwrite(struct vmctx *ctx, int vcpu, struct pci_devinst *pi,
|
||||
if (msicap_access(sc, coff)) {
|
||||
msicap_cfgwrite(pi, sc->psc_msi.capoff, coff, bytes, val);
|
||||
|
||||
error = vm_setup_msi(ctx, vcpu, sc->psc_sel.pc_bus,
|
||||
error = vm_setup_pptdev_msi(ctx, vcpu, sc->psc_sel.pc_bus,
|
||||
sc->psc_sel.pc_dev, sc->psc_sel.pc_func,
|
||||
pi->pi_msi.addr, pi->pi_msi.msg_data,
|
||||
pi->pi_msi.maxmsgnum);
|
||||
if (error != 0) {
|
||||
printf("vm_setup_msi returned error %d\r\n", errno);
|
||||
printf("vm_setup_pptdev_msi error %d\r\n", errno);
|
||||
exit(1);
|
||||
}
|
||||
return (0);
|
||||
@ -668,7 +666,7 @@ passthru_cfgwrite(struct vmctx *ctx, int vcpu, struct pci_devinst *pi,
|
||||
if (pi->pi_msix.enabled) {
|
||||
msix_table_entries = pi->pi_msix.table_count;
|
||||
for (i = 0; i < msix_table_entries; i++) {
|
||||
error = vm_setup_msix(ctx, vcpu,
|
||||
error = vm_setup_pptdev_msix(ctx, vcpu,
|
||||
sc->psc_sel.pc_bus, sc->psc_sel.pc_dev,
|
||||
sc->psc_sel.pc_func, i,
|
||||
pi->pi_msix.table[i].addr,
|
||||
@ -676,8 +674,8 @@ passthru_cfgwrite(struct vmctx *ctx, int vcpu, struct pci_devinst *pi,
|
||||
pi->pi_msix.table[i].vector_control);
|
||||
|
||||
if (error) {
|
||||
printf("vm_setup_msix error %d\r\n",
|
||||
errno);
|
||||
printf("vm_setup_pptdev_msix error "
|
||||
"%d\r\n", errno);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user