libhsakmt: Support device controller cgroup

Device whiltelist controller cgroup allows to track and enforce open and
mknod restrictions on device files. Tasks should works with
/dev/dri/renderN devices that are whitelisted for its cgroup. If a
certain node is not whitelisted it is not an error condition.

Change-Id: I0b997423ccdc00aee98df5b6f04ed6794549604e
Signed-off-by: Harish Kasiviswanathan <Harish.Kasiviswanathan@amd.com>


[ROCm/ROCR-Runtime commit: c1994e28f0]
Cette révision appartient à :
Harish Kasiviswanathan
2018-10-18 14:03:02 -04:00
Parent c3aacd8463
révision 278287f045
2 fichiers modifiés avec 5 ajouts et 2 suppressions
+4 -1
Voir le fichier
@@ -1711,8 +1711,11 @@ int open_drm_render_device(int minor)
sprintf(path, "/dev/dri/renderD%d", minor);
fd = open(path, O_RDWR | O_CLOEXEC);
if (fd < 0) {
if (errno != ENOENT)
if (errno != ENOENT) {
if (errno == EPERM)
pr_info("Check a) User is in \"video\" group b) cgroup permissions\n");
pr_err("Failed to open %s: %s\n", path, strerror(errno));
}
return -errno;
}
drm_render_fds[index] = fd;
+1 -1
Voir le fichier
@@ -595,7 +595,7 @@ static HSAKMT_STATUS topology_sysfs_check_node_supported(uint32_t sysfs_node_id,
ret_value = open_drm_render_device(drm_render_minor);
if (ret_value > 0)
*is_node_supported = true;
else if (ret_value != -ENOENT)
else if (ret_value != -ENOENT && ret_value != -EPERM)
ret = HSAKMT_STATUS_ERROR;
err: