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] [day] [month] [year] [list]
Message-ID: <4ecfq73s45kkcihy6z5birbupszab7xoxf67267eiahcz6lmjz@qm72ktcfsbd5>
Date: Thu, 13 Mar 2025 08:15:20 -0500
From: Lucas De Marchi <lucas.demarchi@...el.com>
To: Vincent Mailhol <mailhol.vincent@...adoo.fr>
CC: Yury Norov <yury.norov@...il.com>, Rasmus Villemoes
	<linux@...musvillemoes.dk>, Jani Nikula <jani.nikula@...ux.intel.com>,
	"Joonas Lahtinen" <joonas.lahtinen@...ux.intel.com>, Rodrigo Vivi
	<rodrigo.vivi@...el.com>, Tvrtko Ursulin <tursulin@...ulin.net>, David Airlie
	<airlied@...il.com>, Simona Vetter <simona@...ll.ch>, Andrew Morton
	<akpm@...ux-foundation.org>, <linux-kernel@...r.kernel.org>,
	<intel-gfx@...ts.freedesktop.org>, <dri-devel@...ts.freedesktop.org>, "Andi
 Shyti" <andi.shyti@...ux.intel.com>, David Laight <David.Laight@...lab.com>,
	Dmitry Baryshkov <dmitry.baryshkov@...aro.org>, Andy Shevchenko
	<andriy.shevchenko@...ux.intel.com>
Subject: Re: [PATCH v5 5/7] test_bits: add tests for __GENMASK() and
 __GENMASK_ULL()

On Thu, Mar 13, 2025 at 03:00:34PM +0900, Vincent Mailhol wrote:
>On 13/03/2025 at 13:13, Lucas De Marchi wrote:
>> On Thu, Mar 06, 2025 at 08:29:56PM +0900, Vincent Mailhol via B4 Relay
>> wrote:
>>> From: Vincent Mailhol <mailhol.vincent@...adoo.fr>
>>>
>>> The definitions of GENMASK() and GENMASK_ULL() do not depend any more
>>> on __GENMASK() and __GENMASK_ULL(). Duplicate the existing unit tests
>>> so that __GENMASK{,ULL}() is still covered.
>>>
>>> Signed-off-by: Vincent Mailhol <mailhol.vincent@...adoo.fr>
>>> ---
>>> lib/test_bits.c | 18 ++++++++++++++++++
>>> 1 file changed, 18 insertions(+)
>>>
>>> diff --git a/lib/test_bits.c b/lib/test_bits.c
>>> index
>>> c7b38d91e1f16d42b7ca92e62fbd6c19b37e76a0..dc93ded9fdb201e0d44b3c1cd71e233fd62258a5 100644
>>> --- a/lib/test_bits.c
>>> +++ b/lib/test_bits.c
>>> @@ -7,6 +7,22 @@
>>> #include <linux/bits.h>
>>>
>>>
>>> +static void __genmask_test(struct kunit *test)
>>> +{
>>> +    KUNIT_EXPECT_EQ(test, 1ul, __GENMASK(0, 0));
>>> +    KUNIT_EXPECT_EQ(test, 3ul, __GENMASK(1, 0));
>>> +    KUNIT_EXPECT_EQ(test, 6ul, __GENMASK(2, 1));
>>> +    KUNIT_EXPECT_EQ(test, 0xFFFFFFFFul, __GENMASK(31, 0));
>>
>> why are you dropping the ones for TEST_GENMASK_FAILURES ?
>
>Because the __GENMASK() and the __GENMASK_ULL() do not use
>GENMASK_INPUT_CHECK(), it is not possible to have those
>TEST_GENMASK_FAILURES negative test cases here.
>
>I will add one sentence to the commit message to explain this.

ok, makes sense.

Reviewed-by: Lucas De Marchi <lucas.demarchi@...el.com>

thanks
Lucas De Marchi

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ