diff options
-rw-r--r-- | sys/amd64/vmm/io/ppt.c | 6 | ||||
-rw-r--r-- | sys/amd64/vmm/io/ppt.h | 1 | ||||
-rw-r--r-- | sys/amd64/vmm/vmm.c | 3 |
3 files changed, 9 insertions, 1 deletions
diff --git a/sys/amd64/vmm/io/ppt.c b/sys/amd64/vmm/io/ppt.c index 878bf8a..64d9ff5 100644 --- a/sys/amd64/vmm/io/ppt.c +++ b/sys/amd64/vmm/io/ppt.c @@ -592,3 +592,9 @@ ppt_setup_msix(struct vm *vm, int vcpu, int bus, int slot, int func, return (0); } +int +ppt_num_devices(void) +{ + + return (num_pptdevs); +} diff --git a/sys/amd64/vmm/io/ppt.h b/sys/amd64/vmm/io/ppt.h index 63c8228..931893c 100644 --- a/sys/amd64/vmm/io/ppt.h +++ b/sys/amd64/vmm/io/ppt.h @@ -38,4 +38,5 @@ int ppt_setup_msi(struct vm *vm, int vcpu, int bus, int slot, int func, int destcpu, int vector, int numvec); int ppt_setup_msix(struct vm *vm, int vcpu, int bus, int slot, int func, int idx, uint32_t msg, uint32_t vector_control, uint64_t addr); +int ppt_num_devices(void); #endif diff --git a/sys/amd64/vmm/vmm.c b/sys/amd64/vmm/vmm.c index b4f3c33..5fc6b94 100644 --- a/sys/amd64/vmm/vmm.c +++ b/sys/amd64/vmm/vmm.c @@ -213,7 +213,8 @@ vmm_handler(module_t mod, int what, void *arg) switch (what) { case MOD_LOAD: vmmdev_init(); - iommu_init(); + if (ppt_num_devices() > 0) + iommu_init(); error = vmm_init(); if (error == 0) vmm_initialized = 1; |