Page MenuHomeFreeBSD

D40039.id121795.diff
No OneTemporary

D40039.id121795.diff

diff --git a/usr.sbin/bhyve/pci_gvt-d.c b/usr.sbin/bhyve/pci_gvt-d.c
--- a/usr.sbin/bhyve/pci_gvt-d.c
+++ b/usr.sbin/bhyve/pci_gvt-d.c
@@ -7,13 +7,42 @@
#include <sys/types.h>
+#include <err.h>
+
#include "pci_gvt-d.h"
#include "pci_passthru.h"
+#define PCIR_BDSM 0x5C /* Base of Data Stolen Memory register */
+
+/* GVT-d definitions */
+#define GVT_D_MAP_GSM 0
+
+static int
+gvt_d_setup_gsm(struct pci_devinst *const pi)
+{
+ struct passthru_softc *sc;
+
+ sc = pi->pi_arg;
+
+ pci_set_cfgdata32(pi, PCIR_BDSM,
+ read_config(passthru_get_sel(sc), PCIR_BDSM, 4));
+
+ return (set_pcir_handler(sc, PCIR_BDSM, 4, passthru_cfgread_emulate,
+ passthru_cfgwrite_emulate));
+}
+
int
-gvt_d_init(struct pci_devinst *const pi __unused, nvlist_t *const nvl __unused)
+gvt_d_init(struct pci_devinst *const pi, nvlist_t *const nvl __unused)
{
- return (0);
+ int error;
+
+ if ((error = gvt_d_setup_gsm(pi)) != 0) {
+ warnx("%s: Unable to setup Graphics Stolen Memory", __func__);
+ goto done;
+ }
+
+done:
+ return (error);
}
void

File Metadata

Mime Type
text/plain
Expires
Sun, May 17, 10:19 PM (11 h, 47 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33212927
Default Alt Text
D40039.id121795.diff (1 KB)

Event Timeline