* [PATCH igt 0/2] msm+lib: Add test for buffer mapping permissions
@ 2021-11-30 0:43 ` Rob Clark
0 siblings, 0 replies; 14+ messages in thread
From: Rob Clark @ 2021-11-30 0:43 UTC (permalink / raw)
To: igt-dev
Cc: freedreno, linux-arm-msm, Akhil P Oommen, Jordan Crouse, Rob Clark
From: Rob Clark <robdclark@chromium.org>
First patch just splits out a couple of helpers from igt_sysfs so they
can be re-used. Second patch adds a test which locates the address of
a given buffer, and verifies (depending on expected permissions) that
writes and/or reads trigger an iova fault rather than succeeding.
Rob Clark (2):
igt: Split out I/O helpers
msm: Add test for kernel buffer permissions
lib/igt_io.c | 96 +++++++++++++++++
lib/igt_io.h | 33 ++++++
lib/igt_msm.h | 1 +
lib/igt_sysfs.c | 45 +-------
lib/meson.build | 1 +
tests/meson.build | 1 +
tests/msm_mapping.c | 257 ++++++++++++++++++++++++++++++++++++++++++++
7 files changed, 394 insertions(+), 40 deletions(-)
create mode 100644 lib/igt_io.c
create mode 100644 lib/igt_io.h
create mode 100644 tests/msm_mapping.c
--
2.33.1
^ permalink raw reply [flat|nested] 14+ messages in thread
* [igt-dev] [PATCH igt 0/2] msm+lib: Add test for buffer mapping permissions
@ 2021-11-30 0:43 ` Rob Clark
0 siblings, 0 replies; 14+ messages in thread
From: Rob Clark @ 2021-11-30 0:43 UTC (permalink / raw)
To: igt-dev
Cc: Rob Clark, linux-arm-msm, freedreno, Akhil P Oommen, Jordan Crouse
From: Rob Clark <robdclark@chromium.org>
First patch just splits out a couple of helpers from igt_sysfs so they
can be re-used. Second patch adds a test which locates the address of
a given buffer, and verifies (depending on expected permissions) that
writes and/or reads trigger an iova fault rather than succeeding.
Rob Clark (2):
igt: Split out I/O helpers
msm: Add test for kernel buffer permissions
lib/igt_io.c | 96 +++++++++++++++++
lib/igt_io.h | 33 ++++++
lib/igt_msm.h | 1 +
lib/igt_sysfs.c | 45 +-------
lib/meson.build | 1 +
tests/meson.build | 1 +
tests/msm_mapping.c | 257 ++++++++++++++++++++++++++++++++++++++++++++
7 files changed, 394 insertions(+), 40 deletions(-)
create mode 100644 lib/igt_io.c
create mode 100644 lib/igt_io.h
create mode 100644 tests/msm_mapping.c
--
2.33.1
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH igt 1/2] igt: Split out I/O helpers
2021-11-30 0:43 ` [igt-dev] " Rob Clark
@ 2021-11-30 0:43 ` Rob Clark
-1 siblings, 0 replies; 14+ messages in thread
From: Rob Clark @ 2021-11-30 0:43 UTC (permalink / raw)
To: igt-dev
Cc: freedreno, linux-arm-msm, Akhil P Oommen, Jordan Crouse, Rob Clark
From: Rob Clark <robdclark@chromium.org>
Split the readN()/writeN() helpers out into an igt_io module, so they
can be re-used by tests.
Signed-off-by: Rob Clark <robdclark@chromium.org>
---
lib/igt_io.c | 96 +++++++++++++++++++++++++++++++++++++++++++++++++
lib/igt_io.h | 33 +++++++++++++++++
lib/igt_sysfs.c | 45 +++--------------------
lib/meson.build | 1 +
4 files changed, 135 insertions(+), 40 deletions(-)
create mode 100644 lib/igt_io.c
create mode 100644 lib/igt_io.h
diff --git a/lib/igt_io.c b/lib/igt_io.c
new file mode 100644
index 00000000..ad54cbe5
--- /dev/null
+++ b/lib/igt_io.c
@@ -0,0 +1,96 @@
+/*
+ * Copyright © 2016 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ *
+ */
+
+#include <errno.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+#include "igt_io.h"
+
+/**
+ * SECTION:igt_io
+ * @short_description: Helpers for file I/O
+ * @title: io
+ * @include: igt_io.h
+ *
+ * This library provides helpers for file I/O
+ */
+
+/**
+ * igt_readn:
+ * @fd: the file descriptor
+ * @buf: buffer where the contents will be stored, allocated by the caller
+ * @size: size of the buffer
+ *
+ * Read from fd into provided buffer until the buffer is full or EOF
+ *
+ * Returns:
+ * -errorno on failure or bytes read on success
+ */
+ssize_t igt_readn(int fd, char *buf, size_t len)
+{
+ ssize_t ret;
+ size_t total = 0;
+
+ do {
+ ret = read(fd, buf + total, len - total);
+ if (ret < 0)
+ ret = -errno;
+ if (ret == -EINTR || ret == -EAGAIN)
+ continue;
+ if (ret <= 0)
+ break;
+ total += ret;
+ } while (total != len);
+ return total ?: ret;
+}
+
+/**
+ * igt_writen:
+ * @fd: the file descriptor
+ * @buf: the block with the contents to write
+ * @len: the length to write
+ *
+ * This writes @len bytes from @data to the sysfs file.
+ *
+ * Returns:
+ * -errorno on failure or bytes read on success
+ */
+ssize_t igt_writen(int fd, const char *buf, size_t len)
+{
+ ssize_t ret;
+ size_t total = 0;
+
+ do {
+ ret = write(fd, buf + total, len - total);
+ if (ret < 0)
+ ret = -errno;
+ if (ret == -EINTR || ret == -EAGAIN)
+ continue;
+ if (ret <= 0)
+ break;
+ total += ret;
+ } while (total != len);
+ return total ?: ret;
+}
diff --git a/lib/igt_io.h b/lib/igt_io.h
new file mode 100644
index 00000000..eb9ffee1
--- /dev/null
+++ b/lib/igt_io.h
@@ -0,0 +1,33 @@
+/*
+ * Copyright © 2016 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ *
+ */
+
+#ifndef __IGT_IO_H__
+#define __IGT_IO_H__
+
+#include <stdio.h>
+
+ssize_t igt_readn(int fd, char *buf, size_t len);
+ssize_t igt_writen(int fd, const char *buf, size_t len);
+
+#endif /* __IGT_IO_H__ */
diff --git a/lib/igt_sysfs.c b/lib/igt_sysfs.c
index ee75e3ef..f8ef23e2 100644
--- a/lib/igt_sysfs.c
+++ b/lib/igt_sysfs.c
@@ -42,6 +42,7 @@
#include "igt_core.h"
#include "igt_sysfs.h"
#include "igt_device.h"
+#include "igt_io.h"
/**
* SECTION:igt_sysfs
@@ -53,42 +54,6 @@
* provides basic support for like igt_sysfs_open().
*/
-static ssize_t readN(int fd, char *buf, size_t len)
-{
- ssize_t ret;
- size_t total = 0;
-
- do {
- ret = read(fd, buf + total, len - total);
- if (ret < 0)
- ret = -errno;
- if (ret == -EINTR || ret == -EAGAIN)
- continue;
- if (ret <= 0)
- break;
- total += ret;
- } while (total != len);
- return total ?: ret;
-}
-
-static ssize_t writeN(int fd, const char *buf, size_t len)
-{
- ssize_t ret;
- size_t total = 0;
-
- do {
- ret = write(fd, buf + total, len - total);
- if (ret < 0)
- ret = -errno;
- if (ret == -EINTR || ret == -EAGAIN)
- continue;
- if (ret <= 0)
- break;
- total += ret;
- } while (total != len);
- return total ?: ret;
-}
-
/**
* igt_sysfs_path:
* @device: fd of the device
@@ -159,7 +124,7 @@ int igt_sysfs_write(int dir, const char *attr, const void *data, int len)
if (igt_debug_on(fd < 0))
return -errno;
- len = writeN(fd, data, len);
+ len = igt_writen(fd, data, len);
close(fd);
return len;
@@ -185,7 +150,7 @@ int igt_sysfs_read(int dir, const char *attr, void *data, int len)
if (igt_debug_on(fd < 0))
return -errno;
- len = readN(fd, data, len);
+ len = igt_readn(fd, data, len);
close(fd);
return len;
@@ -237,7 +202,7 @@ char *igt_sysfs_get(int dir, const char *attr)
if (igt_debug_on(!buf))
goto out;
- while ((ret = readN(fd, buf + offset, rem)) == rem) {
+ while ((ret = igt_readn(fd, buf + offset, rem)) == rem) {
char *newbuf;
newbuf = realloc(buf, 2*len);
@@ -330,7 +295,7 @@ int igt_sysfs_vprintf(int dir, const char *attr, const char *fmt, va_list ap)
}
}
- ret = writeN(fd, buf, ret);
+ ret = igt_writen(fd, buf, ret);
close(fd);
if (buf != stack)
diff --git a/lib/meson.build b/lib/meson.build
index 297b0ad2..b9568a71 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -19,6 +19,7 @@ lib_sources = [
'igt_aux.c',
'igt_gt.c',
'igt_halffloat.c',
+ 'igt_io.c',
'igt_matrix.c',
'igt_params.c',
'igt_perf.c',
--
2.33.1
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [igt-dev] [PATCH igt 1/2] igt: Split out I/O helpers
@ 2021-11-30 0:43 ` Rob Clark
0 siblings, 0 replies; 14+ messages in thread
From: Rob Clark @ 2021-11-30 0:43 UTC (permalink / raw)
To: igt-dev
Cc: Rob Clark, linux-arm-msm, freedreno, Akhil P Oommen, Jordan Crouse
From: Rob Clark <robdclark@chromium.org>
Split the readN()/writeN() helpers out into an igt_io module, so they
can be re-used by tests.
Signed-off-by: Rob Clark <robdclark@chromium.org>
---
lib/igt_io.c | 96 +++++++++++++++++++++++++++++++++++++++++++++++++
lib/igt_io.h | 33 +++++++++++++++++
lib/igt_sysfs.c | 45 +++--------------------
lib/meson.build | 1 +
4 files changed, 135 insertions(+), 40 deletions(-)
create mode 100644 lib/igt_io.c
create mode 100644 lib/igt_io.h
diff --git a/lib/igt_io.c b/lib/igt_io.c
new file mode 100644
index 00000000..ad54cbe5
--- /dev/null
+++ b/lib/igt_io.c
@@ -0,0 +1,96 @@
+/*
+ * Copyright © 2016 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ *
+ */
+
+#include <errno.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+#include "igt_io.h"
+
+/**
+ * SECTION:igt_io
+ * @short_description: Helpers for file I/O
+ * @title: io
+ * @include: igt_io.h
+ *
+ * This library provides helpers for file I/O
+ */
+
+/**
+ * igt_readn:
+ * @fd: the file descriptor
+ * @buf: buffer where the contents will be stored, allocated by the caller
+ * @size: size of the buffer
+ *
+ * Read from fd into provided buffer until the buffer is full or EOF
+ *
+ * Returns:
+ * -errorno on failure or bytes read on success
+ */
+ssize_t igt_readn(int fd, char *buf, size_t len)
+{
+ ssize_t ret;
+ size_t total = 0;
+
+ do {
+ ret = read(fd, buf + total, len - total);
+ if (ret < 0)
+ ret = -errno;
+ if (ret == -EINTR || ret == -EAGAIN)
+ continue;
+ if (ret <= 0)
+ break;
+ total += ret;
+ } while (total != len);
+ return total ?: ret;
+}
+
+/**
+ * igt_writen:
+ * @fd: the file descriptor
+ * @buf: the block with the contents to write
+ * @len: the length to write
+ *
+ * This writes @len bytes from @data to the sysfs file.
+ *
+ * Returns:
+ * -errorno on failure or bytes read on success
+ */
+ssize_t igt_writen(int fd, const char *buf, size_t len)
+{
+ ssize_t ret;
+ size_t total = 0;
+
+ do {
+ ret = write(fd, buf + total, len - total);
+ if (ret < 0)
+ ret = -errno;
+ if (ret == -EINTR || ret == -EAGAIN)
+ continue;
+ if (ret <= 0)
+ break;
+ total += ret;
+ } while (total != len);
+ return total ?: ret;
+}
diff --git a/lib/igt_io.h b/lib/igt_io.h
new file mode 100644
index 00000000..eb9ffee1
--- /dev/null
+++ b/lib/igt_io.h
@@ -0,0 +1,33 @@
+/*
+ * Copyright © 2016 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ *
+ */
+
+#ifndef __IGT_IO_H__
+#define __IGT_IO_H__
+
+#include <stdio.h>
+
+ssize_t igt_readn(int fd, char *buf, size_t len);
+ssize_t igt_writen(int fd, const char *buf, size_t len);
+
+#endif /* __IGT_IO_H__ */
diff --git a/lib/igt_sysfs.c b/lib/igt_sysfs.c
index ee75e3ef..f8ef23e2 100644
--- a/lib/igt_sysfs.c
+++ b/lib/igt_sysfs.c
@@ -42,6 +42,7 @@
#include "igt_core.h"
#include "igt_sysfs.h"
#include "igt_device.h"
+#include "igt_io.h"
/**
* SECTION:igt_sysfs
@@ -53,42 +54,6 @@
* provides basic support for like igt_sysfs_open().
*/
-static ssize_t readN(int fd, char *buf, size_t len)
-{
- ssize_t ret;
- size_t total = 0;
-
- do {
- ret = read(fd, buf + total, len - total);
- if (ret < 0)
- ret = -errno;
- if (ret == -EINTR || ret == -EAGAIN)
- continue;
- if (ret <= 0)
- break;
- total += ret;
- } while (total != len);
- return total ?: ret;
-}
-
-static ssize_t writeN(int fd, const char *buf, size_t len)
-{
- ssize_t ret;
- size_t total = 0;
-
- do {
- ret = write(fd, buf + total, len - total);
- if (ret < 0)
- ret = -errno;
- if (ret == -EINTR || ret == -EAGAIN)
- continue;
- if (ret <= 0)
- break;
- total += ret;
- } while (total != len);
- return total ?: ret;
-}
-
/**
* igt_sysfs_path:
* @device: fd of the device
@@ -159,7 +124,7 @@ int igt_sysfs_write(int dir, const char *attr, const void *data, int len)
if (igt_debug_on(fd < 0))
return -errno;
- len = writeN(fd, data, len);
+ len = igt_writen(fd, data, len);
close(fd);
return len;
@@ -185,7 +150,7 @@ int igt_sysfs_read(int dir, const char *attr, void *data, int len)
if (igt_debug_on(fd < 0))
return -errno;
- len = readN(fd, data, len);
+ len = igt_readn(fd, data, len);
close(fd);
return len;
@@ -237,7 +202,7 @@ char *igt_sysfs_get(int dir, const char *attr)
if (igt_debug_on(!buf))
goto out;
- while ((ret = readN(fd, buf + offset, rem)) == rem) {
+ while ((ret = igt_readn(fd, buf + offset, rem)) == rem) {
char *newbuf;
newbuf = realloc(buf, 2*len);
@@ -330,7 +295,7 @@ int igt_sysfs_vprintf(int dir, const char *attr, const char *fmt, va_list ap)
}
}
- ret = writeN(fd, buf, ret);
+ ret = igt_writen(fd, buf, ret);
close(fd);
if (buf != stack)
diff --git a/lib/meson.build b/lib/meson.build
index 297b0ad2..b9568a71 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -19,6 +19,7 @@ lib_sources = [
'igt_aux.c',
'igt_gt.c',
'igt_halffloat.c',
+ 'igt_io.c',
'igt_matrix.c',
'igt_params.c',
'igt_perf.c',
--
2.33.1
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH igt 2/2] msm: Add test for kernel buffer permissions
2021-11-30 0:43 ` [igt-dev] " Rob Clark
@ 2021-11-30 0:43 ` Rob Clark
-1 siblings, 0 replies; 14+ messages in thread
From: Rob Clark @ 2021-11-30 0:43 UTC (permalink / raw)
To: igt-dev
Cc: freedreno, linux-arm-msm, Akhil P Oommen, Jordan Crouse, Rob Clark
From: Rob Clark <robdclark@chromium.org>
Tests that reads and/or writes to kernel managed buffers which should be
inaccessible to userspace controlled cmdstream, are indeed inaccessible.
Signed-off-by: Rob Clark <robdclark@chromium.org>
---
lib/igt_msm.h | 1 +
tests/meson.build | 1 +
tests/msm_mapping.c | 257 ++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 259 insertions(+)
create mode 100644 tests/msm_mapping.c
diff --git a/lib/igt_msm.h b/lib/igt_msm.h
index 421d23ed..6008020b 100644
--- a/lib/igt_msm.h
+++ b/lib/igt_msm.h
@@ -100,6 +100,7 @@ enum adreno_pm4_type3_packets {
CP_WAIT_MEM_GTE = 20,
CP_WAIT_REG_MEM = 60,
CP_MEM_WRITE = 61,
+ CP_MEM_TO_MEM = 115,
};
static inline unsigned
diff --git a/tests/meson.build b/tests/meson.build
index 7b7d6bf8..c14acf99 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -60,6 +60,7 @@ test_progs = [
'kms_vrr',
'kms_writeback',
'meta_test',
+ 'msm_mapping',
'msm_recovery',
'msm_submit',
'panfrost_get_param',
diff --git a/tests/msm_mapping.c b/tests/msm_mapping.c
new file mode 100644
index 00000000..e1474f9f
--- /dev/null
+++ b/tests/msm_mapping.c
@@ -0,0 +1,257 @@
+/*
+ * Copyright © 2021 Google, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include <ctype.h>
+#include <fcntl.h>
+#include <glob.h>
+#include <string.h>
+#include <sys/poll.h>
+#include <sys/stat.h>
+
+#include "igt.h"
+#include "igt_msm.h"
+#include "igt_io.h"
+
+/*
+ * Tests to ensure various kernel controlled buffers are mapped with the
+ * appropriate permissions (either read-only or not-accessible to userspace
+ * controlled cmdstream)
+ */
+
+/*
+ * Helper to get and clear devcore dumps
+ */
+
+static char *
+get_and_clear_devcore(void)
+{
+ glob_t glob_buf = {0};
+ char *buf = NULL;
+ int ret, fd;
+
+ ret = glob("/sys/class/devcoredump/devcd*/data", GLOB_NOSORT, NULL, &glob_buf);
+ if ((ret == GLOB_NOMATCH) || !glob_buf.gl_pathc)
+ return NULL;
+
+ fd = open(glob_buf.gl_pathv[0], O_RDWR);
+
+ if (fd >= 0) {
+ /* We don't need to read the entire devcore, the first bit is
+ * sufficient for our purposes:
+ */
+ buf = calloc(1, 0x1000);
+ igt_readn(fd, buf, 0x1000);
+
+ /* Clear the devcore: */
+ igt_writen(fd, "1", 1);
+ }
+
+ globfree(&glob_buf);
+
+ return buf;
+}
+
+/*
+ * Helper to find named buffer address
+ */
+
+static const char *
+get_line(char **buf)
+{
+ char *ret, *eol;
+
+ ret = *buf;
+ eol = strstr(*buf, "\n");
+
+ if (!eol) {
+ /* could be last line in file: */
+ *buf = NULL;
+ return ret;
+ }
+
+ *eol = '\0';
+ *buf += 1 + strlen(ret);
+
+ return ret;
+}
+
+static bool
+endswith(const char *str, const char *end)
+{
+ char *p = strstr(str, end);
+
+ /* Trim trailing whitespace: */
+ if (p) {
+ char *c = p;
+ while (c) {
+ if (isspace(*c)) {
+ *c = '\0';
+ break;
+ }
+ c++;
+ }
+ }
+
+ return p && (strlen(p) == strlen(end));
+}
+
+static uint64_t
+get_bo_addr(int drm_fd, const char *name)
+{
+ char buf[0x4000];
+ char *p = buf;
+
+ igt_debugfs_read(drm_fd, "gem", buf);
+
+ /* NOTE: the contents of the debugfs file look like:
+ *
+ * flags id ref offset kaddr size madv name
+ * 00040000: I 0 ( 1) 00000000 ffffffc0104b9000 00004096 memptrs
+ * vmas: [gpu: aspace=ffffff808bf03e00, 1000000000000,mapped,inuse=1]
+ * 00020002: I 0 ( 1) 00000000 ffffffc012001000 00032768 ring0
+ * vmas: [gpu: aspace=ffffff808bf03e00, 1000000001000,mapped,inuse=1]
+ *
+ * There can be potentially multiple vma's per bo, listed on the lines
+ * following the line for the buffer (which ends in the buffer name),
+ * but this should not be the case for any kernel controlled buffers.
+ */
+
+ while (*p) {
+ const char *line = get_line(&p);
+
+ if (endswith(line, name)) {
+ uint64_t addr, dummy;
+ int ret;
+
+ line = get_line(&p);
+
+ igt_fail_on(!line);
+
+ ret = sscanf(line, " vmas: [gpu: aspace=%"PRIx64", %"PRIx64",mapped,inuse=1]",
+ &dummy, &addr);
+ igt_fail_on(ret != 2);
+
+ return addr;
+ }
+ }
+
+ return 0;
+}
+
+/*
+ * Helper for testing access to the named buffer
+ */
+static void
+do_mapping_test(struct msm_pipe *pipe, const char *buffername, bool write)
+{
+ struct msm_bo *scratch_bo = NULL;
+ struct msm_cmd *cmd;
+ char *devcore, *s;
+ uint64_t addr, fault_addr;
+ int fence_fd, ret;
+
+ /* Clear any existing devcore's: */
+ while ((devcore = get_and_clear_devcore())) {
+ free(devcore);
+ }
+
+ addr = get_bo_addr(pipe->dev->fd, buffername);
+ igt_skip_on(addr == 0);
+
+ cmd = igt_msm_cmd_new(pipe, 0x1000);
+
+ if (write) {
+ msm_cmd_pkt7(cmd, CP_MEM_WRITE, 3);
+ msm_cmd_emit(cmd, lower_32_bits(addr)); /* ADDR_LO */
+ msm_cmd_emit(cmd, upper_32_bits(addr)); /* ADDR_HI */
+ msm_cmd_emit(cmd, 0x123); /* VAL */
+ } else {
+ scratch_bo = igt_msm_bo_new(pipe->dev, 0x1000, MSM_BO_WC);
+ msm_cmd_pkt7(cmd, CP_MEM_TO_MEM, 5);
+ msm_cmd_emit(cmd, 0);
+ msm_cmd_bo (cmd, scratch_bo, 0); /* DEST_ADDR_LO/HI */
+ msm_cmd_emit(cmd, lower_32_bits(addr)); /* SRC_A_ADDR_LO */
+ msm_cmd_emit(cmd, upper_32_bits(addr)); /* SRC_A_ADDR_HI */
+ }
+
+ fence_fd = igt_msm_cmd_submit(cmd);
+
+ /* Wait for submit to complete: */
+ poll(&(struct pollfd){fence_fd, POLLIN}, 1, -1);
+ close(fence_fd);
+
+ igt_msm_bo_free(scratch_bo);
+
+ /* And now we should have gotten a devcore from the iova fault
+ * triggered by the read or write:
+ */
+ devcore = get_and_clear_devcore();
+ igt_fail_on(!devcore);
+
+ /* Make sure the devcore is from iova fault: */
+ igt_fail_on(!strstr(devcore, "fault-info"));
+
+ s = strstr(devcore, " - far: ");
+ igt_fail_on(!s);
+
+ ret = sscanf(s, " - far: %"PRIx64, &fault_addr);
+ igt_fail_on(ret != 1);
+ igt_fail_on(addr != fault_addr);
+}
+
+/*
+ * Tests for drm/msm hangcheck, recovery, and fault handling
+ */
+
+igt_main
+{
+ struct msm_device *dev = NULL;
+ struct msm_pipe *pipe = NULL;
+
+ igt_fixture {
+ dev = igt_msm_dev_open();
+ pipe = igt_msm_pipe_open(dev, 0);
+ }
+
+ igt_describe("Test ringbuffer mapping, should be read-only");
+ igt_subtest("ring") {
+ do_mapping_test(pipe, "ring0", true);
+ }
+
+ igt_describe("Test sqefw mapping, should be read-only");
+ igt_subtest("sqefw") {
+ igt_require(dev->gen >= 6);
+ do_mapping_test(pipe, "sqefw", true);
+ }
+
+ igt_describe("Test shadow mapping, should be inaccessible");
+ igt_subtest("shadow") {
+ do_mapping_test(pipe, "shadow", true);
+ do_mapping_test(pipe, "shadow", false);
+ }
+
+ igt_fixture {
+ igt_msm_pipe_close(pipe);
+ igt_msm_dev_close(dev);
+ }
+}
--
2.33.1
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [igt-dev] [PATCH igt 2/2] msm: Add test for kernel buffer permissions
@ 2021-11-30 0:43 ` Rob Clark
0 siblings, 0 replies; 14+ messages in thread
From: Rob Clark @ 2021-11-30 0:43 UTC (permalink / raw)
To: igt-dev
Cc: Rob Clark, linux-arm-msm, freedreno, Akhil P Oommen, Jordan Crouse
From: Rob Clark <robdclark@chromium.org>
Tests that reads and/or writes to kernel managed buffers which should be
inaccessible to userspace controlled cmdstream, are indeed inaccessible.
Signed-off-by: Rob Clark <robdclark@chromium.org>
---
lib/igt_msm.h | 1 +
tests/meson.build | 1 +
tests/msm_mapping.c | 257 ++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 259 insertions(+)
create mode 100644 tests/msm_mapping.c
diff --git a/lib/igt_msm.h b/lib/igt_msm.h
index 421d23ed..6008020b 100644
--- a/lib/igt_msm.h
+++ b/lib/igt_msm.h
@@ -100,6 +100,7 @@ enum adreno_pm4_type3_packets {
CP_WAIT_MEM_GTE = 20,
CP_WAIT_REG_MEM = 60,
CP_MEM_WRITE = 61,
+ CP_MEM_TO_MEM = 115,
};
static inline unsigned
diff --git a/tests/meson.build b/tests/meson.build
index 7b7d6bf8..c14acf99 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -60,6 +60,7 @@ test_progs = [
'kms_vrr',
'kms_writeback',
'meta_test',
+ 'msm_mapping',
'msm_recovery',
'msm_submit',
'panfrost_get_param',
diff --git a/tests/msm_mapping.c b/tests/msm_mapping.c
new file mode 100644
index 00000000..e1474f9f
--- /dev/null
+++ b/tests/msm_mapping.c
@@ -0,0 +1,257 @@
+/*
+ * Copyright © 2021 Google, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include <ctype.h>
+#include <fcntl.h>
+#include <glob.h>
+#include <string.h>
+#include <sys/poll.h>
+#include <sys/stat.h>
+
+#include "igt.h"
+#include "igt_msm.h"
+#include "igt_io.h"
+
+/*
+ * Tests to ensure various kernel controlled buffers are mapped with the
+ * appropriate permissions (either read-only or not-accessible to userspace
+ * controlled cmdstream)
+ */
+
+/*
+ * Helper to get and clear devcore dumps
+ */
+
+static char *
+get_and_clear_devcore(void)
+{
+ glob_t glob_buf = {0};
+ char *buf = NULL;
+ int ret, fd;
+
+ ret = glob("/sys/class/devcoredump/devcd*/data", GLOB_NOSORT, NULL, &glob_buf);
+ if ((ret == GLOB_NOMATCH) || !glob_buf.gl_pathc)
+ return NULL;
+
+ fd = open(glob_buf.gl_pathv[0], O_RDWR);
+
+ if (fd >= 0) {
+ /* We don't need to read the entire devcore, the first bit is
+ * sufficient for our purposes:
+ */
+ buf = calloc(1, 0x1000);
+ igt_readn(fd, buf, 0x1000);
+
+ /* Clear the devcore: */
+ igt_writen(fd, "1", 1);
+ }
+
+ globfree(&glob_buf);
+
+ return buf;
+}
+
+/*
+ * Helper to find named buffer address
+ */
+
+static const char *
+get_line(char **buf)
+{
+ char *ret, *eol;
+
+ ret = *buf;
+ eol = strstr(*buf, "\n");
+
+ if (!eol) {
+ /* could be last line in file: */
+ *buf = NULL;
+ return ret;
+ }
+
+ *eol = '\0';
+ *buf += 1 + strlen(ret);
+
+ return ret;
+}
+
+static bool
+endswith(const char *str, const char *end)
+{
+ char *p = strstr(str, end);
+
+ /* Trim trailing whitespace: */
+ if (p) {
+ char *c = p;
+ while (c) {
+ if (isspace(*c)) {
+ *c = '\0';
+ break;
+ }
+ c++;
+ }
+ }
+
+ return p && (strlen(p) == strlen(end));
+}
+
+static uint64_t
+get_bo_addr(int drm_fd, const char *name)
+{
+ char buf[0x4000];
+ char *p = buf;
+
+ igt_debugfs_read(drm_fd, "gem", buf);
+
+ /* NOTE: the contents of the debugfs file look like:
+ *
+ * flags id ref offset kaddr size madv name
+ * 00040000: I 0 ( 1) 00000000 ffffffc0104b9000 00004096 memptrs
+ * vmas: [gpu: aspace=ffffff808bf03e00, 1000000000000,mapped,inuse=1]
+ * 00020002: I 0 ( 1) 00000000 ffffffc012001000 00032768 ring0
+ * vmas: [gpu: aspace=ffffff808bf03e00, 1000000001000,mapped,inuse=1]
+ *
+ * There can be potentially multiple vma's per bo, listed on the lines
+ * following the line for the buffer (which ends in the buffer name),
+ * but this should not be the case for any kernel controlled buffers.
+ */
+
+ while (*p) {
+ const char *line = get_line(&p);
+
+ if (endswith(line, name)) {
+ uint64_t addr, dummy;
+ int ret;
+
+ line = get_line(&p);
+
+ igt_fail_on(!line);
+
+ ret = sscanf(line, " vmas: [gpu: aspace=%"PRIx64", %"PRIx64",mapped,inuse=1]",
+ &dummy, &addr);
+ igt_fail_on(ret != 2);
+
+ return addr;
+ }
+ }
+
+ return 0;
+}
+
+/*
+ * Helper for testing access to the named buffer
+ */
+static void
+do_mapping_test(struct msm_pipe *pipe, const char *buffername, bool write)
+{
+ struct msm_bo *scratch_bo = NULL;
+ struct msm_cmd *cmd;
+ char *devcore, *s;
+ uint64_t addr, fault_addr;
+ int fence_fd, ret;
+
+ /* Clear any existing devcore's: */
+ while ((devcore = get_and_clear_devcore())) {
+ free(devcore);
+ }
+
+ addr = get_bo_addr(pipe->dev->fd, buffername);
+ igt_skip_on(addr == 0);
+
+ cmd = igt_msm_cmd_new(pipe, 0x1000);
+
+ if (write) {
+ msm_cmd_pkt7(cmd, CP_MEM_WRITE, 3);
+ msm_cmd_emit(cmd, lower_32_bits(addr)); /* ADDR_LO */
+ msm_cmd_emit(cmd, upper_32_bits(addr)); /* ADDR_HI */
+ msm_cmd_emit(cmd, 0x123); /* VAL */
+ } else {
+ scratch_bo = igt_msm_bo_new(pipe->dev, 0x1000, MSM_BO_WC);
+ msm_cmd_pkt7(cmd, CP_MEM_TO_MEM, 5);
+ msm_cmd_emit(cmd, 0);
+ msm_cmd_bo (cmd, scratch_bo, 0); /* DEST_ADDR_LO/HI */
+ msm_cmd_emit(cmd, lower_32_bits(addr)); /* SRC_A_ADDR_LO */
+ msm_cmd_emit(cmd, upper_32_bits(addr)); /* SRC_A_ADDR_HI */
+ }
+
+ fence_fd = igt_msm_cmd_submit(cmd);
+
+ /* Wait for submit to complete: */
+ poll(&(struct pollfd){fence_fd, POLLIN}, 1, -1);
+ close(fence_fd);
+
+ igt_msm_bo_free(scratch_bo);
+
+ /* And now we should have gotten a devcore from the iova fault
+ * triggered by the read or write:
+ */
+ devcore = get_and_clear_devcore();
+ igt_fail_on(!devcore);
+
+ /* Make sure the devcore is from iova fault: */
+ igt_fail_on(!strstr(devcore, "fault-info"));
+
+ s = strstr(devcore, " - far: ");
+ igt_fail_on(!s);
+
+ ret = sscanf(s, " - far: %"PRIx64, &fault_addr);
+ igt_fail_on(ret != 1);
+ igt_fail_on(addr != fault_addr);
+}
+
+/*
+ * Tests for drm/msm hangcheck, recovery, and fault handling
+ */
+
+igt_main
+{
+ struct msm_device *dev = NULL;
+ struct msm_pipe *pipe = NULL;
+
+ igt_fixture {
+ dev = igt_msm_dev_open();
+ pipe = igt_msm_pipe_open(dev, 0);
+ }
+
+ igt_describe("Test ringbuffer mapping, should be read-only");
+ igt_subtest("ring") {
+ do_mapping_test(pipe, "ring0", true);
+ }
+
+ igt_describe("Test sqefw mapping, should be read-only");
+ igt_subtest("sqefw") {
+ igt_require(dev->gen >= 6);
+ do_mapping_test(pipe, "sqefw", true);
+ }
+
+ igt_describe("Test shadow mapping, should be inaccessible");
+ igt_subtest("shadow") {
+ do_mapping_test(pipe, "shadow", true);
+ do_mapping_test(pipe, "shadow", false);
+ }
+
+ igt_fixture {
+ igt_msm_pipe_close(pipe);
+ igt_msm_dev_close(dev);
+ }
+}
--
2.33.1
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [igt-dev] ✓ Fi.CI.BAT: success for msm+lib: Add test for buffer mapping permissions
2021-11-30 0:43 ` [igt-dev] " Rob Clark
` (2 preceding siblings ...)
(?)
@ 2021-11-30 1:35 ` Patchwork
-1 siblings, 0 replies; 14+ messages in thread
From: Patchwork @ 2021-11-30 1:35 UTC (permalink / raw)
To: Rob Clark; +Cc: igt-dev
[-- Attachment #1: Type: text/plain, Size: 6971 bytes --]
== Series Details ==
Series: msm+lib: Add test for buffer mapping permissions
URL : https://patchwork.freedesktop.org/series/97392/
State : success
== Summary ==
CI Bug Log - changes from IGT_6295 -> IGTPW_6450
====================================================
Summary
-------
**SUCCESS**
No regressions found.
External URL: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/index.html
Participating hosts (35 -> 34)
------------------------------
Additional (1): fi-pnv-d510
Missing (2): fi-bsw-cyan fi-icl-u2
Known issues
------------
Here are the changes found in IGTPW_6450 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@amdgpu/amd_basic@cs-gfx:
- fi-rkl-guc: NOTRUN -> [SKIP][1] ([fdo#109315]) +17 similar issues
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/fi-rkl-guc/igt@amdgpu/amd_basic@cs-gfx.html
* igt@amdgpu/amd_basic@cs-multi-fence:
- fi-blb-e6850: NOTRUN -> [SKIP][2] ([fdo#109271]) +17 similar issues
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/fi-blb-e6850/igt@amdgpu/amd_basic@cs-multi-fence.html
* igt@amdgpu/amd_cs_nop@nop-compute0:
- fi-ilk-650: NOTRUN -> [SKIP][3] ([fdo#109271]) +39 similar issues
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/fi-ilk-650/igt@amdgpu/amd_cs_nop@nop-compute0.html
* igt@amdgpu/amd_cs_nop@sync-gfx0:
- fi-bsw-n3050: NOTRUN -> [SKIP][4] ([fdo#109271]) +17 similar issues
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/fi-bsw-n3050/igt@amdgpu/amd_cs_nop@sync-gfx0.html
* igt@gem_flink_basic@bad-flink:
- fi-skl-6600u: [PASS][5] -> [FAIL][6] ([i915#4547])
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_6295/fi-skl-6600u/igt@gem_flink_basic@bad-flink.html
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/fi-skl-6600u/igt@gem_flink_basic@bad-flink.html
* igt@kms_chamelium@dp-hpd-fast:
- fi-ilk-650: NOTRUN -> [SKIP][7] ([fdo#109271] / [fdo#111827]) +8 similar issues
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/fi-ilk-650/igt@kms_chamelium@dp-hpd-fast.html
* igt@kms_frontbuffer_tracking@basic:
- fi-cml-u2: [PASS][8] -> [DMESG-WARN][9] ([i915#4269])
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_6295/fi-cml-u2/igt@kms_frontbuffer_tracking@basic.html
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/fi-cml-u2/igt@kms_frontbuffer_tracking@basic.html
- fi-cfl-8109u: [PASS][10] -> [DMESG-FAIL][11] ([i915#295])
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_6295/fi-cfl-8109u/igt@kms_frontbuffer_tracking@basic.html
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/fi-cfl-8109u/igt@kms_frontbuffer_tracking@basic.html
* igt@kms_pipe_crc_basic@compare-crc-sanitycheck-pipe-b:
- fi-cfl-8109u: [PASS][12] -> [DMESG-WARN][13] ([i915#295]) +10 similar issues
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_6295/fi-cfl-8109u/igt@kms_pipe_crc_basic@compare-crc-sanitycheck-pipe-b.html
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/fi-cfl-8109u/igt@kms_pipe_crc_basic@compare-crc-sanitycheck-pipe-b.html
* igt@prime_vgem@basic-userptr:
- fi-pnv-d510: NOTRUN -> [SKIP][14] ([fdo#109271]) +57 similar issues
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/fi-pnv-d510/igt@prime_vgem@basic-userptr.html
* igt@runner@aborted:
- fi-skl-6600u: NOTRUN -> [FAIL][15] ([i915#3363] / [i915#4312])
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/fi-skl-6600u/igt@runner@aborted.html
- fi-bdw-5557u: NOTRUN -> [FAIL][16] ([i915#1602] / [i915#2426] / [i915#4312])
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/fi-bdw-5557u/igt@runner@aborted.html
#### Possible fixes ####
* igt@gem_exec_suspend@basic-s3:
- fi-bdw-5557u: [INCOMPLETE][17] ([i915#146]) -> [PASS][18]
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_6295/fi-bdw-5557u/igt@gem_exec_suspend@basic-s3.html
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/fi-bdw-5557u/igt@gem_exec_suspend@basic-s3.html
* igt@i915_selftest@live@execlists:
- fi-bsw-n3050: [INCOMPLETE][19] ([i915#2940]) -> [PASS][20]
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_6295/fi-bsw-n3050/igt@i915_selftest@live@execlists.html
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/fi-bsw-n3050/igt@i915_selftest@live@execlists.html
* igt@i915_selftest@live@gt_engines:
- fi-rkl-guc: [INCOMPLETE][21] ([i915#4432]) -> [PASS][22]
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_6295/fi-rkl-guc/igt@i915_selftest@live@gt_engines.html
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/fi-rkl-guc/igt@i915_selftest@live@gt_engines.html
* igt@i915_selftest@live@requests:
- fi-blb-e6850: [DMESG-FAIL][23] ([i915#4528]) -> [PASS][24]
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_6295/fi-blb-e6850/igt@i915_selftest@live@requests.html
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/fi-blb-e6850/igt@i915_selftest@live@requests.html
{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#109315]: https://bugs.freedesktop.org/show_bug.cgi?id=109315
[fdo#111827]: https://bugs.freedesktop.org/show_bug.cgi?id=111827
[i915#146]: https://gitlab.freedesktop.org/drm/intel/issues/146
[i915#1602]: https://gitlab.freedesktop.org/drm/intel/issues/1602
[i915#1982]: https://gitlab.freedesktop.org/drm/intel/issues/1982
[i915#2411]: https://gitlab.freedesktop.org/drm/intel/issues/2411
[i915#2426]: https://gitlab.freedesktop.org/drm/intel/issues/2426
[i915#2940]: https://gitlab.freedesktop.org/drm/intel/issues/2940
[i915#295]: https://gitlab.freedesktop.org/drm/intel/issues/295
[i915#3363]: https://gitlab.freedesktop.org/drm/intel/issues/3363
[i915#4269]: https://gitlab.freedesktop.org/drm/intel/issues/4269
[i915#4312]: https://gitlab.freedesktop.org/drm/intel/issues/4312
[i915#4432]: https://gitlab.freedesktop.org/drm/intel/issues/4432
[i915#4528]: https://gitlab.freedesktop.org/drm/intel/issues/4528
[i915#4547]: https://gitlab.freedesktop.org/drm/intel/issues/4547
Build changes
-------------
* CI: CI-20190529 -> None
* IGT: IGT_6295 -> IGTPW_6450
CI-20190529: 20190529
CI_DRM_10939: a45a9993b4633973f97a4b981ceeb23e4b0963f9 @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_6450: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/index.html
IGT_6295: 2d7f671b872ed856a97957051098974be2380019 @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
== Testlist changes ==
+igt@msm_mapping@ring
+igt@msm_mapping@shadow
+igt@msm_mapping@sqefw
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/index.html
[-- Attachment #2: Type: text/html, Size: 8248 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
* [igt-dev] ✗ Fi.CI.IGT: failure for msm+lib: Add test for buffer mapping permissions
2021-11-30 0:43 ` [igt-dev] " Rob Clark
` (3 preceding siblings ...)
(?)
@ 2021-11-30 5:54 ` Patchwork
-1 siblings, 0 replies; 14+ messages in thread
From: Patchwork @ 2021-11-30 5:54 UTC (permalink / raw)
To: Rob Clark; +Cc: igt-dev
[-- Attachment #1: Type: text/plain, Size: 30266 bytes --]
== Series Details ==
Series: msm+lib: Add test for buffer mapping permissions
URL : https://patchwork.freedesktop.org/series/97392/
State : failure
== Summary ==
CI Bug Log - changes from IGT_6295_full -> IGTPW_6450_full
====================================================
Summary
-------
**FAILURE**
Serious unknown changes coming with IGTPW_6450_full absolutely need to be
verified manually.
If you think the reported changes have nothing to do with the changes
introduced in IGTPW_6450_full, please notify your bug team to allow them
to document this new failure mode, which will reduce false positives in CI.
External URL: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/index.html
Participating hosts (7 -> 7)
------------------------------
No changes in participating hosts
Possible new issues
-------------------
Here are the unknown changes that may have been introduced in IGTPW_6450_full:
### IGT changes ###
#### Possible regressions ####
* igt@kms_cursor_legacy@all-pipes-torture-bo:
- shard-iclb: [PASS][1] -> [INCOMPLETE][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_6295/shard-iclb8/igt@kms_cursor_legacy@all-pipes-torture-bo.html
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-iclb6/igt@kms_cursor_legacy@all-pipes-torture-bo.html
Known issues
------------
Here are the changes found in IGTPW_6450_full that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@feature_discovery@display-2x:
- shard-tglb: NOTRUN -> [SKIP][3] ([i915#1839])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-tglb1/igt@feature_discovery@display-2x.html
- shard-iclb: NOTRUN -> [SKIP][4] ([i915#1839])
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-iclb1/igt@feature_discovery@display-2x.html
* igt@gem_create@create-massive:
- shard-kbl: NOTRUN -> [DMESG-WARN][5] ([i915#3002]) +1 similar issue
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-kbl1/igt@gem_create@create-massive.html
* igt@gem_ctx_persistence@legacy-engines-persistence:
- shard-snb: NOTRUN -> [SKIP][6] ([fdo#109271] / [i915#1099])
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-snb7/igt@gem_ctx_persistence@legacy-engines-persistence.html
* igt@gem_eio@unwedge-stress:
- shard-tglb: NOTRUN -> [TIMEOUT][7] ([i915#3063] / [i915#3648])
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-tglb6/igt@gem_eio@unwedge-stress.html
* igt@gem_exec_balancer@parallel-contexts:
- shard-tglb: NOTRUN -> [SKIP][8] ([i915#4525])
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-tglb6/igt@gem_exec_balancer@parallel-contexts.html
* igt@gem_exec_balancer@parallel-out-fence:
- shard-iclb: NOTRUN -> [SKIP][9] ([i915#4525]) +1 similar issue
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-iclb6/igt@gem_exec_balancer@parallel-out-fence.html
* igt@gem_exec_fair@basic-none-share@rcs0:
- shard-glk: [PASS][10] -> [FAIL][11] ([i915#2842])
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_6295/shard-glk1/igt@gem_exec_fair@basic-none-share@rcs0.html
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-glk6/igt@gem_exec_fair@basic-none-share@rcs0.html
* igt@gem_exec_fair@basic-pace@bcs0:
- shard-tglb: NOTRUN -> [FAIL][12] ([i915#2842]) +4 similar issues
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-tglb2/igt@gem_exec_fair@basic-pace@bcs0.html
* igt@gem_exec_fair@basic-pace@vcs0:
- shard-iclb: NOTRUN -> [FAIL][13] ([i915#2842]) +3 similar issues
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-iclb8/igt@gem_exec_fair@basic-pace@vcs0.html
* igt@gem_exec_fair@basic-pace@vcs1:
- shard-kbl: NOTRUN -> [FAIL][14] ([i915#2842])
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-kbl7/igt@gem_exec_fair@basic-pace@vcs1.html
* igt@gem_exec_params@secure-non-root:
- shard-tglb: NOTRUN -> [SKIP][15] ([fdo#112283])
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-tglb2/igt@gem_exec_params@secure-non-root.html
- shard-iclb: NOTRUN -> [SKIP][16] ([fdo#112283])
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-iclb4/igt@gem_exec_params@secure-non-root.html
* igt@gem_exec_schedule@semaphore-codependency:
- shard-snb: NOTRUN -> [SKIP][17] ([fdo#109271]) +125 similar issues
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-snb6/igt@gem_exec_schedule@semaphore-codependency.html
* igt@gem_lmem_swapping@parallel-random:
- shard-kbl: NOTRUN -> [SKIP][18] ([fdo#109271] / [i915#4613])
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-kbl6/igt@gem_lmem_swapping@parallel-random.html
* igt@gem_lmem_swapping@parallel-random-verify:
- shard-apl: NOTRUN -> [SKIP][19] ([fdo#109271] / [i915#4613])
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-apl6/igt@gem_lmem_swapping@parallel-random-verify.html
* igt@gem_pxp@create-regular-buffer:
- shard-iclb: NOTRUN -> [SKIP][20] ([i915#4270]) +1 similar issue
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-iclb6/igt@gem_pxp@create-regular-buffer.html
* igt@gem_pxp@protected-raw-src-copy-not-readible:
- shard-tglb: NOTRUN -> [SKIP][21] ([i915#4270]) +2 similar issues
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-tglb1/igt@gem_pxp@protected-raw-src-copy-not-readible.html
* igt@gem_render_copy@x-tiled-to-vebox-yf-tiled:
- shard-kbl: NOTRUN -> [SKIP][22] ([fdo#109271]) +113 similar issues
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-kbl7/igt@gem_render_copy@x-tiled-to-vebox-yf-tiled.html
* igt@gem_render_copy@yf-tiled-to-vebox-linear:
- shard-iclb: NOTRUN -> [SKIP][23] ([i915#768])
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-iclb6/igt@gem_render_copy@yf-tiled-to-vebox-linear.html
* igt@gen3_render_tiledy_blits:
- shard-tglb: NOTRUN -> [SKIP][24] ([fdo#109289]) +2 similar issues
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-tglb2/igt@gen3_render_tiledy_blits.html
* igt@gen9_exec_parse@bb-start-param:
- shard-tglb: NOTRUN -> [SKIP][25] ([i915#2856]) +2 similar issues
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-tglb1/igt@gen9_exec_parse@bb-start-param.html
* igt@gen9_exec_parse@unaligned-jump:
- shard-iclb: NOTRUN -> [SKIP][26] ([i915#2856]) +1 similar issue
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-iclb7/igt@gen9_exec_parse@unaligned-jump.html
* igt@i915_pm_rpm@dpms-mode-unset-non-lpsp:
- shard-tglb: NOTRUN -> [SKIP][27] ([fdo#111644] / [i915#1397] / [i915#2411])
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-tglb8/igt@i915_pm_rpm@dpms-mode-unset-non-lpsp.html
- shard-iclb: NOTRUN -> [SKIP][28] ([fdo#110892])
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-iclb8/igt@i915_pm_rpm@dpms-mode-unset-non-lpsp.html
* igt@kms_big_fb@x-tiled-8bpp-rotate-90:
- shard-tglb: NOTRUN -> [SKIP][29] ([fdo#111614]) +1 similar issue
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-tglb6/igt@kms_big_fb@x-tiled-8bpp-rotate-90.html
* igt@kms_big_fb@y-tiled-64bpp-rotate-90:
- shard-iclb: NOTRUN -> [SKIP][30] ([fdo#110725] / [fdo#111614]) +1 similar issue
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-iclb8/igt@kms_big_fb@y-tiled-64bpp-rotate-90.html
* igt@kms_big_fb@y-tiled-max-hw-stride-32bpp-rotate-0-hflip:
- shard-apl: NOTRUN -> [SKIP][31] ([fdo#109271] / [i915#3777]) +2 similar issues
[31]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-apl8/igt@kms_big_fb@y-tiled-max-hw-stride-32bpp-rotate-0-hflip.html
* igt@kms_big_fb@y-tiled-max-hw-stride-64bpp-rotate-180-hflip:
- shard-glk: NOTRUN -> [SKIP][32] ([fdo#109271] / [i915#3777])
[32]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-glk9/igt@kms_big_fb@y-tiled-max-hw-stride-64bpp-rotate-180-hflip.html
- shard-kbl: NOTRUN -> [SKIP][33] ([fdo#109271] / [i915#3777])
[33]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-kbl6/igt@kms_big_fb@y-tiled-max-hw-stride-64bpp-rotate-180-hflip.html
* igt@kms_big_fb@yf-tiled-64bpp-rotate-270:
- shard-tglb: NOTRUN -> [SKIP][34] ([fdo#111615]) +3 similar issues
[34]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-tglb5/igt@kms_big_fb@yf-tiled-64bpp-rotate-270.html
* igt@kms_big_fb@yf-tiled-8bpp-rotate-0:
- shard-iclb: NOTRUN -> [SKIP][35] ([fdo#110723])
[35]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-iclb7/igt@kms_big_fb@yf-tiled-8bpp-rotate-0.html
* igt@kms_big_joiner@basic:
- shard-tglb: NOTRUN -> [SKIP][36] ([i915#2705])
[36]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-tglb5/igt@kms_big_joiner@basic.html
- shard-iclb: NOTRUN -> [SKIP][37] ([i915#2705])
[37]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-iclb7/igt@kms_big_joiner@basic.html
* igt@kms_ccs@pipe-a-bad-pixel-format-y_tiled_ccs:
- shard-tglb: NOTRUN -> [SKIP][38] ([i915#3689]) +7 similar issues
[38]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-tglb6/igt@kms_ccs@pipe-a-bad-pixel-format-y_tiled_ccs.html
* igt@kms_ccs@pipe-a-ccs-on-another-bo-y_tiled_gen12_mc_ccs:
- shard-apl: NOTRUN -> [SKIP][39] ([fdo#109271] / [i915#3886]) +12 similar issues
[39]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-apl1/igt@kms_ccs@pipe-a-ccs-on-another-bo-y_tiled_gen12_mc_ccs.html
* igt@kms_ccs@pipe-a-crc-sprite-planes-basic-y_tiled_gen12_rc_ccs_cc:
- shard-kbl: NOTRUN -> [SKIP][40] ([fdo#109271] / [i915#3886]) +4 similar issues
[40]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-kbl7/igt@kms_ccs@pipe-a-crc-sprite-planes-basic-y_tiled_gen12_rc_ccs_cc.html
* igt@kms_ccs@pipe-b-bad-rotation-90-yf_tiled_ccs:
- shard-tglb: NOTRUN -> [SKIP][41] ([fdo#111615] / [i915#3689]) +2 similar issues
[41]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-tglb2/igt@kms_ccs@pipe-b-bad-rotation-90-yf_tiled_ccs.html
* igt@kms_ccs@pipe-b-crc-primary-rotation-180-y_tiled_gen12_rc_ccs:
- shard-iclb: NOTRUN -> [SKIP][42] ([fdo#109278]) +16 similar issues
[42]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-iclb4/igt@kms_ccs@pipe-b-crc-primary-rotation-180-y_tiled_gen12_rc_ccs.html
* igt@kms_ccs@pipe-b-crc-sprite-planes-basic-y_tiled_gen12_mc_ccs:
- shard-tglb: NOTRUN -> [SKIP][43] ([i915#3689] / [i915#3886]) +2 similar issues
[43]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-tglb3/igt@kms_ccs@pipe-b-crc-sprite-planes-basic-y_tiled_gen12_mc_ccs.html
- shard-iclb: NOTRUN -> [SKIP][44] ([fdo#109278] / [i915#3886]) +3 similar issues
[44]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-iclb8/igt@kms_ccs@pipe-b-crc-sprite-planes-basic-y_tiled_gen12_mc_ccs.html
- shard-glk: NOTRUN -> [SKIP][45] ([fdo#109271] / [i915#3886]) +3 similar issues
[45]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-glk9/igt@kms_ccs@pipe-b-crc-sprite-planes-basic-y_tiled_gen12_mc_ccs.html
* igt@kms_chamelium@hdmi-edid-read:
- shard-tglb: NOTRUN -> [SKIP][46] ([fdo#109284] / [fdo#111827]) +5 similar issues
[46]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-tglb6/igt@kms_chamelium@hdmi-edid-read.html
* igt@kms_chamelium@hdmi-hpd-with-enabled-mode:
- shard-snb: NOTRUN -> [SKIP][47] ([fdo#109271] / [fdo#111827]) +4 similar issues
[47]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-snb2/igt@kms_chamelium@hdmi-hpd-with-enabled-mode.html
* igt@kms_color@pipe-d-degamma:
- shard-iclb: NOTRUN -> [SKIP][48] ([fdo#109278] / [i915#1149]) +1 similar issue
[48]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-iclb4/igt@kms_color@pipe-d-degamma.html
* igt@kms_color_chamelium@pipe-a-ctm-red-to-blue:
- shard-iclb: NOTRUN -> [SKIP][49] ([fdo#109284] / [fdo#111827]) +2 similar issues
[49]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-iclb8/igt@kms_color_chamelium@pipe-a-ctm-red-to-blue.html
* igt@kms_color_chamelium@pipe-b-ctm-0-25:
- shard-kbl: NOTRUN -> [SKIP][50] ([fdo#109271] / [fdo#111827]) +9 similar issues
[50]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-kbl7/igt@kms_color_chamelium@pipe-b-ctm-0-25.html
* igt@kms_color_chamelium@pipe-c-ctm-0-25:
- shard-apl: NOTRUN -> [SKIP][51] ([fdo#109271] / [fdo#111827]) +10 similar issues
[51]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-apl3/igt@kms_color_chamelium@pipe-c-ctm-0-25.html
* igt@kms_color_chamelium@pipe-d-ctm-0-25:
- shard-glk: NOTRUN -> [SKIP][52] ([fdo#109271] / [fdo#111827]) +4 similar issues
[52]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-glk4/igt@kms_color_chamelium@pipe-d-ctm-0-25.html
* igt@kms_color_chamelium@pipe-d-ctm-blue-to-red:
- shard-iclb: NOTRUN -> [SKIP][53] ([fdo#109278] / [fdo#109284] / [fdo#111827])
[53]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-iclb7/igt@kms_color_chamelium@pipe-d-ctm-blue-to-red.html
* igt@kms_cursor_crc@pipe-a-cursor-512x170-onscreen:
- shard-tglb: NOTRUN -> [SKIP][54] ([fdo#109279] / [i915#3359]) +2 similar issues
[54]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-tglb3/igt@kms_cursor_crc@pipe-a-cursor-512x170-onscreen.html
* igt@kms_cursor_crc@pipe-b-cursor-32x32-sliding:
- shard-tglb: NOTRUN -> [SKIP][55] ([i915#3319]) +2 similar issues
[55]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-tglb8/igt@kms_cursor_crc@pipe-b-cursor-32x32-sliding.html
* igt@kms_cursor_crc@pipe-b-cursor-512x170-offscreen:
- shard-iclb: NOTRUN -> [SKIP][56] ([fdo#109278] / [fdo#109279]) +2 similar issues
[56]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-iclb7/igt@kms_cursor_crc@pipe-b-cursor-512x170-offscreen.html
* igt@kms_cursor_crc@pipe-c-cursor-max-size-onscreen:
- shard-tglb: NOTRUN -> [SKIP][57] ([i915#3359]) +1 similar issue
[57]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-tglb8/igt@kms_cursor_crc@pipe-c-cursor-max-size-onscreen.html
* igt@kms_cursor_legacy@2x-cursor-vs-flip-legacy:
- shard-iclb: NOTRUN -> [SKIP][58] ([fdo#109274] / [fdo#109278]) +3 similar issues
[58]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-iclb7/igt@kms_cursor_legacy@2x-cursor-vs-flip-legacy.html
* igt@kms_flip@2x-flip-vs-expired-vblank-interruptible@ab-hdmi-a1-hdmi-a2:
- shard-glk: [PASS][59] -> [FAIL][60] ([i915#79])
[59]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_6295/shard-glk1/igt@kms_flip@2x-flip-vs-expired-vblank-interruptible@ab-hdmi-a1-hdmi-a2.html
[60]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-glk5/igt@kms_flip@2x-flip-vs-expired-vblank-interruptible@ab-hdmi-a1-hdmi-a2.html
* igt@kms_flip@2x-flip-vs-rmfb:
- shard-tglb: NOTRUN -> [SKIP][61] ([fdo#111825]) +26 similar issues
[61]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-tglb5/igt@kms_flip@2x-flip-vs-rmfb.html
* igt@kms_flip@2x-flip-vs-suspend:
- shard-iclb: NOTRUN -> [SKIP][62] ([fdo#109274]) +2 similar issues
[62]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-iclb6/igt@kms_flip@2x-flip-vs-suspend.html
* igt@kms_flip@flip-vs-suspend-interruptible@c-dp1:
- shard-apl: [PASS][63] -> [DMESG-WARN][64] ([i915#180]) +2 similar issues
[63]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_6295/shard-apl7/igt@kms_flip@flip-vs-suspend-interruptible@c-dp1.html
[64]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-apl2/igt@kms_flip@flip-vs-suspend-interruptible@c-dp1.html
* igt@kms_flip@flip-vs-suspend@c-dp1:
- shard-kbl: [PASS][65] -> [DMESG-WARN][66] ([i915#180]) +6 similar issues
[65]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_6295/shard-kbl2/igt@kms_flip@flip-vs-suspend@c-dp1.html
[66]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-kbl7/igt@kms_flip@flip-vs-suspend@c-dp1.html
- shard-apl: NOTRUN -> [DMESG-WARN][67] ([i915#180]) +1 similar issue
[67]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-apl2/igt@kms_flip@flip-vs-suspend@c-dp1.html
* igt@kms_flip_scaled_crc@flip-32bpp-ytile-to-32bpp-ytilegen12rcccs:
- shard-kbl: NOTRUN -> [SKIP][68] ([fdo#109271] / [i915#2672])
[68]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-kbl4/igt@kms_flip_scaled_crc@flip-32bpp-ytile-to-32bpp-ytilegen12rcccs.html
* igt@kms_frontbuffer_tracking@psr-2p-primscrn-pri-shrfb-draw-mmap-wc:
- shard-iclb: NOTRUN -> [SKIP][69] ([fdo#109280]) +12 similar issues
[69]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-iclb7/igt@kms_frontbuffer_tracking@psr-2p-primscrn-pri-shrfb-draw-mmap-wc.html
* igt@kms_pipe_b_c_ivb@disable-pipe-b-enable-pipe-c:
- shard-iclb: NOTRUN -> [SKIP][70] ([fdo#109289]) +1 similar issue
[70]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-iclb7/igt@kms_pipe_b_c_ivb@disable-pipe-b-enable-pipe-c.html
* igt@kms_pipe_crc_basic@compare-crc-sanitycheck-pipe-d:
- shard-glk: NOTRUN -> [SKIP][71] ([fdo#109271] / [i915#533])
[71]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-glk1/igt@kms_pipe_crc_basic@compare-crc-sanitycheck-pipe-d.html
- shard-kbl: NOTRUN -> [SKIP][72] ([fdo#109271] / [i915#533])
[72]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-kbl3/igt@kms_pipe_crc_basic@compare-crc-sanitycheck-pipe-d.html
* igt@kms_plane@plane-panning-bottom-right-suspend@pipe-b-planes:
- shard-kbl: NOTRUN -> [DMESG-WARN][73] ([i915#180])
[73]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-kbl6/igt@kms_plane@plane-panning-bottom-right-suspend@pipe-b-planes.html
* igt@kms_plane_alpha_blend@pipe-a-alpha-transparent-fb:
- shard-apl: NOTRUN -> [FAIL][74] ([i915#265])
[74]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-apl2/igt@kms_plane_alpha_blend@pipe-a-alpha-transparent-fb.html
* igt@kms_plane_alpha_blend@pipe-c-alpha-basic:
- shard-apl: NOTRUN -> [FAIL][75] ([fdo#108145] / [i915#265])
[75]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-apl1/igt@kms_plane_alpha_blend@pipe-c-alpha-basic.html
* igt@kms_plane_lowres@pipe-c-tiling-yf:
- shard-tglb: NOTRUN -> [SKIP][76] ([fdo#111615] / [fdo#112054])
[76]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-tglb1/igt@kms_plane_lowres@pipe-c-tiling-yf.html
* igt@kms_psr2_sf@overlay-primary-update-sf-dmg-area-4:
- shard-apl: NOTRUN -> [SKIP][77] ([fdo#109271] / [i915#658]) +2 similar issues
[77]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-apl4/igt@kms_psr2_sf@overlay-primary-update-sf-dmg-area-4.html
- shard-tglb: NOTRUN -> [SKIP][78] ([i915#2920])
[78]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-tglb8/igt@kms_psr2_sf@overlay-primary-update-sf-dmg-area-4.html
- shard-iclb: NOTRUN -> [SKIP][79] ([i915#658])
[79]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-iclb8/igt@kms_psr2_sf@overlay-primary-update-sf-dmg-area-4.html
- shard-kbl: NOTRUN -> [SKIP][80] ([fdo#109271] / [i915#658])
[80]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-kbl2/igt@kms_psr2_sf@overlay-primary-update-sf-dmg-area-4.html
- shard-glk: NOTRUN -> [SKIP][81] ([fdo#109271] / [i915#658])
[81]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-glk7/igt@kms_psr2_sf@overlay-primary-update-sf-dmg-area-4.html
* igt@kms_psr@psr2_cursor_blt:
- shard-iclb: [PASS][82] -> [SKIP][83] ([fdo#109441]) +1 similar issue
[82]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_6295/shard-iclb2/igt@kms_psr@psr2_cursor_blt.html
[83]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-iclb6/igt@kms_psr@psr2_cursor_blt.html
* igt@kms_psr@psr2_cursor_mmap_gtt:
- shard-tglb: NOTRUN -> [FAIL][84] ([i915#132] / [i915#3467]) +1 similar issue
[84]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-tglb2/igt@kms_psr@psr2_cursor_mmap_gtt.html
* igt@kms_psr@psr2_primary_mmap_cpu:
- shard-iclb: NOTRUN -> [SKIP][85] ([fdo#109441])
[85]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-iclb5/igt@kms_psr@psr2_primary_mmap_cpu.html
* igt@kms_rotation_crc@primary-y-tiled-reflect-x-180:
- shard-glk: NOTRUN -> [SKIP][86] ([fdo#109271]) +63 similar issues
[86]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-glk2/igt@kms_rotation_crc@primary-y-tiled-reflect-x-180.html
* igt@kms_vblank@pipe-d-ts-continuation-idle:
- shard-apl: NOTRUN -> [SKIP][87] ([fdo#109271]) +168 similar issues
[87]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-apl3/igt@kms_vblank@pipe-d-ts-continuation-idle.html
* igt@kms_writeback@writeback-fb-id:
- shard-apl: NOTRUN -> [SKIP][88] ([fdo#109271] / [i915#2437])
[88]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-apl2/igt@kms_writeback@writeback-fb-id.html
* igt@nouveau_crc@pipe-c-source-outp-complete:
- shard-tglb: NOTRUN -> [SKIP][89] ([i915#2530]) +2 similar issues
[89]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-tglb6/igt@nouveau_crc@pipe-c-source-outp-complete.html
* igt@nouveau_crc@pipe-c-source-rg:
- shard-iclb: NOTRUN -> [SKIP][90] ([i915#2530]) +1 similar issue
[90]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-iclb3/igt@nouveau_crc@pipe-c-source-rg.html
* igt@perf@polling-parameterized:
- shard-tglb: [PASS][91] -> [FAIL][92] ([i915#1542])
[91]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_6295/shard-tglb8/igt@perf@polling-parameterized.html
[92]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-tglb1/igt@perf@polling-parameterized.html
* igt@prime_nv_api@i915_nv_import_twice:
- shard-tglb: NOTRUN -> [SKIP][93] ([fdo#109291])
[93]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-tglb2/igt@prime_nv_api@i915_nv_import_twice.html
* igt@sysfs_clients@fair-1:
- shard-glk: NOTRUN -> [SKIP][94] ([fdo#109271] / [i915#2994]) +1 similar issue
[94]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-glk1/igt@sysfs_clients@fair-1.html
- shard-iclb: NOTRUN -> [SKIP][95] ([i915#2994]) +1 similar issue
[95]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-iclb4/igt@sysfs_clients@fair-1.html
- shard-apl: NOTRUN -> [SKIP][96] ([fdo#109271] / [i915#2994]) +2 similar issues
[96]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-apl3/igt@sysfs_clients@fair-1.html
* igt@sysfs_clients@sema-10:
- shard-tglb: NOTRUN -> [SKIP][97] ([i915#2994]) +2 similar issues
[97]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-tglb8/igt@sysfs_clients@sema-10.html
- shard-kbl: NOTRUN -> [SKIP][98] ([fdo#109271] / [i915#2994]) +1 similar issue
[98]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-kbl2/igt@sysfs_clients@sema-10.html
#### Possible fixes ####
* igt@gem_eio@in-flight-contexts-1us:
- shard-snb: [FAIL][99] ([i915#4409]) -> [PASS][100]
[99]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_6295/shard-snb4/igt@gem_eio@in-flight-contexts-1us.html
[100]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-snb4/igt@gem_eio@in-flight-contexts-1us.html
* igt@gem_exec_fair@basic-deadline:
- shard-glk: [FAIL][101] ([i915#2846]) -> [PASS][102]
[101]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_6295/shard-glk5/igt@gem_exec_fair@basic-deadline.html
[102]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-glk1/igt@gem_exec_fair@basic-deadline.html
* igt@gem_exec_fair@basic-none@vecs0:
- shard-apl: [FAIL][103] ([i915#2842]) -> [PASS][104]
[103]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_6295/shard-apl7/igt@gem_exec_fair@basic-none@vecs0.html
[104]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-apl2/igt@gem_exec_fair@basic-none@vecs0.html
* igt@gem_exec_fair@basic-pace-share@rcs0:
- shard-tglb: [FAIL][105] ([i915#2842]) -> [PASS][106]
[105]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_6295/shard-tglb8/igt@gem_exec_fair@basic-pace-share@rcs0.html
[106]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-tglb8/igt@gem_exec_fair@basic-pace-share@rcs0.html
* igt@gem_softpin@noreloc-s3:
- shard-apl: [DMESG-WARN][107] ([i915#180]) -> [PASS][108] +2 similar issues
[107]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_6295/shard-apl4/igt@gem_softpin@noreloc-s3.html
[108]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-apl7/igt@gem_softpin@noreloc-s3.html
* igt@i915_pm_dc@dc6-psr:
- shard-iclb: [FAIL][109] ([i915#454]) -> [PASS][110]
[109]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_6295/shard-iclb2/igt@i915_pm_dc@dc6-psr.html
[110]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-iclb1/igt@i915_pm_dc@dc6-psr.html
* igt@i915_pm_dc@dc9-dpms:
- shard-iclb: [FAIL][111] ([i915#4275]) -> [PASS][112]
[111]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_6295/shard-iclb6/igt@i915_pm_dc@dc9-dpms.html
[112]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-iclb1/igt@i915_pm_dc@dc9-dpms.html
* igt@i915_suspend@debugfs-reader:
- shard-kbl: [DMESG-WARN][113] ([i915#180]) -> [PASS][114]
[113]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_6295/shard-kbl7/igt@i915_suspend@debugfs-reader.html
[114]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-kbl1/igt@i915_suspend@debugfs-reader.html
* igt@kms_big_fb@linear-32bpp-rotate-180:
- shard-glk: [DMESG-WARN][115] ([i915#118]) -> [PASS][116] +1 similar issue
[115]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_6295/shard-glk3/igt@kms_big_fb@linear-32bpp-rotate-180.html
[116]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-glk7/igt@kms_big_fb@linear-32bpp-rotate-180.html
* igt@kms_psr@psr2_cursor_plane_onoff:
- shard-iclb: [SKIP][117] ([fdo#109441]) -> [PASS][118] +2 similar issues
[117]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_6295/shard-iclb1/igt@kms_psr@psr2_cursor_plane_onoff.html
[118]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-iclb2/igt@kms_psr@psr2_cursor_plane_onoff.html
* igt@kms_vblank@pipe-a-ts-continuation-suspend:
- shard-kbl: [DMESG-WARN][119] ([i915#180] / [i915#295]) -> [PASS][120]
[119]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_6295/shard-kbl1/igt@kms_vblank@pipe-a-ts-continuation-suspend.html
[120]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-kbl4/igt@kms_vblank@pipe-a-ts-continuation-suspend.html
#### Warnings ####
* igt@i915_pm_dc@dc3co-vpb-simulation:
- shard-iclb: [SKIP][121] ([i915#588]) -> [SKIP][122] ([i915#658])
[121]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_6295/shard-iclb2/igt@i915_pm_dc@dc3co-vpb-simulation.html
[122]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-iclb7/igt@i915_pm_dc@dc3co-vpb-simulation.html
* igt@kms_psr2_sf@cursor-plane-update-sf:
- shard-iclb: [SKIP][123] ([i915#2920]) -> [SKIP][124] ([i915#658]) +1 similar issue
[123]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_6295/shard-iclb2/igt@kms_psr2_sf@cursor-plane-update-sf.html
[124]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-iclb5/igt@kms_psr2_sf@cursor-plane-update-sf.html
* igt@kms_psr2_su@page_flip:
- shard-iclb: [FAIL][125] ([i915#4148]) -> [SKIP][126] ([fdo#109642] / [fdo#111068] / [i915#658])
[125]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_6295/shard-iclb2/igt@kms_psr2_su@page_flip.html
[126]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-iclb5/igt@kms_psr2_su@page_flip.html
* igt@runner@aborted:
- shard-kbl: ([FAIL][127], [FAIL][128], [FAIL][129], [FAIL][130], [FAIL][131], [FAIL][132], [FAIL][133]) ([i915#1436] / [i915#180] / [i915#1814] / [i915#2426] / [i915#3363] / [i915#4312] / [i915#602]) -> ([FAIL][134], [FAIL][135], [FAIL][136], [FAIL][137], [FAIL][138], [FAIL][139], [FAIL][140], [FAIL][141], [FAIL][142], [FAIL][143]) ([i915#180] / [i915#1814] / [i915#2426] / [i915#3002] / [i915#3363] / [i915#4312])
[127]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_6295/shard-kbl7/igt@runner@aborted.html
[128]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_6295/shard-kbl6/igt@runner@aborted.html
[129]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_6295/shard-kbl6/igt@runner@aborted.html
[130]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_6295/shard-kbl7/igt@runner@aborted.html
[131]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_6295/shard-kbl7/igt@runner@aborted.html
[132]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_6295/shard-kbl1/igt@runner@aborted.html
[133]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_6295/shard-kbl1/igt@runner@aborted.html
[134]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-kbl1/igt@runner@aborted.html
[135]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-kbl1/igt@runner@aborted.html
[136]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-kbl1/igt@runner@aborted.html
[137]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/shard-kbl2/igt@runner@aborted.html
[138]: https://
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6450/index.html
[-- Attachment #2: Type: text/html, Size: 34320 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [igt-dev] [PATCH igt 1/2] igt: Split out I/O helpers
2021-11-30 0:43 ` [igt-dev] " Rob Clark
@ 2021-12-01 8:38 ` Petri Latvala
-1 siblings, 0 replies; 14+ messages in thread
From: Petri Latvala @ 2021-12-01 8:38 UTC (permalink / raw)
To: Rob Clark
Cc: igt-dev, Rob Clark, linux-arm-msm, freedreno, Akhil P Oommen,
Jordan Crouse
On Mon, Nov 29, 2021 at 04:43:23PM -0800, Rob Clark wrote:
> From: Rob Clark <robdclark@chromium.org>
>
> Split the readN()/writeN() helpers out into an igt_io module, so they
> can be re-used by tests.
>
> Signed-off-by: Rob Clark <robdclark@chromium.org>
> ---
> lib/igt_io.c | 96 +++++++++++++++++++++++++++++++++++++++++++++++++
> lib/igt_io.h | 33 +++++++++++++++++
> lib/igt_sysfs.c | 45 +++--------------------
> lib/meson.build | 1 +
> 4 files changed, 135 insertions(+), 40 deletions(-)
> create mode 100644 lib/igt_io.c
> create mode 100644 lib/igt_io.h
>
> diff --git a/lib/igt_io.c b/lib/igt_io.c
> new file mode 100644
> index 00000000..ad54cbe5
> --- /dev/null
> +++ b/lib/igt_io.c
> @@ -0,0 +1,96 @@
> +/*
> + * Copyright © 2016 Intel Corporation
> + *
> + * Permission is hereby granted, free of charge, to any person obtaining a
> + * copy of this software and associated documentation files (the "Software"),
> + * to deal in the Software without restriction, including without limitation
> + * the rights to use, copy, modify, merge, publish, distribute, sublicense,
> + * and/or sell copies of the Software, and to permit persons to whom the
> + * Software is furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice (including the next
> + * paragraph) shall be included in all copies or substantial portions of the
> + * Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
> + * IN THE SOFTWARE.
> + *
> + */
> +
> +#include <errno.h>
> +#include <stdlib.h>
> +#include <unistd.h>
> +
> +#include "igt_io.h"
> +
> +/**
> + * SECTION:igt_io
> + * @short_description: Helpers for file I/O
> + * @title: io
> + * @include: igt_io.h
> + *
> + * This library provides helpers for file I/O
> + */
> +
This new section needs to be explicitly included in the docs. Squash this in:
diff --git a/docs/reference/igt-gpu-tools/igt-gpu-tools-docs.xml b/docs/reference/igt-gpu-tools/igt-gpu-tools-docs.xml
index 189597c6..0dc5a0b7 100644
--- a/docs/reference/igt-gpu-tools/igt-gpu-tools-docs.xml
+++ b/docs/reference/igt-gpu-tools/igt-gpu-tools-docs.xml
@@ -30,6 +30,7 @@
<xi:include href="xml/igt_fb.xml"/>
<xi:include href="xml/igt_frame.xml"/>
<xi:include href="xml/igt_gt.xml"/>
+ <xi:include href="xml/igt_io.xml"/>
<xi:include href="xml/igt_kmod.xml"/>
<xi:include href="xml/igt_kms.xml"/>
<xi:include href="xml/igt_list.xml"/>
--
Petri Latvala
^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [igt-dev] [PATCH igt 1/2] igt: Split out I/O helpers
@ 2021-12-01 8:38 ` Petri Latvala
0 siblings, 0 replies; 14+ messages in thread
From: Petri Latvala @ 2021-12-01 8:38 UTC (permalink / raw)
To: Rob Clark
Cc: Rob Clark, linux-arm-msm, Akhil P Oommen, Jordan Crouse, igt-dev,
freedreno
On Mon, Nov 29, 2021 at 04:43:23PM -0800, Rob Clark wrote:
> From: Rob Clark <robdclark@chromium.org>
>
> Split the readN()/writeN() helpers out into an igt_io module, so they
> can be re-used by tests.
>
> Signed-off-by: Rob Clark <robdclark@chromium.org>
> ---
> lib/igt_io.c | 96 +++++++++++++++++++++++++++++++++++++++++++++++++
> lib/igt_io.h | 33 +++++++++++++++++
> lib/igt_sysfs.c | 45 +++--------------------
> lib/meson.build | 1 +
> 4 files changed, 135 insertions(+), 40 deletions(-)
> create mode 100644 lib/igt_io.c
> create mode 100644 lib/igt_io.h
>
> diff --git a/lib/igt_io.c b/lib/igt_io.c
> new file mode 100644
> index 00000000..ad54cbe5
> --- /dev/null
> +++ b/lib/igt_io.c
> @@ -0,0 +1,96 @@
> +/*
> + * Copyright © 2016 Intel Corporation
> + *
> + * Permission is hereby granted, free of charge, to any person obtaining a
> + * copy of this software and associated documentation files (the "Software"),
> + * to deal in the Software without restriction, including without limitation
> + * the rights to use, copy, modify, merge, publish, distribute, sublicense,
> + * and/or sell copies of the Software, and to permit persons to whom the
> + * Software is furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice (including the next
> + * paragraph) shall be included in all copies or substantial portions of the
> + * Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
> + * IN THE SOFTWARE.
> + *
> + */
> +
> +#include <errno.h>
> +#include <stdlib.h>
> +#include <unistd.h>
> +
> +#include "igt_io.h"
> +
> +/**
> + * SECTION:igt_io
> + * @short_description: Helpers for file I/O
> + * @title: io
> + * @include: igt_io.h
> + *
> + * This library provides helpers for file I/O
> + */
> +
This new section needs to be explicitly included in the docs. Squash this in:
diff --git a/docs/reference/igt-gpu-tools/igt-gpu-tools-docs.xml b/docs/reference/igt-gpu-tools/igt-gpu-tools-docs.xml
index 189597c6..0dc5a0b7 100644
--- a/docs/reference/igt-gpu-tools/igt-gpu-tools-docs.xml
+++ b/docs/reference/igt-gpu-tools/igt-gpu-tools-docs.xml
@@ -30,6 +30,7 @@
<xi:include href="xml/igt_fb.xml"/>
<xi:include href="xml/igt_frame.xml"/>
<xi:include href="xml/igt_gt.xml"/>
+ <xi:include href="xml/igt_io.xml"/>
<xi:include href="xml/igt_kmod.xml"/>
<xi:include href="xml/igt_kms.xml"/>
<xi:include href="xml/igt_list.xml"/>
--
Petri Latvala
^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [igt-dev] [PATCH igt 1/2] igt: Split out I/O helpers
2021-12-01 8:38 ` Petri Latvala
@ 2021-12-01 21:12 ` Rob Clark
-1 siblings, 0 replies; 14+ messages in thread
From: Rob Clark @ 2021-12-01 21:12 UTC (permalink / raw)
To: Petri Latvala
Cc: igt-dev, Rob Clark, linux-arm-msm, freedreno, Akhil P Oommen,
Jordan Crouse
On Wed, Dec 1, 2021 at 12:39 AM Petri Latvala <petri.latvala@intel.com> wrote:
>
> On Mon, Nov 29, 2021 at 04:43:23PM -0800, Rob Clark wrote:
> > From: Rob Clark <robdclark@chromium.org>
> >
> > Split the readN()/writeN() helpers out into an igt_io module, so they
> > can be re-used by tests.
> >
> > Signed-off-by: Rob Clark <robdclark@chromium.org>
> > ---
> > lib/igt_io.c | 96 +++++++++++++++++++++++++++++++++++++++++++++++++
> > lib/igt_io.h | 33 +++++++++++++++++
> > lib/igt_sysfs.c | 45 +++--------------------
> > lib/meson.build | 1 +
> > 4 files changed, 135 insertions(+), 40 deletions(-)
> > create mode 100644 lib/igt_io.c
> > create mode 100644 lib/igt_io.h
> >
> > diff --git a/lib/igt_io.c b/lib/igt_io.c
> > new file mode 100644
> > index 00000000..ad54cbe5
> > --- /dev/null
> > +++ b/lib/igt_io.c
> > @@ -0,0 +1,96 @@
> > +/*
> > + * Copyright © 2016 Intel Corporation
> > + *
> > + * Permission is hereby granted, free of charge, to any person obtaining a
> > + * copy of this software and associated documentation files (the "Software"),
> > + * to deal in the Software without restriction, including without limitation
> > + * the rights to use, copy, modify, merge, publish, distribute, sublicense,
> > + * and/or sell copies of the Software, and to permit persons to whom the
> > + * Software is furnished to do so, subject to the following conditions:
> > + *
> > + * The above copyright notice and this permission notice (including the next
> > + * paragraph) shall be included in all copies or substantial portions of the
> > + * Software.
> > + *
> > + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> > + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> > + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
> > + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> > + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> > + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
> > + * IN THE SOFTWARE.
> > + *
> > + */
> > +
> > +#include <errno.h>
> > +#include <stdlib.h>
> > +#include <unistd.h>
> > +
> > +#include "igt_io.h"
> > +
> > +/**
> > + * SECTION:igt_io
> > + * @short_description: Helpers for file I/O
> > + * @title: io
> > + * @include: igt_io.h
> > + *
> > + * This library provides helpers for file I/O
> > + */
> > +
>
> This new section needs to be explicitly included in the docs. Squash this in:
>
> diff --git a/docs/reference/igt-gpu-tools/igt-gpu-tools-docs.xml b/docs/reference/igt-gpu-tools/igt-gpu-tools-docs.xml
> index 189597c6..0dc5a0b7 100644
> --- a/docs/reference/igt-gpu-tools/igt-gpu-tools-docs.xml
> +++ b/docs/reference/igt-gpu-tools/igt-gpu-tools-docs.xml
> @@ -30,6 +30,7 @@
> <xi:include href="xml/igt_fb.xml"/>
> <xi:include href="xml/igt_frame.xml"/>
> <xi:include href="xml/igt_gt.xml"/>
> + <xi:include href="xml/igt_io.xml"/>
> <xi:include href="xml/igt_kmod.xml"/>
> <xi:include href="xml/igt_kms.xml"/>
> <xi:include href="xml/igt_list.xml"/>
>
>
Oh, right.. I've squashed that in locally.. lmk if you want me to resend
BR,
-R
>
> --
> Petri Latvala
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [igt-dev] [PATCH igt 1/2] igt: Split out I/O helpers
@ 2021-12-01 21:12 ` Rob Clark
0 siblings, 0 replies; 14+ messages in thread
From: Rob Clark @ 2021-12-01 21:12 UTC (permalink / raw)
To: Petri Latvala
Cc: Rob Clark, linux-arm-msm, Akhil P Oommen, Jordan Crouse, igt-dev,
freedreno
On Wed, Dec 1, 2021 at 12:39 AM Petri Latvala <petri.latvala@intel.com> wrote:
>
> On Mon, Nov 29, 2021 at 04:43:23PM -0800, Rob Clark wrote:
> > From: Rob Clark <robdclark@chromium.org>
> >
> > Split the readN()/writeN() helpers out into an igt_io module, so they
> > can be re-used by tests.
> >
> > Signed-off-by: Rob Clark <robdclark@chromium.org>
> > ---
> > lib/igt_io.c | 96 +++++++++++++++++++++++++++++++++++++++++++++++++
> > lib/igt_io.h | 33 +++++++++++++++++
> > lib/igt_sysfs.c | 45 +++--------------------
> > lib/meson.build | 1 +
> > 4 files changed, 135 insertions(+), 40 deletions(-)
> > create mode 100644 lib/igt_io.c
> > create mode 100644 lib/igt_io.h
> >
> > diff --git a/lib/igt_io.c b/lib/igt_io.c
> > new file mode 100644
> > index 00000000..ad54cbe5
> > --- /dev/null
> > +++ b/lib/igt_io.c
> > @@ -0,0 +1,96 @@
> > +/*
> > + * Copyright © 2016 Intel Corporation
> > + *
> > + * Permission is hereby granted, free of charge, to any person obtaining a
> > + * copy of this software and associated documentation files (the "Software"),
> > + * to deal in the Software without restriction, including without limitation
> > + * the rights to use, copy, modify, merge, publish, distribute, sublicense,
> > + * and/or sell copies of the Software, and to permit persons to whom the
> > + * Software is furnished to do so, subject to the following conditions:
> > + *
> > + * The above copyright notice and this permission notice (including the next
> > + * paragraph) shall be included in all copies or substantial portions of the
> > + * Software.
> > + *
> > + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> > + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> > + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
> > + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> > + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> > + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
> > + * IN THE SOFTWARE.
> > + *
> > + */
> > +
> > +#include <errno.h>
> > +#include <stdlib.h>
> > +#include <unistd.h>
> > +
> > +#include "igt_io.h"
> > +
> > +/**
> > + * SECTION:igt_io
> > + * @short_description: Helpers for file I/O
> > + * @title: io
> > + * @include: igt_io.h
> > + *
> > + * This library provides helpers for file I/O
> > + */
> > +
>
> This new section needs to be explicitly included in the docs. Squash this in:
>
> diff --git a/docs/reference/igt-gpu-tools/igt-gpu-tools-docs.xml b/docs/reference/igt-gpu-tools/igt-gpu-tools-docs.xml
> index 189597c6..0dc5a0b7 100644
> --- a/docs/reference/igt-gpu-tools/igt-gpu-tools-docs.xml
> +++ b/docs/reference/igt-gpu-tools/igt-gpu-tools-docs.xml
> @@ -30,6 +30,7 @@
> <xi:include href="xml/igt_fb.xml"/>
> <xi:include href="xml/igt_frame.xml"/>
> <xi:include href="xml/igt_gt.xml"/>
> + <xi:include href="xml/igt_io.xml"/>
> <xi:include href="xml/igt_kmod.xml"/>
> <xi:include href="xml/igt_kms.xml"/>
> <xi:include href="xml/igt_list.xml"/>
>
>
Oh, right.. I've squashed that in locally.. lmk if you want me to resend
BR,
-R
>
> --
> Petri Latvala
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [igt-dev] [PATCH igt 1/2] igt: Split out I/O helpers
2021-11-30 0:43 ` [igt-dev] " Rob Clark
@ 2021-12-07 11:40 ` Petri Latvala
-1 siblings, 0 replies; 14+ messages in thread
From: Petri Latvala @ 2021-12-07 11:40 UTC (permalink / raw)
To: Rob Clark
Cc: igt-dev, Rob Clark, linux-arm-msm, freedreno, Akhil P Oommen,
Jordan Crouse
On Mon, Nov 29, 2021 at 04:43:23PM -0800, Rob Clark wrote:
> From: Rob Clark <robdclark@chromium.org>
>
> Split the readN()/writeN() helpers out into an igt_io module, so they
> can be re-used by tests.
>
> Signed-off-by: Rob Clark <robdclark@chromium.org>
> ---
> lib/igt_io.c | 96 +++++++++++++++++++++++++++++++++++++++++++++++++
> lib/igt_io.h | 33 +++++++++++++++++
> lib/igt_sysfs.c | 45 +++--------------------
> lib/meson.build | 1 +
> 4 files changed, 135 insertions(+), 40 deletions(-)
> create mode 100644 lib/igt_io.c
> create mode 100644 lib/igt_io.h
>
> diff --git a/lib/igt_io.c b/lib/igt_io.c
> new file mode 100644
> index 00000000..ad54cbe5
> --- /dev/null
> +++ b/lib/igt_io.c
> @@ -0,0 +1,96 @@
> +/*
> + * Copyright © 2016 Intel Corporation
> + *
> + * Permission is hereby granted, free of charge, to any person obtaining a
> + * copy of this software and associated documentation files (the "Software"),
> + * to deal in the Software without restriction, including without limitation
> + * the rights to use, copy, modify, merge, publish, distribute, sublicense,
> + * and/or sell copies of the Software, and to permit persons to whom the
> + * Software is furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice (including the next
> + * paragraph) shall be included in all copies or substantial portions of the
> + * Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
> + * IN THE SOFTWARE.
> + *
> + */
> +
> +#include <errno.h>
> +#include <stdlib.h>
> +#include <unistd.h>
> +
> +#include "igt_io.h"
> +
> +/**
> + * SECTION:igt_io
> + * @short_description: Helpers for file I/O
> + * @title: io
> + * @include: igt_io.h
> + *
> + * This library provides helpers for file I/O
> + */
> +
> +/**
> + * igt_readn:
> + * @fd: the file descriptor
> + * @buf: buffer where the contents will be stored, allocated by the caller
> + * @size: size of the buffer
> + *
> + * Read from fd into provided buffer until the buffer is full or EOF
> + *
> + * Returns:
> + * -errorno on failure or bytes read on success
> + */
> +ssize_t igt_readn(int fd, char *buf, size_t len)
> +{
> + ssize_t ret;
> + size_t total = 0;
> +
> + do {
> + ret = read(fd, buf + total, len - total);
> + if (ret < 0)
> + ret = -errno;
> + if (ret == -EINTR || ret == -EAGAIN)
> + continue;
> + if (ret <= 0)
> + break;
> + total += ret;
> + } while (total != len);
> + return total ?: ret;
> +}
> +
> +/**
> + * igt_writen:
> + * @fd: the file descriptor
> + * @buf: the block with the contents to write
> + * @len: the length to write
> + *
> + * This writes @len bytes from @data to the sysfs file.
> + *
> + * Returns:
> + * -errorno on failure or bytes read on success
bytes written.
For this and the read function, s/errorno/errno/
With those,
Reviewed-by: Petri Latvala <petri.latvala@intel.com>
> + */
> +ssize_t igt_writen(int fd, const char *buf, size_t len)
> +{
> + ssize_t ret;
> + size_t total = 0;
> +
> + do {
> + ret = write(fd, buf + total, len - total);
> + if (ret < 0)
> + ret = -errno;
> + if (ret == -EINTR || ret == -EAGAIN)
> + continue;
> + if (ret <= 0)
> + break;
> + total += ret;
> + } while (total != len);
> + return total ?: ret;
> +}
> diff --git a/lib/igt_io.h b/lib/igt_io.h
> new file mode 100644
> index 00000000..eb9ffee1
> --- /dev/null
> +++ b/lib/igt_io.h
> @@ -0,0 +1,33 @@
> +/*
> + * Copyright © 2016 Intel Corporation
> + *
> + * Permission is hereby granted, free of charge, to any person obtaining a
> + * copy of this software and associated documentation files (the "Software"),
> + * to deal in the Software without restriction, including without limitation
> + * the rights to use, copy, modify, merge, publish, distribute, sublicense,
> + * and/or sell copies of the Software, and to permit persons to whom the
> + * Software is furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice (including the next
> + * paragraph) shall be included in all copies or substantial portions of the
> + * Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
> + * IN THE SOFTWARE.
> + *
> + */
> +
> +#ifndef __IGT_IO_H__
> +#define __IGT_IO_H__
> +
> +#include <stdio.h>
> +
> +ssize_t igt_readn(int fd, char *buf, size_t len);
> +ssize_t igt_writen(int fd, const char *buf, size_t len);
> +
> +#endif /* __IGT_IO_H__ */
> diff --git a/lib/igt_sysfs.c b/lib/igt_sysfs.c
> index ee75e3ef..f8ef23e2 100644
> --- a/lib/igt_sysfs.c
> +++ b/lib/igt_sysfs.c
> @@ -42,6 +42,7 @@
> #include "igt_core.h"
> #include "igt_sysfs.h"
> #include "igt_device.h"
> +#include "igt_io.h"
>
> /**
> * SECTION:igt_sysfs
> @@ -53,42 +54,6 @@
> * provides basic support for like igt_sysfs_open().
> */
>
> -static ssize_t readN(int fd, char *buf, size_t len)
> -{
> - ssize_t ret;
> - size_t total = 0;
> -
> - do {
> - ret = read(fd, buf + total, len - total);
> - if (ret < 0)
> - ret = -errno;
> - if (ret == -EINTR || ret == -EAGAIN)
> - continue;
> - if (ret <= 0)
> - break;
> - total += ret;
> - } while (total != len);
> - return total ?: ret;
> -}
> -
> -static ssize_t writeN(int fd, const char *buf, size_t len)
> -{
> - ssize_t ret;
> - size_t total = 0;
> -
> - do {
> - ret = write(fd, buf + total, len - total);
> - if (ret < 0)
> - ret = -errno;
> - if (ret == -EINTR || ret == -EAGAIN)
> - continue;
> - if (ret <= 0)
> - break;
> - total += ret;
> - } while (total != len);
> - return total ?: ret;
> -}
> -
> /**
> * igt_sysfs_path:
> * @device: fd of the device
> @@ -159,7 +124,7 @@ int igt_sysfs_write(int dir, const char *attr, const void *data, int len)
> if (igt_debug_on(fd < 0))
> return -errno;
>
> - len = writeN(fd, data, len);
> + len = igt_writen(fd, data, len);
> close(fd);
>
> return len;
> @@ -185,7 +150,7 @@ int igt_sysfs_read(int dir, const char *attr, void *data, int len)
> if (igt_debug_on(fd < 0))
> return -errno;
>
> - len = readN(fd, data, len);
> + len = igt_readn(fd, data, len);
> close(fd);
>
> return len;
> @@ -237,7 +202,7 @@ char *igt_sysfs_get(int dir, const char *attr)
> if (igt_debug_on(!buf))
> goto out;
>
> - while ((ret = readN(fd, buf + offset, rem)) == rem) {
> + while ((ret = igt_readn(fd, buf + offset, rem)) == rem) {
> char *newbuf;
>
> newbuf = realloc(buf, 2*len);
> @@ -330,7 +295,7 @@ int igt_sysfs_vprintf(int dir, const char *attr, const char *fmt, va_list ap)
> }
> }
>
> - ret = writeN(fd, buf, ret);
> + ret = igt_writen(fd, buf, ret);
>
> close(fd);
> if (buf != stack)
> diff --git a/lib/meson.build b/lib/meson.build
> index 297b0ad2..b9568a71 100644
> --- a/lib/meson.build
> +++ b/lib/meson.build
> @@ -19,6 +19,7 @@ lib_sources = [
> 'igt_aux.c',
> 'igt_gt.c',
> 'igt_halffloat.c',
> + 'igt_io.c',
> 'igt_matrix.c',
> 'igt_params.c',
> 'igt_perf.c',
> --
> 2.33.1
>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [igt-dev] [PATCH igt 1/2] igt: Split out I/O helpers
@ 2021-12-07 11:40 ` Petri Latvala
0 siblings, 0 replies; 14+ messages in thread
From: Petri Latvala @ 2021-12-07 11:40 UTC (permalink / raw)
To: Rob Clark
Cc: Rob Clark, linux-arm-msm, Akhil P Oommen, Jordan Crouse, igt-dev,
freedreno
On Mon, Nov 29, 2021 at 04:43:23PM -0800, Rob Clark wrote:
> From: Rob Clark <robdclark@chromium.org>
>
> Split the readN()/writeN() helpers out into an igt_io module, so they
> can be re-used by tests.
>
> Signed-off-by: Rob Clark <robdclark@chromium.org>
> ---
> lib/igt_io.c | 96 +++++++++++++++++++++++++++++++++++++++++++++++++
> lib/igt_io.h | 33 +++++++++++++++++
> lib/igt_sysfs.c | 45 +++--------------------
> lib/meson.build | 1 +
> 4 files changed, 135 insertions(+), 40 deletions(-)
> create mode 100644 lib/igt_io.c
> create mode 100644 lib/igt_io.h
>
> diff --git a/lib/igt_io.c b/lib/igt_io.c
> new file mode 100644
> index 00000000..ad54cbe5
> --- /dev/null
> +++ b/lib/igt_io.c
> @@ -0,0 +1,96 @@
> +/*
> + * Copyright © 2016 Intel Corporation
> + *
> + * Permission is hereby granted, free of charge, to any person obtaining a
> + * copy of this software and associated documentation files (the "Software"),
> + * to deal in the Software without restriction, including without limitation
> + * the rights to use, copy, modify, merge, publish, distribute, sublicense,
> + * and/or sell copies of the Software, and to permit persons to whom the
> + * Software is furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice (including the next
> + * paragraph) shall be included in all copies or substantial portions of the
> + * Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
> + * IN THE SOFTWARE.
> + *
> + */
> +
> +#include <errno.h>
> +#include <stdlib.h>
> +#include <unistd.h>
> +
> +#include "igt_io.h"
> +
> +/**
> + * SECTION:igt_io
> + * @short_description: Helpers for file I/O
> + * @title: io
> + * @include: igt_io.h
> + *
> + * This library provides helpers for file I/O
> + */
> +
> +/**
> + * igt_readn:
> + * @fd: the file descriptor
> + * @buf: buffer where the contents will be stored, allocated by the caller
> + * @size: size of the buffer
> + *
> + * Read from fd into provided buffer until the buffer is full or EOF
> + *
> + * Returns:
> + * -errorno on failure or bytes read on success
> + */
> +ssize_t igt_readn(int fd, char *buf, size_t len)
> +{
> + ssize_t ret;
> + size_t total = 0;
> +
> + do {
> + ret = read(fd, buf + total, len - total);
> + if (ret < 0)
> + ret = -errno;
> + if (ret == -EINTR || ret == -EAGAIN)
> + continue;
> + if (ret <= 0)
> + break;
> + total += ret;
> + } while (total != len);
> + return total ?: ret;
> +}
> +
> +/**
> + * igt_writen:
> + * @fd: the file descriptor
> + * @buf: the block with the contents to write
> + * @len: the length to write
> + *
> + * This writes @len bytes from @data to the sysfs file.
> + *
> + * Returns:
> + * -errorno on failure or bytes read on success
bytes written.
For this and the read function, s/errorno/errno/
With those,
Reviewed-by: Petri Latvala <petri.latvala@intel.com>
> + */
> +ssize_t igt_writen(int fd, const char *buf, size_t len)
> +{
> + ssize_t ret;
> + size_t total = 0;
> +
> + do {
> + ret = write(fd, buf + total, len - total);
> + if (ret < 0)
> + ret = -errno;
> + if (ret == -EINTR || ret == -EAGAIN)
> + continue;
> + if (ret <= 0)
> + break;
> + total += ret;
> + } while (total != len);
> + return total ?: ret;
> +}
> diff --git a/lib/igt_io.h b/lib/igt_io.h
> new file mode 100644
> index 00000000..eb9ffee1
> --- /dev/null
> +++ b/lib/igt_io.h
> @@ -0,0 +1,33 @@
> +/*
> + * Copyright © 2016 Intel Corporation
> + *
> + * Permission is hereby granted, free of charge, to any person obtaining a
> + * copy of this software and associated documentation files (the "Software"),
> + * to deal in the Software without restriction, including without limitation
> + * the rights to use, copy, modify, merge, publish, distribute, sublicense,
> + * and/or sell copies of the Software, and to permit persons to whom the
> + * Software is furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice (including the next
> + * paragraph) shall be included in all copies or substantial portions of the
> + * Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
> + * IN THE SOFTWARE.
> + *
> + */
> +
> +#ifndef __IGT_IO_H__
> +#define __IGT_IO_H__
> +
> +#include <stdio.h>
> +
> +ssize_t igt_readn(int fd, char *buf, size_t len);
> +ssize_t igt_writen(int fd, const char *buf, size_t len);
> +
> +#endif /* __IGT_IO_H__ */
> diff --git a/lib/igt_sysfs.c b/lib/igt_sysfs.c
> index ee75e3ef..f8ef23e2 100644
> --- a/lib/igt_sysfs.c
> +++ b/lib/igt_sysfs.c
> @@ -42,6 +42,7 @@
> #include "igt_core.h"
> #include "igt_sysfs.h"
> #include "igt_device.h"
> +#include "igt_io.h"
>
> /**
> * SECTION:igt_sysfs
> @@ -53,42 +54,6 @@
> * provides basic support for like igt_sysfs_open().
> */
>
> -static ssize_t readN(int fd, char *buf, size_t len)
> -{
> - ssize_t ret;
> - size_t total = 0;
> -
> - do {
> - ret = read(fd, buf + total, len - total);
> - if (ret < 0)
> - ret = -errno;
> - if (ret == -EINTR || ret == -EAGAIN)
> - continue;
> - if (ret <= 0)
> - break;
> - total += ret;
> - } while (total != len);
> - return total ?: ret;
> -}
> -
> -static ssize_t writeN(int fd, const char *buf, size_t len)
> -{
> - ssize_t ret;
> - size_t total = 0;
> -
> - do {
> - ret = write(fd, buf + total, len - total);
> - if (ret < 0)
> - ret = -errno;
> - if (ret == -EINTR || ret == -EAGAIN)
> - continue;
> - if (ret <= 0)
> - break;
> - total += ret;
> - } while (total != len);
> - return total ?: ret;
> -}
> -
> /**
> * igt_sysfs_path:
> * @device: fd of the device
> @@ -159,7 +124,7 @@ int igt_sysfs_write(int dir, const char *attr, const void *data, int len)
> if (igt_debug_on(fd < 0))
> return -errno;
>
> - len = writeN(fd, data, len);
> + len = igt_writen(fd, data, len);
> close(fd);
>
> return len;
> @@ -185,7 +150,7 @@ int igt_sysfs_read(int dir, const char *attr, void *data, int len)
> if (igt_debug_on(fd < 0))
> return -errno;
>
> - len = readN(fd, data, len);
> + len = igt_readn(fd, data, len);
> close(fd);
>
> return len;
> @@ -237,7 +202,7 @@ char *igt_sysfs_get(int dir, const char *attr)
> if (igt_debug_on(!buf))
> goto out;
>
> - while ((ret = readN(fd, buf + offset, rem)) == rem) {
> + while ((ret = igt_readn(fd, buf + offset, rem)) == rem) {
> char *newbuf;
>
> newbuf = realloc(buf, 2*len);
> @@ -330,7 +295,7 @@ int igt_sysfs_vprintf(int dir, const char *attr, const char *fmt, va_list ap)
> }
> }
>
> - ret = writeN(fd, buf, ret);
> + ret = igt_writen(fd, buf, ret);
>
> close(fd);
> if (buf != stack)
> diff --git a/lib/meson.build b/lib/meson.build
> index 297b0ad2..b9568a71 100644
> --- a/lib/meson.build
> +++ b/lib/meson.build
> @@ -19,6 +19,7 @@ lib_sources = [
> 'igt_aux.c',
> 'igt_gt.c',
> 'igt_halffloat.c',
> + 'igt_io.c',
> 'igt_matrix.c',
> 'igt_params.c',
> 'igt_perf.c',
> --
> 2.33.1
>
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2021-12-07 11:41 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-30 0:43 [PATCH igt 0/2] msm+lib: Add test for buffer mapping permissions Rob Clark
2021-11-30 0:43 ` [igt-dev] " Rob Clark
2021-11-30 0:43 ` [PATCH igt 1/2] igt: Split out I/O helpers Rob Clark
2021-11-30 0:43 ` [igt-dev] " Rob Clark
2021-12-01 8:38 ` Petri Latvala
2021-12-01 8:38 ` Petri Latvala
2021-12-01 21:12 ` Rob Clark
2021-12-01 21:12 ` Rob Clark
2021-12-07 11:40 ` Petri Latvala
2021-12-07 11:40 ` Petri Latvala
2021-11-30 0:43 ` [PATCH igt 2/2] msm: Add test for kernel buffer permissions Rob Clark
2021-11-30 0:43 ` [igt-dev] " Rob Clark
2021-11-30 1:35 ` [igt-dev] ✓ Fi.CI.BAT: success for msm+lib: Add test for buffer mapping permissions Patchwork
2021-11-30 5:54 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.