The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Sergey Senozhatsky <senozhatsky@chromium.org>
To: Julian Braha <julianbraha@gmail.com>
Cc: Sergey Senozhatsky <senozhatsky@chromium.org>,
	 Andrew Jones <andrew.jones@linux.dev>,
	andriy.shevchenko@linux.intel.com, linux-kbuild@vger.kernel.org,
	 linux-kernel@vger.kernel.org, nathan@kernel.org, nsc@kernel.org,
	rdunlap@infradead.org,  tfiga@chromium.org
Subject: Re: [PATCH v4] kconfig: add kconfig-sym-check static checker
Date: Thu, 25 Jun 2026 12:43:56 +0900	[thread overview]
Message-ID: <ajyjpt10bHS3ERLv@google.com> (raw)
In-Reply-To: <7e416a8a-d7f0-4dc6-b279-f7848b89df31@gmail.com>

On (26/06/24 13:28), Julian Braha wrote:
> On 6/24/26 04:34, Sergey Senozhatsky wrote:
> > OK, maybe they are not similar, as Julian pointed out.  Makes
> > we wonder is there any benefit in moving this functionality
> > into kconfig (which is the tool that deals with Kconfig files).
> 
> Agreed, it would be ideal if the check could be part of the kconfig
> interpeter.
> 
> However...

Right...  There's always a "however" :)

> Linux does a funky thing with its architecture handling in kconfig:
> it looks up the architecture from a makefile variable and uses that to
> resolve a kconfig file import in 'arch/Kconfig'.
> 
> This means e.g. when evaluating the kconfig on an x86 machine, all of
> the config options in the RISC-V kconfig are never reached, thus never
> parsed, and never added to the symbol table. As far as the interpeter is
> aware, any reference to, say, RISCV_SBI is a dead reference on x86.
> 
> Yet, options throughout the kernel can reference arch-specific options.
> Try searching in menuconfig for the RISCV-only option HVC_RISCV_SBI on
> x86, and you'll successfully find it, because it's defined in 'drivers/'
> (not downstream of arch/Kconfig). Then try searching for its dependency,
> RISCV_SBI. Apparently it doesn't exist? In my opinion, this should also
> be considered a bug in the frontend...
> 
> All this is to say, until architectures are restructured in kconfig,
> alarming on unknown options would output 99% noise.

Agreed, let's keep it simple.  Thank you!

  reply	other threads:[~2026-06-25  3:44 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-23  7:49 [PATCH v4] kconfig: add kconfig-sym-check static checker Sergey Senozhatsky
2026-06-23 15:18 ` Andrew Jones
2026-06-23 15:25   ` Julian Braha
2026-06-23 16:10     ` Andy Shevchenko
2026-06-24  3:29     ` Sergey Senozhatsky
2026-06-24  3:27   ` Sergey Senozhatsky
2026-06-24  3:34     ` Sergey Senozhatsky
2026-06-24 12:28       ` Julian Braha
2026-06-25  3:43         ` Sergey Senozhatsky [this message]
  -- strict thread matches above, loose matches on Subject: below --
2026-05-27 14:27 Andrew Jones
2026-06-02 13:05 ` Nicolas Schier
2026-06-09 23:46 ` Nathan Chancellor
2026-06-10 16:00   ` Andrew Jones
2026-06-10 22:49     ` Nathan Chancellor

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=ajyjpt10bHS3ERLv@google.com \
    --to=senozhatsky@chromium.org \
    --cc=andrew.jones@linux.dev \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=julianbraha@gmail.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nathan@kernel.org \
    --cc=nsc@kernel.org \
    --cc=rdunlap@infradead.org \
    --cc=tfiga@chromium.org \
    /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