mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steffen Eiden <seiden@linux.ibm.com>
To: Fuad Tabba <fuad.tabba@linux.dev>
Cc: Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Marc Zyngier <maz@kernel.org>, Oliver Upton <oupton@kernel.org>,
	Mark Brown <broonie@kernel.org>,
	Sascha Bischoff <Sascha.Bischoff@arm.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, Fuad Tabba <tabba@google.com>
Subject: Re: [PATCH v2 07/10] arm64: sysreg: Reject an enum value not written at its field's width
Date: Fri, 27 Nov 2026 15:24:49 +0100	[thread overview]
Message-ID: <20261127142449.333656-B-seiden@linux.ibm.com> (raw)
In-Reply-To: <20261127074426.50739-8-fuad.tabba@linux.dev>

On Fri, Nov 27, 2026 at 07:44:23AM +0000, Fuad Tabba wrote:
> The generator emits each enum value as written and doesn't check it
> against the width of its field, so a value wider than the field defines
> a constant the field can't hold. The duplicate value check compares the
> strings as written, so 0b01 and 0b001 in the same field pass as distinct
> values, and the rule's pattern, an unanchored /0b[01]+/, accepts 0b12
> too.
> 
> Require each value to be 0b followed by exactly as many binary digits as
> its field has bits. Test it in the rule's action rather than by
> tightening the pattern, so that a value such as 0b12 is reported with
> its field's width, instead of falling to the generic "unhandled
> statement" error.
> 
> Reviewed-by: Mark Brown <broonie@kernel.org>
> Signed-off-by: Fuad Tabba <fuad.tabba@linux.dev>

Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>


  reply	other threads:[~2026-11-27 14:25 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-27  7:44 [PATCH v2 00/10] arm64: sysreg: More input checks in the sysreg generator Fuad Tabba
2026-11-27  7:44 ` [PATCH v2 01/10] arm64: sysreg: Map MPAM1_EL12 to MPAM1_EL1 Fuad Tabba
2026-11-27  7:44 ` [PATCH v2 02/10] arm64: sysreg: Remove the dead range check from parse_bitdef() Fuad Tabba
2026-11-27  7:44 ` [PATCH v2 03/10] arm64: sysreg: Reject a Sysreg and a SysregFields with the same name Fuad Tabba
2026-11-27  7:44 ` [PATCH v2 04/10] arm64: sysreg: Don't run the end-of-file checks after an error Fuad Tabba
2026-11-27  7:44 ` [PATCH v2 05/10] arm64: sysreg: Reject a Fields or Mapping line with an undefined target Fuad Tabba
2026-11-27  7:44 ` [PATCH v2 06/10] arm64: sysreg: Drop the leading zeros from the TRFCR_ELx.TS values Fuad Tabba
2026-11-27 14:24   ` Steffen Eiden
2026-11-27  7:44 ` [PATCH v2 07/10] arm64: sysreg: Reject an enum value not written at its field's width Fuad Tabba
2026-11-27 14:24   ` Steffen Eiden [this message]
2026-11-27  7:44 ` [PATCH v2 08/10] arm64: sysreg: Reject a macro name defined twice Fuad Tabba
2026-11-27  7:44 ` [PATCH v2 09/10] arm64: sysreg: Reject an out-of-range register encoding Fuad Tabba
2026-11-27  7:44 ` [PATCH v2 10/10] arm64: sysreg: Reject a bit position written with a leading zero Fuad Tabba
2026-11-27 14:26   ` Steffen Eiden
2026-11-27 15:24   ` Mark Brown

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=20261127142449.333656-B-seiden@linux.ibm.com \
    --to=seiden@linux.ibm.com \
    --cc=Sascha.Bischoff@arm.com \
    --cc=broonie@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=fuad.tabba@linux.dev \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=maz@kernel.org \
    --cc=oupton@kernel.org \
    --cc=tabba@google.com \
    --cc=will@kernel.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

all inboxes | Powered by JetHome®