bhyve: Remove unused vcpu argument from PCI read/write methods.

Reviewed by:	corvink, markj
Differential Revision:	https://reviews.freebsd.org/D37652
This commit is contained in:
John Baldwin 2022-12-09 10:35:28 -08:00
parent 0857e5555d
commit 78c2cd83ec
13 changed files with 60 additions and 60 deletions

View File

@ -2197,7 +2197,7 @@ pci_ahci_host_write(struct pci_ahci_softc *sc, uint64_t offset, uint64_t value)
}
static void
pci_ahci_write(struct vmctx *ctx __unused, int vcpu __unused,
pci_ahci_write(struct vmctx *ctx __unused,
struct pci_devinst *pi, int baridx, uint64_t offset, int size,
uint64_t value)
{
@ -2292,7 +2292,7 @@ pci_ahci_port_read(struct pci_ahci_softc *sc, uint64_t offset)
}
static uint64_t
pci_ahci_read(struct vmctx *ctx __unused, int vcpu __unused,
pci_ahci_read(struct vmctx *ctx __unused,
struct pci_devinst *pi, int baridx, uint64_t regoff, int size)
{
struct pci_ahci_softc *sc = pi->pi_arg;

View File

@ -2112,7 +2112,7 @@ e82545_read_register(struct e82545_softc *sc, uint32_t offset)
}
static void
e82545_write(struct vmctx *ctx __unused, int vcpu __unused,
e82545_write(struct vmctx *ctx __unused,
struct pci_devinst *pi, int baridx, uint64_t offset, int size,
uint64_t value)
{
@ -2163,7 +2163,7 @@ e82545_write(struct vmctx *ctx __unused, int vcpu __unused,
}
static uint64_t
e82545_read(struct vmctx *ctx __unused, int vcpu __unused,
e82545_read(struct vmctx *ctx __unused,
struct pci_devinst *pi, int baridx, uint64_t offset, int size)
{
struct e82545_softc *sc;

View File

@ -140,7 +140,7 @@ SYSRES_MEM(PCI_EMUL_ECFG_BASE, PCI_EMUL_ECFG_SIZE);
static struct pci_devemu *pci_emul_finddev(const char *name);
static void pci_lintr_route(struct pci_devinst *pi);
static void pci_lintr_update(struct pci_devinst *pi);
static void pci_cfgrw(struct vmctx *ctx, int vcpu, int in, int bus, int slot,
static void pci_cfgrw(struct vmctx *ctx, int in, int bus, int slot,
int func, int coff, int bytes, uint32_t *val);
static __inline void
@ -447,8 +447,8 @@ pci_msix_pba_bar(struct pci_devinst *pi)
}
static int
pci_emul_io_handler(struct vmctx *ctx, int vcpu, int in, int port, int bytes,
uint32_t *eax, void *arg)
pci_emul_io_handler(struct vmctx *ctx, int vcpu __unused, int in, int port,
int bytes, uint32_t *eax, void *arg)
{
struct pci_devinst *pdi = arg;
struct pci_devemu *pe = pdi->pi_d;
@ -464,10 +464,10 @@ pci_emul_io_handler(struct vmctx *ctx, int vcpu, int in, int port, int bytes,
pdi->pi_bar[i].addr + pdi->pi_bar[i].size) {
offset = port - pdi->pi_bar[i].addr;
if (in)
*eax = (*pe->pe_barread)(ctx, vcpu, pdi, i,
*eax = (*pe->pe_barread)(ctx, pdi, i,
offset, bytes);
else
(*pe->pe_barwrite)(ctx, vcpu, pdi, i, offset,
(*pe->pe_barwrite)(ctx, pdi, i, offset,
bytes, *eax);
return (0);
}
@ -476,8 +476,8 @@ pci_emul_io_handler(struct vmctx *ctx, int vcpu, int in, int port, int bytes,
}
static int
pci_emul_mem_handler(struct vmctx *ctx, int vcpu, int dir, uint64_t addr,
int size, uint64_t *val, void *arg1, long arg2)
pci_emul_mem_handler(struct vmctx *ctx, int vcpu __unused, int dir,
uint64_t addr, int size, uint64_t *val, void *arg1, long arg2)
{
struct pci_devinst *pdi = arg1;
struct pci_devemu *pe = pdi->pi_d;
@ -494,22 +494,22 @@ pci_emul_mem_handler(struct vmctx *ctx, int vcpu, int dir, uint64_t addr,
if (dir == MEM_F_WRITE) {
if (size == 8) {
(*pe->pe_barwrite)(ctx, vcpu, pdi, bidx, offset,
(*pe->pe_barwrite)(ctx, pdi, bidx, offset,
4, *val & 0xffffffff);
(*pe->pe_barwrite)(ctx, vcpu, pdi, bidx, offset + 4,
(*pe->pe_barwrite)(ctx, pdi, bidx, offset + 4,
4, *val >> 32);
} else {
(*pe->pe_barwrite)(ctx, vcpu, pdi, bidx, offset,
(*pe->pe_barwrite)(ctx, pdi, bidx, offset,
size, *val);
}
} else {
if (size == 8) {
*val = (*pe->pe_barread)(ctx, vcpu, pdi, bidx,
*val = (*pe->pe_barread)(ctx, pdi, bidx,
offset, 4);
*val |= (*pe->pe_barread)(ctx, vcpu, pdi, bidx,
*val |= (*pe->pe_barread)(ctx, pdi, bidx,
offset + 4, 4) << 32;
} else {
*val = (*pe->pe_barread)(ctx, vcpu, pdi, bidx,
*val = (*pe->pe_barread)(ctx, pdi, bidx,
offset, size);
}
}
@ -1294,8 +1294,9 @@ pci_emul_fallback_handler(struct vmctx *ctx __unused, int vcpu __unused,
}
static int
pci_emul_ecfg_handler(struct vmctx *ctx, int vcpu, int dir, uint64_t addr,
int bytes, uint64_t *val, void *arg1 __unused, long arg2 __unused)
pci_emul_ecfg_handler(struct vmctx *ctx, int vcpu __unused, int dir,
uint64_t addr, int bytes, uint64_t *val, void *arg1 __unused,
long arg2 __unused)
{
int bus, slot, func, coff, in;
@ -1306,7 +1307,7 @@ pci_emul_ecfg_handler(struct vmctx *ctx, int vcpu, int dir, uint64_t addr,
in = (dir == MEM_F_READ);
if (in)
*val = ~0UL;
pci_cfgrw(ctx, vcpu, in, bus, slot, func, coff, bytes, (uint32_t *)val);
pci_cfgrw(ctx, in, bus, slot, func, coff, bytes, (uint32_t *)val);
return (0);
}
@ -2053,7 +2054,7 @@ pci_emul_cmdsts_write(struct pci_devinst *pi, int coff, uint32_t new, int bytes)
}
static void
pci_cfgrw(struct vmctx *ctx, int vcpu, int in, int bus, int slot, int func,
pci_cfgrw(struct vmctx *ctx, int in, int bus, int slot, int func,
int coff, int bytes, uint32_t *eax)
{
struct businfo *bi;
@ -2107,8 +2108,7 @@ pci_cfgrw(struct vmctx *ctx, int vcpu, int in, int bus, int slot, int func,
if (in) {
/* Let the device emulation override the default handler */
if (pe->pe_cfgread != NULL) {
needcfg = pe->pe_cfgread(ctx, vcpu, pi, coff, bytes,
eax);
needcfg = pe->pe_cfgread(ctx, pi, coff, bytes, eax);
} else {
needcfg = 1;
}
@ -2120,7 +2120,7 @@ pci_cfgrw(struct vmctx *ctx, int vcpu, int in, int bus, int slot, int func,
} else {
/* Let the device emulation override the default handler */
if (pe->pe_cfgwrite != NULL &&
(*pe->pe_cfgwrite)(ctx, vcpu, pi, coff, bytes, *eax) == 0)
(*pe->pe_cfgwrite)(ctx, pi, coff, bytes, *eax) == 0)
return;
/*
@ -2247,8 +2247,8 @@ pci_emul_cfgaddr(struct vmctx *ctx __unused, int vcpu __unused, int in,
INOUT_PORT(pci_cfgaddr, CONF1_ADDR_PORT, IOPORT_F_INOUT, pci_emul_cfgaddr);
static int
pci_emul_cfgdata(struct vmctx *ctx, int vcpu, int in, int port, int bytes,
uint32_t *eax, void *arg __unused)
pci_emul_cfgdata(struct vmctx *ctx, int vcpu __unused, int in, int port,
int bytes, uint32_t *eax, void *arg __unused)
{
int coff;
@ -2256,7 +2256,7 @@ pci_emul_cfgdata(struct vmctx *ctx, int vcpu, int in, int port, int bytes,
coff = cfgoff + (port - CONF1_DATA_PORT);
if (cfgenable) {
pci_cfgrw(ctx, vcpu, in, cfgbus, cfgslot, cfgfunc, coff, bytes,
pci_cfgrw(ctx, in, cfgbus, cfgslot, cfgfunc, coff, bytes,
eax);
} else {
/* Ignore accesses to cfgdata if not enabled by cfgaddr */
@ -2499,7 +2499,7 @@ pci_emul_dinit(struct vmctx *ctx __unused, struct pci_devinst *pi,
}
static void
pci_emul_diow(struct vmctx *ctx __unused, int vcpu __unused,
pci_emul_diow(struct vmctx *ctx __unused,
struct pci_devinst *pi, int baridx, uint64_t offset, int size,
uint64_t value)
{
@ -2567,7 +2567,7 @@ pci_emul_diow(struct vmctx *ctx __unused, int vcpu __unused,
}
static uint64_t
pci_emul_dior(struct vmctx *ctx __unused, int vcpu __unused,
pci_emul_dior(struct vmctx *ctx __unused,
struct pci_devinst *pi, int baridx, uint64_t offset, int size)
{
struct pci_emul_dsoftc *sc = pi->pi_arg;

View File

@ -63,18 +63,18 @@ struct pci_devemu {
void (*pe_write_dsdt)(struct pci_devinst *);
/* config space read/write callbacks */
int (*pe_cfgwrite)(struct vmctx *ctx, int vcpu,
int (*pe_cfgwrite)(struct vmctx *ctx,
struct pci_devinst *pi, int offset,
int bytes, uint32_t val);
int (*pe_cfgread)(struct vmctx *ctx, int vcpu,
int (*pe_cfgread)(struct vmctx *ctx,
struct pci_devinst *pi, int offset,
int bytes, uint32_t *retval);
/* BAR read/write callbacks */
void (*pe_barwrite)(struct vmctx *ctx, int vcpu,
void (*pe_barwrite)(struct vmctx *ctx,
struct pci_devinst *pi, int baridx,
uint64_t offset, int size, uint64_t value);
uint64_t (*pe_barread)(struct vmctx *ctx, int vcpu,
uint64_t (*pe_barread)(struct vmctx *ctx,
struct pci_devinst *pi, int baridx,
uint64_t offset, int size);

View File

@ -117,7 +117,7 @@ static struct pci_fbuf_softc *fbuf_sc;
#define PCI_FBUF_MSI_MSGS 4
static void
pci_fbuf_write(struct vmctx *ctx __unused, int vcpu __unused,
pci_fbuf_write(struct vmctx *ctx __unused,
struct pci_devinst *pi, int baridx, uint64_t offset, int size,
uint64_t value)
{
@ -172,7 +172,7 @@ pci_fbuf_write(struct vmctx *ctx __unused, int vcpu __unused,
}
static uint64_t
pci_fbuf_read(struct vmctx *ctx __unused, int vcpu __unused,
pci_fbuf_read(struct vmctx *ctx __unused,
struct pci_devinst *pi, int baridx, uint64_t offset, int size)
{
struct pci_fbuf_softc *sc;

View File

@ -210,9 +210,9 @@ static uint64_t hda_get_clock_ns(void);
* PCI HDA function declarations
*/
static int pci_hda_init(struct vmctx *ctx, struct pci_devinst *pi, nvlist_t *nvl);
static void pci_hda_write(struct vmctx *ctx, int vcpu, struct pci_devinst *pi,
static void pci_hda_write(struct vmctx *ctx, struct pci_devinst *pi,
int baridx, uint64_t offset, int size, uint64_t value);
static uint64_t pci_hda_read(struct vmctx *ctx, int vcpu, struct pci_devinst *pi,
static uint64_t pci_hda_read(struct vmctx *ctx, struct pci_devinst *pi,
int baridx, uint64_t offset, int size);
/*
* HDA global data
@ -1256,7 +1256,7 @@ pci_hda_init(struct vmctx *ctx, struct pci_devinst *pi, nvlist_t *nvl)
}
static void
pci_hda_write(struct vmctx *ctx __unused, int vcpu __unused,
pci_hda_write(struct vmctx *ctx __unused,
struct pci_devinst *pi, int baridx, uint64_t offset, int size,
uint64_t value)
{
@ -1274,7 +1274,7 @@ pci_hda_write(struct vmctx *ctx __unused, int vcpu __unused,
}
static uint64_t
pci_hda_read(struct vmctx *ctx __unused, int vcpu __unused,
pci_hda_read(struct vmctx *ctx __unused,
struct pci_devinst *pi, int baridx, uint64_t offset, int size)
{
struct hda_softc *sc = pi->pi_arg;

View File

@ -398,7 +398,7 @@ pci_lpc_uart_dsdt(void)
LPC_DSDT(pci_lpc_uart_dsdt);
static int
pci_lpc_cfgwrite(struct vmctx *ctx, int vcpu __unused, struct pci_devinst *pi,
pci_lpc_cfgwrite(struct vmctx *ctx, struct pci_devinst *pi,
int coff, int bytes, uint32_t val)
{
int pirq_pin;
@ -419,14 +419,14 @@ pci_lpc_cfgwrite(struct vmctx *ctx, int vcpu __unused, struct pci_devinst *pi,
}
static void
pci_lpc_write(struct vmctx *ctx __unused, int vcpu __unused,
pci_lpc_write(struct vmctx *ctx __unused,
struct pci_devinst *pi __unused, int baridx __unused,
uint64_t offset __unused, int size __unused, uint64_t value __unused)
{
}
static uint64_t
pci_lpc_read(struct vmctx *ctx __unused, int vcpu __unused,
pci_lpc_read(struct vmctx *ctx __unused,
struct pci_devinst *pi __unused, int baridx __unused, uint64_t offset __unused,
int size __unused)
{

View File

@ -3062,7 +3062,7 @@ pci_nvme_write_bar_0(struct vmctx *ctx, struct pci_nvme_softc* sc,
}
static void
pci_nvme_write(struct vmctx *ctx, int vcpu __unused, struct pci_devinst *pi,
pci_nvme_write(struct vmctx *ctx, struct pci_devinst *pi,
int baridx, uint64_t offset, int size, uint64_t value)
{
struct pci_nvme_softc* sc = pi->pi_arg;
@ -3125,7 +3125,7 @@ static uint64_t pci_nvme_read_bar_0(struct pci_nvme_softc* sc,
static uint64_t
pci_nvme_read(struct vmctx *ctx __unused, int vcpu __unused,
pci_nvme_read(struct vmctx *ctx __unused,
struct pci_devinst *pi, int baridx, uint64_t offset, int size)
{
struct pci_nvme_softc* sc = pi->pi_arg;

View File

@ -903,8 +903,8 @@ msixcap_access(struct passthru_softc *sc, int coff)
}
static int
passthru_cfgread(struct vmctx *ctx __unused, int vcpu __unused,
struct pci_devinst *pi, int coff, int bytes, uint32_t *rv)
passthru_cfgread(struct vmctx *ctx __unused, struct pci_devinst *pi, int coff,
int bytes, uint32_t *rv)
{
struct passthru_softc *sc;
@ -948,8 +948,8 @@ passthru_cfgread(struct vmctx *ctx __unused, int vcpu __unused,
}
static int
passthru_cfgwrite(struct vmctx *ctx, int vcpu __unused, struct pci_devinst *pi,
int coff, int bytes, uint32_t val)
passthru_cfgwrite(struct vmctx *ctx, struct pci_devinst *pi, int coff,
int bytes, uint32_t val)
{
int error, msix_table_entries, i;
struct passthru_softc *sc;
@ -1029,8 +1029,8 @@ passthru_cfgwrite(struct vmctx *ctx, int vcpu __unused, struct pci_devinst *pi,
}
static void
passthru_write(struct vmctx *ctx, int vcpu __unused, struct pci_devinst *pi,
int baridx, uint64_t offset, int size, uint64_t value)
passthru_write(struct vmctx *ctx, struct pci_devinst *pi, int baridx,
uint64_t offset, int size, uint64_t value)
{
struct passthru_softc *sc;
struct pci_bar_ioreq pio;
@ -1057,8 +1057,8 @@ passthru_write(struct vmctx *ctx, int vcpu __unused, struct pci_devinst *pi,
}
static uint64_t
passthru_read(struct vmctx *ctx __unused, int vcpu __unused,
struct pci_devinst *pi, int baridx, uint64_t offset, int size)
passthru_read(struct vmctx *ctx __unused, struct pci_devinst *pi, int baridx,
uint64_t offset, int size)
{
struct passthru_softc *sc;
struct pci_bar_ioreq pio;

View File

@ -66,7 +66,7 @@ pci_uart_intr_deassert(void *arg)
}
static void
pci_uart_write(struct vmctx *ctx __unused, int vcpu __unused,
pci_uart_write(struct vmctx *ctx __unused,
struct pci_devinst *pi, int baridx, uint64_t offset, int size,
uint64_t value)
{
@ -77,7 +77,7 @@ pci_uart_write(struct vmctx *ctx __unused, int vcpu __unused,
}
static uint64_t
pci_uart_read(struct vmctx *ctx __unused, int vcpu __unused,
pci_uart_read(struct vmctx *ctx __unused,
struct pci_devinst *pi, int baridx, uint64_t offset, int size)
{
uint8_t val;

View File

@ -2267,7 +2267,7 @@ pci_xhci_hostop_write(struct pci_xhci_softc *sc, uint64_t offset,
static void
pci_xhci_write(struct vmctx *ctx __unused, int vcpu __unused,
pci_xhci_write(struct vmctx *ctx __unused,
struct pci_devinst *pi, int baridx, uint64_t offset, int size __unused,
uint64_t value)
{
@ -2489,7 +2489,7 @@ pci_xhci_xecp_read(struct pci_xhci_softc *sc, uint64_t offset)
static uint64_t
pci_xhci_read(struct vmctx *ctx __unused, int vcpu __unused,
pci_xhci_read(struct vmctx *ctx __unused,
struct pci_devinst *pi, int baridx, uint64_t offset, int size)
{
struct pci_xhci_softc *sc;

View File

@ -558,7 +558,7 @@ vi_find_cr(int offset) {
* Otherwise dispatch to the actual driver.
*/
uint64_t
vi_pci_read(struct vmctx *ctx __unused, int vcpu __unused,
vi_pci_read(struct vmctx *ctx __unused,
struct pci_devinst *pi, int baridx, uint64_t offset, int size)
{
struct virtio_softc *vs = pi->pi_arg;
@ -678,7 +678,7 @@ vi_pci_read(struct vmctx *ctx __unused, int vcpu __unused,
* Otherwise dispatch to the actual driver.
*/
void
vi_pci_write(struct vmctx *ctx __unused, int vcpu __unused,
vi_pci_write(struct vmctx *ctx __unused,
struct pci_devinst *pi, int baridx, uint64_t offset, int size,
uint64_t value)
{

View File

@ -426,9 +426,9 @@ void vq_relchain_publish(struct vqueue_info *vq);
void vq_relchain(struct vqueue_info *vq, uint16_t idx, uint32_t iolen);
void vq_endchains(struct vqueue_info *vq, int used_all_avail);
uint64_t vi_pci_read(struct vmctx *ctx, int vcpu, struct pci_devinst *pi,
uint64_t vi_pci_read(struct vmctx *ctx, struct pci_devinst *pi,
int baridx, uint64_t offset, int size);
void vi_pci_write(struct vmctx *ctx, int vcpu, struct pci_devinst *pi,
void vi_pci_write(struct vmctx *ctx, struct pci_devinst *pi,
int baridx, uint64_t offset, int size, uint64_t value);
#ifdef BHYVE_SNAPSHOT
int vi_pci_snapshot(struct vm_snapshot_meta *meta);