Skip to content

Commit

Permalink
bhyve: make passthru sel public available
Browse files Browse the repository at this point in the history
The GVT-d emulation requires access to this selector to read from the
device.

Reviewed by:		markj
MFC after:		1 week
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D40035
  • Loading branch information
ckoehne committed May 11, 2023
1 parent ca14781 commit 60793ce
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions usr.sbin/bhyve/pci_passthru.c
Original file line number Diff line number Diff line change
Expand Up @@ -660,6 +660,14 @@ cfginit(struct pci_devinst *pi, int bus, int slot, int func)
return (error);
}

struct pcisel *
passthru_get_sel(struct passthru_softc *sc)
{
assert(sc != NULL);

return (&sc->psc_sel);
}

int
set_pcir_handler(struct passthru_softc *sc, int reg, int len,
cfgread_handler rhandler, cfgwrite_handler whandler)
Expand Down
1 change: 1 addition & 0 deletions usr.sbin/bhyve/pci_passthru.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,6 @@ int passthru_cfgread_emulate(struct passthru_softc *sc, struct pci_devinst *pi,
int coff, int bytes, uint32_t *rv);
int passthru_cfgwrite_emulate(struct passthru_softc *sc, struct pci_devinst *pi,
int coff, int bytes, uint32_t val);
struct pcisel *passthru_get_sel(struct passthru_softc *sc);
int set_pcir_handler(struct passthru_softc *sc, int reg, int len,
cfgread_handler rhandler, cfgwrite_handler whandler);

0 comments on commit 60793ce

Please sign in to comment.