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: <CAHk-=wj6xj_cGmsQK7g=hSfRZZNo-njC+u_1v3dE8fPZtjCBOg@mail.gmail.com>
Date: Tue, 20 Feb 2024 11:57:23 -0800
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Guenter Roeck <linux@...ck-us.net>, Matthew Auld <matthew.auld@...el.com>, 
	Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@....com>, 
	Christian König <christian.koenig@....com>
Cc: Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: Linux 6.8-rc5

On Tue, 20 Feb 2024 at 11:09, Guenter Roeck <linux@...ck-us.net> wrote:
>
> Build results:
>         total: 155 pass: 151 fail: 4
> Failed builds:
>         csky:allmodconfig
>         openrisc:allmodconfig
>         parisc:allmodconfig
>         xtensa:allmodconfig
> Qemu test results:
>         total: 549 pass: 547 fail: 2

Grr, I was hoping things would improve, not go backwards.

> ERROR: modpost: "__umoddi3" [drivers/gpu/drm/tests/drm_buddy_test.ko] undefined!
> ERROR: modpost: "__moddi3" [drivers/gpu/drm/tests/drm_buddy_test.ko] undefined!
>
> Commit a64056bb5a32 ("drm/tests/drm_buddy: add alloc_contiguous test"):
>
> +       u64 mm_size, ps = SZ_4K, i, n_pages, total;
> ...
> +       n_pages = mm_size / ps;

WTF? This code isn't lovely, but the build error indicates a complete
lack of compiler optimizations.

As far as I can tell, 'ps' is never modified, so the compiler should
be able to just treat it as a constant.

And 'mm_size' is a constant too in this context. It's a local variable
assigned once, with a compile-time constant value.

So that

        n_pages = mm_size / ps;

should be a constant value too (and that value should be 48).

Now, the __moddi3() is a *bit* more reasonable, because I assume it comes from

                int slot = i % 3;

where 'i' is marked as u64 too. For no good reason (it goes from 0 to
47), but it too does show a certain lack of basic optimizations (but
now it's at least a slightly more *complex* optimization because it
depends on the whole value range propagation).

None of this should be 'u64'. Even if the compiler has been unusually stupid.

The 'total' variable could possibly be considered validly be u64,
although even that is very very questinable.

> This patch breaks the build on all 32-bit systems since it introduces an
> unhandled direct 64-bit divide operation.

It turns out that that commit is buggy for another reason, but it's
hidden by the fact that apparently KUNIT_ASSERT_FALSE_MSG() doesn't
check the format string.

It randomly uses '%d' or '%llu' to print out various variations of
'ps'. All garbage.

Yes, yes, drm_buddy_init() takes u64 arguments. That in itself is a
bit questionable, but whatever. It does *NOT* mean that the variables
that don't need it should then be u64.

Suggested untested patch attached.

                  Linus

View attachment "patch.diff" of type "text/x-patch" (3295 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ