The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Ahmed S. Darwish" <darwi@linutronix.de>,
	"Nathan Chancellor" <nathan@kernel.org>,
	"Nicolas Schier" <nsc@kernel.org>,
	"Julian Braha" <julianbraha@gmail.com>,
	"Emanuele Rocca" <ema@debian.org>,
	"Clark Williams" <clrkwllms@kernel.org>,
	"Steven Rostedt" <rostedt@goodmis.org>,
	"Ingo Molnar" <mingo@redhat.com>
Cc: "Sebastian Andrzej Siewior" <bigeasy@linutronix.de>,
	"Frederic Weisbecker" <frederic@kernel.org>,
	"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-kernel@vger.kernel.org
Subject: Re: [PATCH v2 04/11] Documentation: Describe kconfig-audit usage and design
Date: Fri, 04 Dec 2026 22:50:11 +0000	[thread overview]
Message-ID: <sashiko-outbox-250776@kernel.org> (raw)
In-Reply-To: <20261203224916.118064-5-darwi@linutronix.de>

Thank you for your contribution! Sashiko AI review found 4 potential
issues to consider:
- [Low] docs: kconfig-audit exact-rule precedence contradicts
  _map_pattern_rules()
- [Low] docs: kconfig-audit enabled pattern rule misses zero-match
  failure
- [Low] docs: kconfig-audit Invocation section omits -P / --policy-file
  option
- [Low] docs: kconfig-audit omits duplicate name_pattern rule rejection
--

commit b13b53469deef91d63f2604f80547d95c6a4d51c
Author: Ahmed S. Darwish <darwi@linutronix.de>

Documentation: Describe kconfig-audit usage and design

This commit documents kconfig-audit usage, policy format, and dependencies,
links it from the PREEMPT_RT configuration guide, and references the new
documentation in the missing-dependency error message.

> diff --git a/Documentation/tools/kconfig-audit.rst b/Documentation/tools/kconfig-audit.rst
> new file mode 100644
> index 0000000000000..5b8e2fa842b1e
> --- /dev/null
> +++ b/Documentation/tools/kconfig-audit.rst
> @@ -0,0 +1,517 @@

[ ... ]

> +Check a ``.config`` against a policy known to the checker::
> +
> +   audit.py check -c path/to/.config -p preempt_rt

[Severity: Low]
Should this section also document -P / --policy-file?  parse_args() in
tools/kconfig-audit/audit.py supports checking against a custom policy
file, but this option is not mentioned anywhere in the document despite
the policy authoring guide below.

[ ... ]

> +Note that pattern priority conflicts are detected only for symbols present
> +in the checked ``.config``.  An exact ``name`` rule continues to take
> +precedence over all pattern rules for such symbols.

[Severity: Low]
Does this match Checker._map_pattern_rules() in
tools/kconfig-audit/audit.py?

Checker.__post_init__() calls _map_pattern_rules() before
_find_pattern_rule_issues() checks exact rule precedence.  When a symbol
in .config matches multiple highest-priority pattern rules, audit.py
aborts with EX_DATAERR even if an exact name rule covers that symbol.

Either _map_pattern_rules() should skip symbols covered by an exact rule,
or this note should reflect that conflicts are still rejected.

> +
> +Duplicate rules are rejected
> +----------------------------
> +
> +Duplicate exact symbol rules are rejected.  The policy below:

[Severity: Low]
Should this section also mention duplicate name_pattern rules?
Policy.add_rule() in tools/kconfig-audit/audit.py rejects identical
name_pattern strings at parse time with EX_DATAERR, even when they have
different pattern_prio values or match no symbols in .config.

[ ... ]

> +``enabled``
> +   The symbol must be set to ``y`` or ``m``.
> +
> +   For an exact ``name`` rule, a missing symbol fails an ``enabled`` rule.
> +   An explicitly unset symbol also fails.  For a ``name_pattern`` rule, the
> +   rule applies only to symbols matched in the checked ``.config``.

[Severity: Low]
Is this accurate for an enabled name_pattern rule that matches nothing in
.config?

In tools/kconfig-audit/audit.py, Checker._find_pattern_rule_issues()
reports an issue and exits with EX_CONFIG when an expected: enabled
pattern rule matches zero symbols in .config, unless an exact symbol rule
in the policy matches the regex.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261203224916.118064-1-darwi@linutronix.de?part=4

  reply	other threads:[~2026-12-04 22:50 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-03 22:49 [PATCH v2 00/11] tools: Introduce a kernel configuration checker Ahmed S. Darwish
2026-12-03 22:49 ` [PATCH v2 01/11] kconfig-audit: Add schema for policy files Ahmed S. Darwish
2026-12-04 22:50   ` sashiko-bot
2026-12-03 22:49 ` [PATCH v2 02/11] kconfig-audit: Introduce a PREEMPT_RT configuration policy Ahmed S. Darwish
2026-12-04 22:50   ` sashiko-bot
2026-12-03 22:49 ` [PATCH v2 03/11] kconfig-audit: Add the configuration checker code Ahmed S. Darwish
2026-12-04 22:50   ` sashiko-bot
2026-12-03 22:49 ` [PATCH v2 04/11] Documentation: Describe kconfig-audit usage and design Ahmed S. Darwish
2026-12-04 22:50   ` sashiko-bot [this message]
2026-12-03 22:49 ` [PATCH v2 05/11] kconfig-audit: Split policy schema for component reuse Ahmed S. Darwish
2026-12-04 22:50   ` sashiko-bot
2026-12-03 22:49 ` [PATCH v2 06/11] kconfig-audit: Introduce policy overlays schema Ahmed S. Darwish
2026-12-04 22:50   ` sashiko-bot
2026-12-03 22:49 ` [PATCH v2 07/11] kconfig-audit: Add support for policy overlays Ahmed S. Darwish
2026-12-04 22:50   ` sashiko-bot
2026-12-03 22:49 ` [PATCH v2 08/11] Documentation: kconfig-audit: Describe " Ahmed S. Darwish
2026-12-04 22:50   ` sashiko-bot
2026-12-03 22:49 ` [PATCH v2 09/11] MAINTAINERS: Add entry for kernel configuration audit Ahmed S. Darwish
2026-12-03 22:49 ` [PATCH v2 10/11] kconfig: Introduce auditconfig target Ahmed S. Darwish
2026-12-04 22:50   ` sashiko-bot
2026-12-03 22:49 ` [PATCH v2 11/11] Documentation: Describe auditconfig build target Ahmed S. Darwish
2026-12-04 22:50   ` sashiko-bot

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=sashiko-outbox-250776@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=bigeasy@linutronix.de \
    --cc=clrkwllms@kernel.org \
    --cc=daan.j.demeyer@gmail.com \
    --cc=darwi@linutronix.de \
    --cc=debarbos@redhat.com \
    --cc=debian-kernel@lists.debian.org \
    --cc=ema@debian.org \
    --cc=frederic@kernel.org \
    --cc=john.ogness@linutronix.de \
    --cc=julianbraha@gmail.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rt-devel@lists.linux.dev \
    --cc=luca.boccassi@gmail.com \
    --cc=mingo@redhat.com \
    --cc=nathan@kernel.org \
    --cc=nsc@kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=zbyszek@amutable.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