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

Naveen N. Rao naveen.n.rao at linux.vnet.ibm.com
Fri May 25 04:29:19 AEST 2018


Michael Ellerman wrote:
> "Naveen N. Rao" <naveen.n.rao at linux.vnet.ibm.com> writes:
>> diff --git a/tools/testing/selftests/powerpc/security/rfi_flush.c b/tools/testing/selftests/powerpc/security/rfi_flush.c
>> new file mode 100644
>> index 000000000000..a20fe8eca161
>> --- /dev/null
>> +++ b/tools/testing/selftests/powerpc/security/rfi_flush.c
>> @@ -0,0 +1,132 @@
> ...
>> +
>> +int rfi_flush_test(void)
>> +{
>> +	char *p;
>> +	int repetitions = 10;
>> +	int fd, passes = 0, iter, rc = 0;
>> +	struct perf_event_read v;
>> +	uint64_t l1d_misses_total = 0;
>> +	unsigned long iterations = 100000, zero_size = 24*1024;
>> +	int rfi_flush_org, rfi_flush;
>> +
>> +	SKIP_IF(geteuid() != 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;
>> +	}
> 
> This leads to a hard error on old kernels, which I don't want (breaks my CI).

Hmm... didn't realize new tests would be run on older kernels. Are those 
older stable/distro releases, or actually just earlier kernel versions?

> 
> So I changed it to:
> 
> 	if (read_debugfs_file("powerpc/rfi_flush", &rfi_flush_org)) {
> 		perror("Unable to read powerpc/rfi_flush debugfs file");
> 		SKIP_IF(1);
> 	}

Sure, thanks!
- Naveen




More information about the Linuxppc-dev mailing list