From: Guenter Roeck <linux@roeck-us.net>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com>,
Alexander Potapenko <glider@google.com>,
Andrey Konovalov <andreyknvl@gmail.com>,
Dmitry Vyukov <dvyukov@google.com>,
Vincenzo Frascino <vincenzo.frascino@arm.com>,
kasan-dev@googlegroups.com, linux-kernel@vger.kernel.org,
Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [PATCH v2] x86/Kconfig: Fix allyesconfig
Date: Wed, 16 Apr 2025 20:10:19 -0700 [thread overview]
Message-ID: <b35dc3bb-71ca-4f5e-af29-8e1605ec5bde@roeck-us.net> (raw)
In-Reply-To: <20250416182828.9e2b312a75ed90b706483250@linux-foundation.org>
On 4/16/25 18:28, Andrew Morton wrote:
> On Wed, 16 Apr 2025 17:17:00 -0700 Guenter Roeck <linux@roeck-us.net> wrote:
>
>> On 4/16/25 17:03, Andrew Morton wrote:
>>> On Wed, 16 Apr 2025 16:05:59 -0700 Guenter Roeck <linux@roeck-us.net> wrote:
>>>
>>>> 64-bit allyesconfig builds fail with
>>>>
>>>> x86_64-linux-ld: kernel image bigger than KERNEL_IMAGE_SIZE
>>>>
>>>> Bisect points to commit 6f110a5e4f99 ("Disable SLUB_TINY for build
>>>> testing") as the responsible commit. Reverting that patch does indeed
>>>> fix the problem. Further analysis shows that disabling SLUB_TINY enables
>>>> KASAN, and that KASAN is responsible for the image size increase.
>>>>
>>>> Solve the build problem by disabling KASAN for test builds.
>>>>
>>>
>>> Excluding KASAN from COMPILE_TEST builds is regrettable.
>>>
>>> Can we address this some other way? One way might be to alter or
>>> disable the KERNEL_IMAGE_SIZE check if COMPILE_TEST? That will be sad
>>> for anyone who tries to boot a COMPILE_TEST kernel, but who the heck
>>> does that?
>>
>> I tried increasing the limit. It didn't work. With the RFC I sent earlier
>> I made it dependent on allmodconfig, but Linus said I should just disable
>> it for test builds (which was the cases anyway until commit 6f110a5e4f99).
>>
>> Personally I don't have a preference either way. I can also do nothing and
>> stop testing allyesconfig. That would help reducing the load on my testbed,
>> so I would be all for it.
>
> How about this?
>
>
>
> --- a/arch/x86/kernel/vmlinux.lds.S~a
> +++ a/arch/x86/kernel/vmlinux.lds.S
> @@ -466,10 +466,19 @@ SECTIONS
> }
>
> /*
> - * The ASSERT() sink to . is intentional, for binutils 2.14 compatibility:
> + * COMPILE_TEST kernels can be large - CONFIG_KASAN, for example, can cause
> + * this. Let's assume that nobody will be running a COMPILE_TEST kernel and
> + * let's assert that fuller build coverage is more valuable than being able to
> + * run a COMPILE_TEST kernel.
> + */
> +#ifndef CONFIG_COMPILE_TEST
> +/*
> +/*
> + * The ASSERT() sync to . is intentional, for binutils 2.14 compatibility:
> */
> . = ASSERT((_end - LOAD_OFFSET <= KERNEL_IMAGE_SIZE),
> "kernel image bigger than KERNEL_IMAGE_SIZE");
> +#endif
>
Yes, that is what I ended up doing with v3 (thanks for the idea), lacking the comment.
Guess I'll need to send v4, but I'll wait a bit to see if there is feedback from others.
> /* needed for Clang - see arch/x86/entry/entry.S */
> PROVIDE(__ref_stack_chk_guard = __stack_chk_guard);
> _
>
>
> (contains gratuitous s/sink/sync/)
>
>
> I'd like to add
>
> #else
> WARN((_end - LOAD_OFFSET <= KERNEL_IMAGE_SIZE),
> "kernel image bigger than KERNEL_IMAGE_SIZE - kernel probably will not work");
> #endif /* CONFIG_COMPILE_TEST */
>
> but I lack the patience to figure out how to do that.
WARN is a define which declares C code. That doesn't work in linker scripts.
I only got #ifdef to work. I did not find a linker script command which would
be equivalent to WARN(). Maybe someone else knows if it is possible and how
to do it.
Guenter
next prev parent reply other threads:[~2025-04-17 3:10 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-16 23:05 Guenter Roeck
2025-04-17 0:03 ` Andrew Morton
2025-04-17 0:17 ` Guenter Roeck
2025-04-17 1:28 ` Andrew Morton
2025-04-17 3:10 ` Guenter Roeck [this message]
2025-04-17 0:42 ` Guenter Roeck
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b35dc3bb-71ca-4f5e-af29-8e1605ec5bde@roeck-us.net \
--to=linux@roeck-us.net \
--cc=akpm@linux-foundation.org \
--cc=andreyknvl@gmail.com \
--cc=dvyukov@google.com \
--cc=glider@google.com \
--cc=kasan-dev@googlegroups.com \
--cc=linux-kernel@vger.kernel.org \
--cc=ryabinin.a.a@gmail.com \
--cc=torvalds@linux-foundation.org \
--cc=vincenzo.frascino@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®