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: <c5e34fed-4dc7-4288-9183-c6c076bb3b85@bootlin.com>
Date: Thu, 31 Jul 2025 15:49:12 +0200
From: Louis Chauvet <louis.chauvet@...tlin.com>
To: Maxime Ripard <mripard@...nel.org>
Cc: Jyri Sarha <jyri.sarha@....fi>,
 Tomi Valkeinen <tomi.valkeinen@...asonboard.com>,
 Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
 Thomas Zimmermann <tzimmermann@...e.de>, David Airlie <airlied@...il.com>,
 Simona Vetter <simona@...ll.ch>, dri-devel@...ts.freedesktop.org,
 linux-kernel@...r.kernel.org
Subject: Re: [PATCH 00/14] drm/tidss: dispc: Convert to FIELD_* API



Le 31/07/2025 à 15:26, Maxime Ripard a écrit :
> Hi Louis,
> 
> On Thu, Jul 31, 2025 at 03:04:49PM +0200, Louis Chauvet wrote:
>> Le 30/07/2025 à 10:57, Maxime Ripard a écrit :
>>> Hi,
>>>
>>> The tidss driver rolls its own API equivalent to the FIELD_* API already
>>> provided the kernel.
>>>
>>> Since it's an ad-hoc implementation, it also is less convenient and
>>> doesn't provide some useful features like being able to share the field
>>> definitions that will come handy in the future.
>>>
>>> Thus, this series converts the driver to that API and drops its own
>>> version.
>>
>> I just saw your series after sending mine [2]. I checked, there is only one
>> minor conflict that can be easly fixed.
>>
>> But when applied on drm-misc/drm-misc-next, your series raises:
>>
>> In file included from <command-line>:
>> drivers/gpu/drm/tidss/tidss_dispc.c: In function 'FLD_MOD':
>> ././include/linux/compiler_types.h:568:45: error: call to
>> '__compiletime_assert_589' declared with attribute error: FIELD_PREP: mask
>> is not constant
>>    568 |         _compiletime_assert(condition, msg, __compiletime_assert_,
>> __COUNTER__)
>>        |                                             ^
>> ././include/linux/compiler_types.h:549:25: note: in definition of macro
>> '__compiletime_assert'
>>    549 |                         prefix ## suffix();         \
>>        |                         ^~~~~~
>> ././include/linux/compiler_types.h:568:9: note: in expansion of macro
>> '_compiletime_assert'
>>    568 |         _compiletime_assert(condition, msg, __compiletime_assert_,
>> __COUNTER__)
>>        |         ^~~~~~~~~~~~~~~~~~~
>> ./include/linux/build_bug.h:39:37: note: in expansion of macro
>> 'compiletime_assert'
>>     39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
>>        |                                     ^~~~~~~~~~~~~~~~~~
>> ./include/linux/bitfield.h:65:17: note: in expansion of macro
>> 'BUILD_BUG_ON_MSG'
>>     65 |                 BUILD_BUG_ON_MSG(!__builtin_constant_p(_mask),
>> \
>>        |                 ^~~~~~~~~~~~~~~~
>> ./include/linux/bitfield.h:115:17: note: in expansion of macro
>> '__BF_FIELD_CHECK'
>>    115 |                 __BF_FIELD_CHECK(_mask, 0ULL, _val, "FIELD_PREP: ");
>> \
>>        |                 ^~~~~~~~~~~~~~~~
>> drivers/gpu/drm/tidss/tidss_dispc.c:599:33: note: in expansion of macro
>> 'FIELD_PREP'
>>    599 |         return (orig & ~mask) | FIELD_PREP(mask, val);
>>        |                                 ^~~~~~~~~~
>>
>>
>> This seems to be a limitation of FIELD_PREP [1].
>> I think the only way to avoid this issue is to use macros and not functions.
>>
>> [1]:https://elixir.bootlin.com/linux/v6.16/source/include/linux/bitfield.h#L65-L66
>> [2]:https://lore.kernel.org/all/20250730-fix-edge-handling-v1-0-1bdfb3fe7922@bootlin.com/
> 
> Weird, it compiles without warning for me here. Which compiler do you use?


I use this one:

aarch64-linux-gnu-gcc (GCC) 14.2.1 20240912 (Red Hat Cross 14.2.1-2)
Copyright (C) 2024 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

You can find my .config attached, and I just pushed a branch here [1].

[1]:https://github.com/Fomys/linux/tree/review/20250730-drm-tidss-field-api-v1-0-a71ae8dd2782%40kernel.org

> Thanks!
> Maxime

-- 
Louis Chauvet, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

View attachment "defconfig" of type "text/plain" (22860 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ