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: <20250130193944.478cae8f@pumpkin>
Date: Thu, 30 Jan 2025 19:39:44 +0000
From: David Laight <david.laight.linux@...il.com>
To: Naresh Kamboju <naresh.kamboju@...aro.org>
Cc: lkft-triage@...ts.linaro.org, open list <linux-kernel@...r.kernel.org>,
 Linux Regressions <regressions@...ts.linux.dev>, Linux ARM
 <linux-arm-kernel@...ts.infradead.org>, David Laight
 <david.laight@...lab.com>, Arnd Bergmann <arnd@...db.de>, Dan Carpenter
 <dan.carpenter@...aro.org>, Anders Roxell <anders.roxell@...aro.org>, Ankit
 Nautiyal <ankit.k.nautiyal@...el.com>, Suraj Kandpal
 <suraj.kandpal@...el.com>
Subject: Re: linux: master: x86_64: gcc-8: error: call to
 '__compiletime_assert_909' declared with attribute error: clamp() low limit
 dsc_min_bpc * 3 greater than high limit dsc_max_bpc * 3

On Thu, 30 Jan 2025 15:01:21 +0530
Naresh Kamboju <naresh.kamboju@...aro.org> wrote:

> The x86_64 and i386 build failed with defconfig with gcc-8 toolchain due to
> following build warnings / errors on the Torvalds Linux master branch.
> But gcc-13 builds pass.
> 
> First seen on v6.13-9485-g72deda0abee6 on Jan. 27, 2025
> Good:  v6.13-7644-gc2da8b3f914f on Jan. 27, 2025
> Bad:  v6.13-8265-g9c5968db9e62 on Jan. 27, 2025
> 
> i386:
>   build:
>     * gcc-8-i386_defconfig
> 
> x86_64:
>   build:
>     * gcc-8-x86_64_defconfig
> 
> Reported-by: Linux Kernel Functional Testing
> 
> Build log:
> ---
> make --silent --keep-going --jobs=8
> O=/home/tuxbuild/.cache/tuxmake/builds/1/build ARCH=x86_64 SRCARCH=x86
> CROSS_COMPILE=x86_64-linux-gnu- 'CC=sccache x86_64-linux-gnu-gcc'
> 'HOSTCC=sccache gcc'
> In file included from <command-line>:
> In function 'intel_dp_dsc_compute_pipe_bpp_limits.isra.80',
>     inlined from 'intel_dp_compute_config_limits' at
> drivers/gpu/drm/i915/display/intel_dp.c:2547:3:
> include/linux/compiler_types.h:542:38: error: call to
> '__compiletime_assert_909' declared with attribute error: clamp() low
> limit dsc_min_bpc * 3 greater than high limit dsc_max_bpc * 3
...
> drivers/gpu/drm/i915/display/intel_dp.c:2506:25: note: in expansion of
> macro 'clamp'
>   limits->pipe.max_bpp = clamp(limits->pipe.max_bpp, dsc_min_bpc * 3, dsc_max_bpc * 3);

The code is:

static void
intel_dp_dsc_compute_pipe_bpp_limits(struct intel_dp *intel_dp,
                                     struct link_config_limits *limits)
{
        struct intel_display *display = to_intel_display(intel_dp);
        int dsc_min_bpc = intel_dp_dsc_min_src_input_bpc();
        int dsc_max_bpc = intel_dp_dsc_max_src_input_bpc(display);
 
        limits->pipe.max_bpp = clamp(limits->pipe.max_bpp, dsc_min_bpc * 3, dsc_max_bpc * 3);
        limits->pipe.min_bpp = clamp(limits->pipe.min_bpp, dsc_min_bpc * 3, dsc_max_bpc * 3);
}

with:

int intel_dp_dsc_min_src_input_bpc(void)
{
        /* Min DSC Input BPC for ICL+ is 8 */
        return 8;
}
     
int intel_dp_dsc_max_src_input_bpc(struct intel_display *display)
{
        /* Max DSC Input BPC for ICL is 10 and for TGL+ is 12 */
        if (DISPLAY_VER(display) >= 12)
                return 12;
        if (DISPLAY_VER(display) == 11)
                return 10;

        return 0;
}

Although the little functions aren't static the compiler can assume that the local
versions will be called and inline them.

It can then move the clamp() code into the conditionals in
intel_dp_dsc_max_src_input_bpc()
It then sees clamp(limit->pipe.max_bpp, 24, 0) and quite rightly complains.

Broken by 160672b86b0dd

	David


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ