lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7c3b13e1-425d-4471-91fd-7156c4758719@ghiti.fr>
Date: Sun, 30 Mar 2025 17:36:49 +0200
From: Alexandre Ghiti <alex@...ti.fr>
To: Ignacio Encinas Rubio <ignacio@...cinas.com>,
 Paul Walmsley <paul.walmsley@...ive.com>, Palmer Dabbelt <palmer@...belt.com>
Cc: linux-kselftest@...r.kernel.org, linux-riscv@...ts.infradead.org,
 linux-kernel@...r.kernel.org, skhan@...uxfoundation.org,
 linux-kernel-mentees@...ts.linux.dev
Subject: Re: [PATCH v2] selftests: riscv: fix v_exec_initval_nolibc.c

Hi ignacio,

On 30/03/2025 13:12, Ignacio Encinas Rubio wrote:
> Gentle ping :)


No worries, it's either being merged in 6.15-rc1 or rc2!

Thanks,

Alex


>
> On 6/3/25 20:49, Ignacio Encinas wrote:
>> Vector registers are zero initialized by the kernel. Stop accepting
>> "all ones" as a clean value.
>>
>> Note that this was not working as expected given that
>> 	value == 0xff
>> can be assumed to be always false by the compiler as value's range is
>> [-128, 127]. Both GCC (-Wtype-limits) and clang
>> (-Wtautological-constant-out-of-range-compare) warn about this.
>>
>> Reviewed-by: Charlie Jenkins <charlie@...osinc.com>
>> Tested-by: Charlie Jenkins <charlie@...osinc.com>
>> Signed-off-by: Ignacio Encinas <ignacio@...cinas.com>
>> ---
>> Changes in v2:
>>
>> Remove code that becomes useless now that the only "clean" value for
>> vector registers is 0.
>>
>> - Link to v1: https://lore.kernel.org/r/20250305-fix-v_exec_initval_nolibc-v1-1-b87b60e43002@iencinas.com
>> ---
>>   tools/testing/selftests/riscv/vector/v_exec_initval_nolibc.c | 10 +++-------
>>   1 file changed, 3 insertions(+), 7 deletions(-)
>>
>> diff --git a/tools/testing/selftests/riscv/vector/v_exec_initval_nolibc.c b/tools/testing/selftests/riscv/vector/v_exec_initval_nolibc.c
>> index 35c0812e32de0c82a54f84bd52c4272507121e35..4dde05e45a04122b566cedc36d20b072413b00e2 100644
>> --- a/tools/testing/selftests/riscv/vector/v_exec_initval_nolibc.c
>> +++ b/tools/testing/selftests/riscv/vector/v_exec_initval_nolibc.c
>> @@ -6,7 +6,7 @@
>>    * the values. To further ensure consistency, this file is compiled without
>>    * libc and without auto-vectorization.
>>    *
>> - * To be "clean" all values must be either all ones or all zeroes.
>> + * To be "clean" all values must be all zeroes.
>>    */
>>   
>>   #define __stringify_1(x...)	#x
>> @@ -14,9 +14,8 @@
>>   
>>   int main(int argc, char **argv)
>>   {
>> -	char prev_value = 0, value;
>> +	char value = 0;
>>   	unsigned long vl;
>> -	int first = 1;
>>   
>>   	if (argc > 2 && strcmp(argv[2], "x"))
>>   		asm volatile (
>> @@ -44,14 +43,11 @@ int main(int argc, char **argv)
>>   			"vsrl.vi " __stringify(register) ", " __stringify(register) ", 8\n\t" \
>>   			".option pop\n\t"					\
>>   			: "=r" (value));					\
>> -		if (first) {							\
>> -			first = 0;						\
>> -		} else if (value != prev_value || !(value == 0x00 || value == 0xff)) { \
>> +		if (value != 0x00) {						\
>>   			printf("Register " __stringify(register)		\
>>   				" values not clean! value: %u\n", value);	\
>>   			exit(-1);						\
>>   		}								\
>> -		prev_value = value;						\
>>   	}									\
>>   })
>>   
>>
>> ---
>> base-commit: 03d38806a902b36bf364cae8de6f1183c0a35a67
>> change-id: 20250301-fix-v_exec_initval_nolibc-498d976c372d
>>
>> Best regards,
>
> _______________________________________________
> linux-riscv mailing list
> linux-riscv@...ts.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-riscv

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ