git: 0857e5555d77 - main - bhyve: Pass a vCPU ID of 0 to vm_setup_pptdev_msi*.
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 09 Dec 2022 18:31:41 UTC
The branch main has been updated by jhb:
URL: https://cgit.FreeBSD.org/src/commit/?id=0857e5555d77357e34ea6d70b28ead6335e41d33
commit 0857e5555d77357e34ea6d70b28ead6335e41d33
Author: John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2022-12-09 18:28:11 +0000
Commit: John Baldwin <jhb@FreeBSD.org>
CommitDate: 2022-12-09 18:31:17 +0000
bhyve: Pass a vCPU ID of 0 to vm_setup_pptdev_msi*.
These ioctls are not vCPU-specific and the ioctl now ignores the vCPU
ID. 0 is used instead of -1 to provide limited forwards
compatibility.
Reviewed by: corvink, markj
Differential Revision: https://reviews.freebsd.org/D37651
---
usr.sbin/bhyve/pci_passthru.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/usr.sbin/bhyve/pci_passthru.c b/usr.sbin/bhyve/pci_passthru.c
index b4a8b623eca9..3a16e7bce0ae 100644
--- a/usr.sbin/bhyve/pci_passthru.c
+++ b/usr.sbin/bhyve/pci_passthru.c
@@ -386,7 +386,7 @@ msix_table_read(struct passthru_softc *sc, uint64_t offset, int size)
}
static void
-msix_table_write(struct vmctx *ctx, int vcpu, struct passthru_softc *sc,
+msix_table_write(struct vmctx *ctx, struct passthru_softc *sc,
uint64_t offset, int size, uint64_t data)
{
struct pci_devinst *pi;
@@ -445,7 +445,7 @@ 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) {
- (void)vm_setup_pptdev_msix(ctx, vcpu,
+ (void)vm_setup_pptdev_msix(ctx, 0,
sc->psc_sel.pc_bus, sc->psc_sel.pc_dev,
sc->psc_sel.pc_func, index, entry->addr,
entry->msg_data, entry->vector_control);
@@ -948,7 +948,7 @@ passthru_cfgread(struct vmctx *ctx __unused, int vcpu __unused,
}
static int
-passthru_cfgwrite(struct vmctx *ctx, int vcpu, struct pci_devinst *pi,
+passthru_cfgwrite(struct vmctx *ctx, int vcpu __unused, struct pci_devinst *pi,
int coff, int bytes, uint32_t val)
{
int error, msix_table_entries, i;
@@ -969,7 +969,7 @@ passthru_cfgwrite(struct vmctx *ctx, int vcpu, struct pci_devinst *pi,
if (msicap_access(sc, coff)) {
pci_emul_capwrite(pi, coff, bytes, val, sc->psc_msi.capoff,
PCIY_MSI);
- error = vm_setup_pptdev_msi(ctx, vcpu, sc->psc_sel.pc_bus,
+ error = vm_setup_pptdev_msi(ctx, 0, 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);
@@ -984,7 +984,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_pptdev_msix(ctx, vcpu,
+ error = vm_setup_pptdev_msix(ctx, 0,
sc->psc_sel.pc_bus, sc->psc_sel.pc_dev,
sc->psc_sel.pc_func, i,
pi->pi_msix.table[i].addr,
@@ -1029,8 +1029,8 @@ passthru_cfgwrite(struct vmctx *ctx, int vcpu, struct pci_devinst *pi,
}
static void
-passthru_write(struct vmctx *ctx, int vcpu, struct pci_devinst *pi, int baridx,
- uint64_t offset, int size, uint64_t value)
+passthru_write(struct vmctx *ctx, int vcpu __unused, struct pci_devinst *pi,
+ int baridx, uint64_t offset, int size, uint64_t value)
{
struct passthru_softc *sc;
struct pci_bar_ioreq pio;
@@ -1038,7 +1038,7 @@ passthru_write(struct vmctx *ctx, int vcpu, struct pci_devinst *pi, int baridx,
sc = pi->pi_arg;
if (baridx == pci_msix_table_bar(pi)) {
- msix_table_write(ctx, vcpu, sc, offset, size, value);
+ msix_table_write(ctx, sc, offset, size, value);
} else {
assert(pi->pi_bar[baridx].type == PCIBAR_IO);
assert(size == 1 || size == 2 || size == 4);