Changeset View
Changeset View
Standalone View
Standalone View
sys/amd64/vmm/vmm.c
Show First 20 Lines • Show All 932 Lines • ▼ Show 20 Lines | while (gpa < mm->gpa + mm->len) { | ||||
KASSERT(vp != NULL, ("vm(%s) could not map gpa %#lx", | KASSERT(vp != NULL, ("vm(%s) could not map gpa %#lx", | ||||
vm_name(vm), gpa)); | vm_name(vm), gpa)); | ||||
vm_gpa_release(cookie); | vm_gpa_release(cookie); | ||||
hpa = DMAP_TO_PHYS((uintptr_t)vp); | hpa = DMAP_TO_PHYS((uintptr_t)vp); | ||||
if (map) { | if (map) { | ||||
iommu_create_mapping(vm->iommu, gpa, hpa, sz); | iommu_create_mapping(vm->iommu, gpa, hpa, sz); | ||||
iommu_remove_mapping(host_domain, hpa, sz); | |||||
} else { | } else { | ||||
iommu_remove_mapping(vm->iommu, gpa, sz); | iommu_remove_mapping(vm->iommu, gpa, sz); | ||||
iommu_create_mapping(host_domain, hpa, hpa, sz); | |||||
} | } | ||||
gpa += PAGE_SIZE; | gpa += PAGE_SIZE; | ||||
} | } | ||||
} | } | ||||
/* | /* | ||||
* Invalidate the cached translations associated with the domain | * Invalidate the cached translations associated with the domain | ||||
▲ Show 20 Lines • Show All 2,001 Lines • Show Last 20 Lines |