Re: [PATCH v2] kbuild: treat char as always unsigned
From: Jason A. Donenfeld
Date: Thu Oct 20 2022 - 21:02:07 EST
On Thu, Oct 20, 2022 at 11:41:29AM -0700, Kees Cook wrote:
> On Wed, Oct 19, 2022 at 05:38:55PM -0700, Linus Torvalds wrote:
> > Having some scripting automation that just notices "this changes code
> > generation in function X" might actually be interesting, and judging
> > by my quick tests might not be *too* verbose.
>
> On the reproducible build comparison system[1] we use for checking a lot
> of the KSPP work for .text deltas, an allmodconfig finds a fair bit for
> this change. Out of 33900 .o files, 1005 have changes.
>
> Spot checking matches a lot of what you found already...
>
> u64 flags = how->flags;
> ...
> fs/open.c:1123:
> int acc_mode = ACC_MODE(flags);
> - 1c86: movsbl 0x0(%rdx),%edx
> + 1c86: movzbl 0x0(%rdx),%edx
>
> #define ACC_MODE(x) ("\004\002\006\006"[(x)&O_ACCMODE])
>
> Ignoring those, it goes down to 625, and spot checking those is more
> difficult, but looks to be mostly register selection changes dominating
> the delta. The resulting vmlinux sizes are identical, though.
>
> -Kees
>
> [1] A fancier version of:
> https://outflux.net/blog/archives/2022/06/24/finding-binary-differences/
Say, don't we have some way of outputting LLVM IL? I saw some
-fno-discard-value-names floating through a few days ago. Apparently you
can do `make LLVM=1 fs/select.ll`? This might have less noise in it.
I'll play on the airplane tomorrow.
Jason