Thread (8 messages) 8 messages, 3 authors, 2018-10-22

Re: [PATCH v2 2/2] selftests/powerpc: Add test to verify rfi flush across a system call

flat view

From: Naveen N. Rao <hidden>
Date: 2018-05-25 11:31:24

Michael Ellerman wrote:
"Naveen N. Rao" [off-list ref] writes:
quoted
Michael Ellerman wrote:
quoted
"Naveen N. Rao" [off-list ref] writes:
quoted
diff --git a/tools/testing/selftests/powerpc/security/rfi_flush.c b/to=
ols/testing/selftests/powerpc/security/rfi_flush.c
quoted
quoted
quoted
new file mode 100644
index 000000000000..a20fe8eca161
--- /dev/null
+++ b/tools/testing/selftests/powerpc/security/rfi_flush.c
@@ -0,0 +1,132 @@
...
quoted
+
+int rfi_flush_test(void)
+{
+	char *p;
+	int repetitions =3D 10;
+	int fd, passes =3D 0, iter, rc =3D 0;
+	struct perf_event_read v;
+	uint64_t l1d_misses_total =3D 0;
+	unsigned long iterations =3D 100000, zero_size =3D 24*1024;
+	int rfi_flush_org, rfi_flush;
+
+	SKIP_IF(geteuid() !=3D 0);
+
+	if (read_debugfs_file("powerpc/rfi_flush", &rfi_flush_org)) {
+		perror("error reading powerpc/rfi_flush debugfs file");
+	        printf("unable to determine current rfi_flush setting");
+		return 1;
+	}
=20
This leads to a hard error on old kernels, which I don't want (breaks m=
y CI).
quoted
Hmm... didn't realize new tests would be run on older kernels. Are those=
=20
quoted
older stable/distro releases, or actually just earlier kernel versions?
=20
All of the above :)
=20
Obviously keeping all the tests working across all kernel versions ever
is impossible, but when it's relatively easy like in this case, it's
nice to do.
=20
So that was mostly just an FYI, I don't expect test writers to get their
tests running across all kernel versions.
Good to know, thanks!
- Naveen

=
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help