Article View: linux.debian.kernel
Article #666Re: [PATCH v1 03/10] kconfig-checker: Add the configuration checker code
From: Ahmed S. Darwish
Date: Mon, 16 Nov 2026 11:10
Date: Mon, 16 Nov 2026 11:10
81 lines
5113 bytes
5113 bytes
Hi Julian,
On Thu, 12 Nov 2026, Julian Braha wrote:
> On 11/9/26 13:00, Ahmed S. Darwish wrote:
> >
> > In v2 of this series, I'll make the schema explicitly versioned. This
> > way, new features like the above can be cleanly added.
> >
>
> Adding schema versioning would be great.
Yup.
> > P.S., I can definitely implement such support, but I'm a bit hesitant
> > to adding features that are not yet needed by the existing mainline
> > policies.
>
> I suppose it's not necessary to support these option types at the start,
> as there are few of them, relatively speaking. But it would be good to
> add some input validation in case a user attempts this.
>
> So I've finally had some time to sit down and test this:
>
> I created my own policy with these other types, and sure enough, if I
> specify them as 'disabled' in the policy like this:
>
> rules:
> - name: CONFIG_LOG_BUF_SHIFT
> expected: n
> severity: high
>
> - name: CONFIG_PHYSICAL_START
> expected: n
> severity: high
>
> - name: CONFIG_DEFAULT_HOSTNAME
> expected: n
> severity: high
>
> and my .config has these values:
> CONFIG_LOG_BUF_SHIFT=17
> CONFIG_PHYSICAL_START=0x1000000
> CONFIG_DEFAULT_HOSTNAME="example"
>
> then the config passes the check -- but it would probably be better to
> provide a warning or something about these options.
>
> Also, if I modify my policy to set 'expected' to 'y' for these, it
> reports "not in .config" (which would likely be confusing to the user).
>
> This regex stmt should match all int, hex, and string options for you:
> unsupported = re.compile(r'^(CONFIG_[A-Za-z0-9_]+)=[0-9a-fA-F"-]')
> by checking the first character of its value.
>
You're definitely correct here, thanks.
If a symbol is expected as enabled or disabled in the policy, but the
.config has it as an int, hex, or a string, then the report must include
that as a policy mismatch.
So for the above case, the tool should report something like:
* Below option is set as an integer:
CONFIG_LOG_BUF_SHIFT
But it's expected to be disabled instead.
And similarly for the other symbols.
I'll fix that in v2.
> The included preempt_rt policy worked as expected (nice).
Glad to hear!
All the best,
--
Ahmed S. Darwish
Linutronix GmbH
Technical Details
Message-ID:
<O02KZ-ceSc-1@gated-at.bofh.it>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.corradoroberto.it!bofh.it!news.nic.it!robomodReferences:
<NWoK5-aaez-7@gated-at.bofh.it> <NWLdD-amPt-5@gated-at.bofh.it> <NXxrY-aOTL-9@gated-at.bofh.it> <NXxrY-aOTL-7@gated-at.bofh.it> <O02KZ-ceSc-3@gated-at.bofh.it>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.corradoroberto.it!bofh.it!news.nic.it!robomod From: "Ahmed S. Darwish" <darwi@linutronix.de> Newsgroups: linux.debian.kernel,linux.kernel Subject: Re: [PATCH v1 03/10] kconfig-checker: Add the configuration checker code Date: Mon, 16 Nov 2026 12:10:01 +0100 Message-ID: <O02KZ-ceSc-1@gated-at.bofh.it> References: <NWoK5-aaez-7@gated-at.bofh.it> <NWLdD-amPt-5@gated-at.bofh.it> <NXxrY-aOTL-9@gated-at.bofh.it> <NXxrY-aOTL-7@gated-at.bofh.it> <O02KZ-ceSc-3@gated-at.bofh.it> X-Original-To: Julian Braha <julianbraha@gmail.com> X-Mailbox-Line: From debian-kernel-request@lists.debian.org Mon Nov 16 11:09:09 2026 Old-Return-Path: <darwi@linutronix.de> X-Amavis-Spam-Status: No, score=-4.4 tagged_above=-10000 required=5.3 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3] autolearn=ham autolearn_force=no X-Policyd-Weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 CL_IP_EQ_FROM_MX=-3.1; rate: -4.6 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Mailing-List: <debian-kernel@lists.debian.org> archive/latest/158367 List-ID: <debian-kernel.lists.debian.org> List-URL: <https://lists.debian.org/debian-kernel/> List-Archive: https://lists.debian.org/msgid-search/avrgcfcsp2FBVG4u@lx-t490 Approved: robomod@news.nic.it Lines: 81 Organization: linux.* mail to news gateway Sender: robomod@news.nic.it X-Original-Cc: Clark Williams <clrkwllms@kernel.org>, Steven Rostedt <rostedt@goodmis.org>, Ingo Molnar <mingo@redhat.com>, Nathan Chancellor <nathan@kernel.org>, Nicolas Schier <nsc@kernel.org>, Sebastian Andrzej Siewior <bigeasy@linutronix.de>, Frederic Weisbecker <frederic@kernel.org>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Jonathan Corbet <corbet@lwn.net>, John Ogness <john.ogness@linutronix.de>, Derek Barbosa <debarbos@redhat.com>, Zbigniew Jędrzejewski-Szmek <zbyszek@amutable.com>, Daan De Meyer <daan.j.demeyer@gmail.com>, Luca Boccassi <luca.boccassi@gmail.com>, linux-rt-devel@lists.linux.dev, debian-kernel@lists.debian.org, linux-kbuild@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, arighi@nvidia.com X-Original-Date: Mon, 16 Nov 2026 11:52:33 +0100 X-Original-Message-ID: <avrgcfcsp2FBVG4u@lx-t490> X-Original-References: <20261106091922.7560-1-darwi@linutronix.de> <20261106091922.7560-4-darwi@linutronix.de> <9729a4c6-22f9-4102-b62f-c76a75488240@gmail.com> <avHD-3JwbQofpJdH@lx-t490> <81c91813-79ff-4d36-92e6-8c0ecc1772c7@gmail.com>