diff --git a/devicemodel/core/main.c b/devicemodel/core/main.c index b8d0927e7..fa32c1b42 100644 --- a/devicemodel/core/main.c +++ b/devicemodel/core/main.c @@ -231,25 +231,13 @@ dm_gpa2hva(uint64_t gpa, size_t size) } int -fbsdrun_vmexit_on_pause(void) -{ - return guest_vmexit_on_pause; -} - -int -fbsdrun_vmexit_on_hlt(void) -{ - return guest_vmexit_on_hlt; -} - -int -fbsdrun_virtio_msix(void) +virtio_uses_msix(void) { return virtio_msix; } static void * -fbsdrun_start_thread(void *param) +start_thread(void *param) { char tname[MAXCOMLEN + 1]; struct mt_vmm_info *mtp; @@ -285,7 +273,7 @@ add_cpu(struct vmctx *ctx, int guest_ncpus) } error = pthread_create(&mt_vmm_info[0].mt_thr, NULL, - fbsdrun_start_thread, &mt_vmm_info[0]); + start_thread, &mt_vmm_info[0]); assert(error == 0); } diff --git a/devicemodel/hw/pci/virtio/virtio_block.c b/devicemodel/hw/pci/virtio/virtio_block.c index 810967fd0..20359837c 100644 --- a/devicemodel/hw/pci/virtio/virtio_block.c +++ b/devicemodel/hw/pci/virtio/virtio_block.c @@ -388,7 +388,7 @@ virtio_blk_init(struct vmctx *ctx, struct pci_vdev *dev, char *opts) pci_set_cfgdata16(dev, PCIR_SUBDEV_0, VIRTIO_TYPE_BLOCK); pci_set_cfgdata16(dev, PCIR_SUBVEND_0, VIRTIO_VENDOR); - if (virtio_interrupt_init(&blk->base, fbsdrun_virtio_msix())) { + if (virtio_interrupt_init(&blk->base, virtio_uses_msix())) { blockif_close(blk->bc); free(blk); return -1; diff --git a/devicemodel/hw/pci/virtio/virtio_console.c b/devicemodel/hw/pci/virtio/virtio_console.c index 209cf27a4..750c096c5 100644 --- a/devicemodel/hw/pci/virtio/virtio_console.c +++ b/devicemodel/hw/pci/virtio/virtio_console.c @@ -859,7 +859,7 @@ virtio_console_init(struct vmctx *ctx, struct pci_vdev *dev, char *opts) pci_set_cfgdata16(dev, PCIR_SUBDEV_0, VIRTIO_TYPE_CONSOLE); pci_set_cfgdata16(dev, PCIR_SUBVEND_0, VIRTIO_VENDOR); - if (virtio_interrupt_init(&console->base, fbsdrun_virtio_msix())) { + if (virtio_interrupt_init(&console->base, virtio_uses_msix())) { if (console) { if (console->config) free(console->config); diff --git a/devicemodel/hw/pci/virtio/virtio_heci.c b/devicemodel/hw/pci/virtio/virtio_heci.c index 0bb92edae..3ed23e6a6 100644 --- a/devicemodel/hw/pci/virtio/virtio_heci.c +++ b/devicemodel/hw/pci/virtio/virtio_heci.c @@ -1302,7 +1302,7 @@ virtio_heci_init(struct vmctx *ctx, struct pci_vdev *dev, char *opts) WPRINTF(("vheci init: mutexattr init fail, erro %d!\r\n", rc)); goto fail; } - if (fbsdrun_virtio_msix()) { + if (virtio_uses_msix()) { rc = pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_DEFAULT); if (rc) { WPRINTF(("vheci init: mutexattr_settype failed with " @@ -1340,7 +1340,7 @@ virtio_heci_init(struct vmctx *ctx, struct pci_vdev *dev, char *opts) pci_set_cfgdata16(dev, PCIR_SUBDEV_0, VIRTIO_TYPE_HECI); pci_set_cfgdata16(dev, PCIR_SUBVEND_0, INTEL_VENDOR_ID); - if (virtio_interrupt_init(&vheci->base, fbsdrun_virtio_msix())) + if (virtio_interrupt_init(&vheci->base, virtio_uses_msix())) goto setup_fail; virtio_set_io_bar(&vheci->base, 0); diff --git a/devicemodel/hw/pci/virtio/virtio_hyper_dmabuf.c b/devicemodel/hw/pci/virtio/virtio_hyper_dmabuf.c index 2cde0e7e2..5d2b50299 100644 --- a/devicemodel/hw/pci/virtio/virtio_hyper_dmabuf.c +++ b/devicemodel/hw/pci/virtio/virtio_hyper_dmabuf.c @@ -306,7 +306,7 @@ virtio_hyper_dmabuf_init(struct vmctx *ctx, struct pci_vdev *dev, char *opts) if (rc) DPRINTF("mutexattr init failed with erro %d!\n", rc); - if (fbsdrun_virtio_msix()) { + if (virtio_uses_msix()) { rc = pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_DEFAULT); DPRINTF("virtio_msix: mutexattr_settype "); DPRINTF("failed with error %d!\n", rc); @@ -347,7 +347,7 @@ virtio_hyper_dmabuf_init(struct vmctx *ctx, struct pci_vdev *dev, char *opts) pci_set_cfgdata16(dev, PCIR_SUBDEV_0, VIRTIO_TYPE_HYPERDMABUF); pci_set_cfgdata16(dev, PCIR_SUBVEND_0, INTEL_VENDOR_ID); - if (virtio_interrupt_init(&hyper_dmabuf->base, fbsdrun_virtio_msix())) { + if (virtio_interrupt_init(&hyper_dmabuf->base, virtio_uses_msix())) { if (hyper_dmabuf) free(hyper_dmabuf); return -1; diff --git a/devicemodel/hw/pci/virtio/virtio_net.c b/devicemodel/hw/pci/virtio/virtio_net.c index 13313e6d4..63928487c 100644 --- a/devicemodel/hw/pci/virtio/virtio_net.c +++ b/devicemodel/hw/pci/virtio/virtio_net.c @@ -1003,7 +1003,7 @@ virtio_net_init(struct vmctx *ctx, struct pci_vdev *dev, char *opts) net->nmd != NULL); /* use BAR 1 to map MSI-X table and PBA, if we're using MSI-X */ - if (virtio_interrupt_init(&net->base, fbsdrun_virtio_msix())) { + if (virtio_interrupt_init(&net->base, virtio_uses_msix())) { if (net) free(net); return -1; diff --git a/devicemodel/hw/pci/virtio/virtio_rnd.c b/devicemodel/hw/pci/virtio/virtio_rnd.c index a29f6a993..f8fec988d 100644 --- a/devicemodel/hw/pci/virtio/virtio_rnd.c +++ b/devicemodel/hw/pci/virtio/virtio_rnd.c @@ -387,7 +387,7 @@ virtio_rnd_init(struct vmctx *ctx, struct pci_vdev *dev, char *opts) rc = pthread_mutexattr_init(&attr); if (rc) DPRINTF(("mutexattr init failed with erro %d!\n", rc)); - if (fbsdrun_virtio_msix()) { + if (virtio_uses_msix()) { rc = pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_DEFAULT); if (rc) DPRINTF(("virtio_msix: mutexattr_settype failed with " @@ -435,7 +435,7 @@ virtio_rnd_init(struct vmctx *ctx, struct pci_vdev *dev, char *opts) pci_set_cfgdata16(dev, PCIR_SUBDEV_0, VIRTIO_TYPE_ENTROPY); pci_set_cfgdata16(dev, PCIR_SUBVEND_0, VIRTIO_VENDOR); - if (virtio_interrupt_init(&rnd->base, fbsdrun_virtio_msix())) { + if (virtio_interrupt_init(&rnd->base, virtio_uses_msix())) { if (rnd) free(rnd); return -1; diff --git a/devicemodel/include/dm.h b/devicemodel/include/dm.h index 91c201132..c18bd75ea 100644 --- a/devicemodel/include/dm.h +++ b/devicemodel/include/dm.h @@ -47,12 +47,6 @@ int vmexit_task_switch(struct vmctx *ctx, struct vhm_request *vhm_req, int *vcpu); void *paddr_guest2host(struct vmctx *ctx, uintptr_t addr, size_t len); void *dm_gpa2hva(uint64_t gpa, size_t size); - -int fbsdrun_muxed(void); -int fbsdrun_vmexit_on_hlt(void); -int fbsdrun_vmexit_on_pause(void); -int fbsdrun_disable_x2apic(void); -int fbsdrun_virtio_msix(void); - +int virtio_uses_msix(void); void ptdev_prefer_msi(bool enable); #endif