Lines Matching +full:gpa +full:- +full:0

1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
46 SYSCTL_NODE(_hw_vmm, OID_AUTO, iommu, CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
51 0, "bhyve iommu initialized?");
54 SYSCTL_INT(_hw_vmm_iommu, OID_AUTO, enable, CTLFLAG_RDTUN, &iommu_enable, 0,
65 return ((*ops->init)()); in IOMMU_INIT()
74 (*ops->cleanup)(); in IOMMU_CLEANUP()
82 return ((*ops->create_domain)(maxaddr)); in IOMMU_CREATE_DOMAIN()
92 (*ops->destroy_domain)(dom); in IOMMU_DESTROY_DOMAIN()
96 IOMMU_CREATE_MAPPING(void *domain, vm_paddr_t gpa, vm_paddr_t hpa, uint64_t len) in IOMMU_CREATE_MAPPING() argument
100 return ((*ops->create_mapping)(domain, gpa, hpa, len)); in IOMMU_CREATE_MAPPING()
106 IOMMU_REMOVE_MAPPING(void *domain, vm_paddr_t gpa, uint64_t len) in IOMMU_REMOVE_MAPPING() argument
110 return ((*ops->remove_mapping)(domain, gpa, len)); in IOMMU_REMOVE_MAPPING()
120 (*ops->add_device)(domain, rid); in IOMMU_ADD_DEVICE()
128 (*ops->remove_device)(domain, rid); in IOMMU_REMOVE_DEVICE()
136 (*ops->invalidate_tlb)(domain); in IOMMU_INVALIDATE_TLB()
144 (*ops->enable)(); in IOMMU_ENABLE()
152 (*ops->disable)(); in IOMMU_DISABLE()
203 iommu_avail = 0; in iommu_init()
208 * Create 1:1 mappings from '0' to 'maxaddr' for devices assigned to in iommu_init()
211 iommu_create_mapping(host_domain, 0, 0, maxaddr); in iommu_init()
213 add_tag = EVENTHANDLER_REGISTER(pci_add_device, iommu_pci_add, NULL, 0); in iommu_init()
215 NULL, 0); in iommu_init()
217 for (bus = 0; bus <= PCI_BUSMAX; bus++) { in iommu_init()
218 for (slot = 0; slot <= PCI_SLOTMAX; slot++) { in iommu_init()
219 for (func = 0; func <= PCI_FUNCMAX; func++) { in iommu_init()
220 dev = pci_find_dbsf(0, bus, slot, func); in iommu_init()
266 if (atomic_cmpset_int(&iommu_initted, 0, 1)) { in iommu_create_domain()
284 iommu_create_mapping(void *dom, vm_paddr_t gpa, vm_paddr_t hpa, size_t len) in iommu_create_mapping() argument
290 while (remaining > 0) { in iommu_create_mapping()
291 mapped = IOMMU_CREATE_MAPPING(dom, gpa, hpa, remaining); in iommu_create_mapping()
292 gpa += mapped; in iommu_create_mapping()
294 remaining -= mapped; in iommu_create_mapping()
299 iommu_remove_mapping(void *dom, vm_paddr_t gpa, size_t len) in iommu_remove_mapping() argument
305 while (remaining > 0) { in iommu_remove_mapping()
306 unmapped = IOMMU_REMOVE_MAPPING(dom, gpa, remaining); in iommu_remove_mapping()
307 gpa += unmapped; in iommu_remove_mapping()
308 remaining -= unmapped; in iommu_remove_mapping()