|
@@ -323,7 +323,7 @@ static int vfio_spapr_create_window(VFIOContainer *container,
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
-static int
|
|
|
+static bool
|
|
|
vfio_spapr_container_add_section_window(VFIOContainerBase *bcontainer,
|
|
|
MemoryRegionSection *section,
|
|
|
Error **errp)
|
|
@@ -351,13 +351,13 @@ vfio_spapr_container_add_section_window(VFIOContainerBase *bcontainer,
|
|
|
error_setg(errp, "Container %p can't map guest IOVA region"
|
|
|
" 0x%"HWADDR_PRIx"..0x%"HWADDR_PRIx, container,
|
|
|
iova, end);
|
|
|
- return -EINVAL;
|
|
|
+ return false;
|
|
|
}
|
|
|
- return 0;
|
|
|
+ return true;
|
|
|
}
|
|
|
|
|
|
if (container->iommu_type != VFIO_SPAPR_TCE_v2_IOMMU) {
|
|
|
- return 0;
|
|
|
+ return true;
|
|
|
}
|
|
|
|
|
|
/* For now intersections are not allowed, we may relax this later */
|
|
@@ -373,14 +373,14 @@ vfio_spapr_container_add_section_window(VFIOContainerBase *bcontainer,
|
|
|
section->offset_within_address_space +
|
|
|
int128_get64(section->size) - 1,
|
|
|
hostwin->min_iova, hostwin->max_iova);
|
|
|
- return -EINVAL;
|
|
|
+ return false;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
ret = vfio_spapr_create_window(container, section, &pgsize);
|
|
|
if (ret) {
|
|
|
error_setg_errno(errp, -ret, "Failed to create SPAPR window");
|
|
|
- return ret;
|
|
|
+ return false;
|
|
|
}
|
|
|
|
|
|
vfio_host_win_add(scontainer, section->offset_within_address_space,
|
|
@@ -406,14 +406,14 @@ vfio_spapr_container_add_section_window(VFIOContainerBase *bcontainer,
|
|
|
"vfio: failed GROUP_SET_SPAPR_TCE for "
|
|
|
"KVM VFIO device %d and group fd %d",
|
|
|
param.tablefd, param.groupfd);
|
|
|
- return -errno;
|
|
|
+ return false;
|
|
|
}
|
|
|
trace_vfio_spapr_group_attach(param.groupfd, param.tablefd);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
#endif
|
|
|
- return 0;
|
|
|
+ return true;
|
|
|
}
|
|
|
|
|
|
static void
|