MCPcopy Create free account
hub / github.com/F-Stack/f-stack / vm_assign_pptdev

Function vm_assign_pptdev

freebsd/amd64/vmm/vmm.c:960–979  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

958}
959
960int
961vm_assign_pptdev(struct vm *vm, int bus, int slot, int func)
962{
963 int error;
964 vm_paddr_t maxaddr;
965
966 /* Set up the IOMMU to do the 'gpa' to 'hpa' translation */
967 if (ppt_assigned_devices(vm) == 0) {
968 KASSERT(vm->iommu == NULL,
969 ("vm_assign_pptdev: iommu must be NULL"));
970 maxaddr = vmm_sysmem_maxaddr(vm);
971 vm->iommu = iommu_create_domain(maxaddr);
972 if (vm->iommu == NULL)
973 return (ENXIO);
974 vm_iommu_map(vm);
975 }
976
977 error = ppt_assign_device(vm, bus, slot, func);
978 return (error);
979}
980
981void *
982vm_gpa_hold(struct vm *vm, int vcpuid, vm_paddr_t gpa, size_t len, int reqprot,

Callers 1

vmmdev_ioctlFunction · 0.85

Calls 4

ppt_assigned_devicesFunction · 0.85
vmm_sysmem_maxaddrFunction · 0.85
iommu_create_domainFunction · 0.85
ppt_assign_deviceFunction · 0.85

Tested by

no test coverage detected