Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] arm64/sysreg: Fix BWE field encoding in ID_AA64DFR2_EL1
@ 2026-06-30 22:23 Jia He
  2026-07-01 14:29 ` Marc Zyngier
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Jia He @ 2026-06-30 22:23 UTC (permalink / raw)
  To: Catalin Marinas, Will Deacon, Marc Zyngier, linux-arm-kernel
  Cc: Lorenzo Pieralisi, Mark Brown, Sascha Bischoff, Fuad Tabba,
	Anshuman Khandual, Oliver Upton, linux-kernel, Bin Guo, Jia He

Commit 93d7356e4b30 ("arm64: sysreg: Describe ID_AA64DFR2_EL1 fields")
encodes the FEAT_BWE2 value of the BWE field as '0b0002'. Binary
literals only accept the digits 0 and 1, so the intended value is 2,
i.e. 0b0010.

The macro generated by gen-sysreg.awk currently expands to
	#define ID_AA64DFR2_EL1_BWE_FEAT_BWE2 UL(0b0002)
is not legal C and would fail to compile if any in-tree code referenced
it. At present no caller uses this enum value, so the kernel still
builds cleanly, but the bug is latent.

Fix the typo by using the correct binary literal 0b0010.

Cc: Bin Guo <guobin@linux.alibaba.com>
Fixes: 93d7356e4b30 ("arm64: sysreg: Describe ID_AA64DFR2_EL1 fields")
Signed-off-by: Jia He <justin.he@arm.com>
Reviewed-by: Mark Brown <broonie@kernel.org>
---
 arch/arm64/tools/sysreg | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/tools/sysreg b/arch/arm64/tools/sysreg
index bc1788b1662b..7cb61aca3797 100644
--- a/arch/arm64/tools/sysreg
+++ b/arch/arm64/tools/sysreg
@@ -1806,7 +1806,7 @@ Res0	15:8
 UnsignedEnum	7:4	BWE
 	0b0000	NI
 	0b0001	FEAT_BWE
-	0b0002	FEAT_BWE2
+	0b0010	FEAT_BWE2
 EndEnum
 UnsignedEnum	3:0	STEP
 	0b0000	NI
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] arm64/sysreg: Fix BWE field encoding in ID_AA64DFR2_EL1
  2026-06-30 22:23 [PATCH] arm64/sysreg: Fix BWE field encoding in ID_AA64DFR2_EL1 Jia He
@ 2026-07-01 14:29 ` Marc Zyngier
  2026-07-01 17:09 ` Oliver Upton
  2026-07-02 12:58 ` Will Deacon
  2 siblings, 0 replies; 4+ messages in thread
From: Marc Zyngier @ 2026-07-01 14:29 UTC (permalink / raw)
  To: Jia He
  Cc: Catalin Marinas, Will Deacon, linux-arm-kernel, Lorenzo Pieralisi,
	Mark Brown, Sascha Bischoff, Fuad Tabba, Anshuman Khandual,
	Oliver Upton, linux-kernel, Bin Guo

On Tue, 30 Jun 2026 23:23:47 +0100,
Jia He <justin.he@arm.com> wrote:
> 
> Commit 93d7356e4b30 ("arm64: sysreg: Describe ID_AA64DFR2_EL1 fields")
> encodes the FEAT_BWE2 value of the BWE field as '0b0002'. Binary
> literals only accept the digits 0 and 1, so the intended value is 2,
> i.e. 0b0010.
> 
> The macro generated by gen-sysreg.awk currently expands to
> 	#define ID_AA64DFR2_EL1_BWE_FEAT_BWE2 UL(0b0002)
> is not legal C and would fail to compile if any in-tree code referenced
> it. At present no caller uses this enum value, so the kernel still
> builds cleanly, but the bug is latent.
> 
> Fix the typo by using the correct binary literal 0b0010.
> 
> Cc: Bin Guo <guobin@linux.alibaba.com>
> Fixes: 93d7356e4b30 ("arm64: sysreg: Describe ID_AA64DFR2_EL1 fields")
> Signed-off-by: Jia He <justin.he@arm.com>
> Reviewed-by: Mark Brown <broonie@kernel.org>
> ---
>  arch/arm64/tools/sysreg | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arm64/tools/sysreg b/arch/arm64/tools/sysreg
> index bc1788b1662b..7cb61aca3797 100644
> --- a/arch/arm64/tools/sysreg
> +++ b/arch/arm64/tools/sysreg
> @@ -1806,7 +1806,7 @@ Res0	15:8
>  UnsignedEnum	7:4	BWE
>  	0b0000	NI
>  	0b0001	FEAT_BWE
> -	0b0002	FEAT_BWE2
> +	0b0010	FEAT_BWE2

Well, that was embarrassing. FWIW (and given the original patch,
that's not much):

Acked-by: Marc Zyngier <maz@kernel.org>

	M.

-- 
Without deviation from the norm, progress is not possible.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] arm64/sysreg: Fix BWE field encoding in ID_AA64DFR2_EL1
  2026-06-30 22:23 [PATCH] arm64/sysreg: Fix BWE field encoding in ID_AA64DFR2_EL1 Jia He
  2026-07-01 14:29 ` Marc Zyngier
@ 2026-07-01 17:09 ` Oliver Upton
  2026-07-02 12:58 ` Will Deacon
  2 siblings, 0 replies; 4+ messages in thread
From: Oliver Upton @ 2026-07-01 17:09 UTC (permalink / raw)
  To: Jia He
  Cc: Catalin Marinas, Will Deacon, Marc Zyngier, linux-arm-kernel,
	Lorenzo Pieralisi, Mark Brown, Sascha Bischoff, Fuad Tabba,
	Anshuman Khandual, linux-kernel, Bin Guo

On Tue, Jun 30, 2026 at 10:23:47PM +0000, Jia He wrote:
> Commit 93d7356e4b30 ("arm64: sysreg: Describe ID_AA64DFR2_EL1 fields")
> encodes the FEAT_BWE2 value of the BWE field as '0b0002'. Binary
> literals only accept the digits 0 and 1, so the intended value is 2,
> i.e. 0b0010.
> 
> The macro generated by gen-sysreg.awk currently expands to
> 	#define ID_AA64DFR2_EL1_BWE_FEAT_BWE2 UL(0b0002)
> is not legal C and would fail to compile if any in-tree code referenced
> it. At present no caller uses this enum value, so the kernel still
> builds cleanly, but the bug is latent.
> 
> Fix the typo by using the correct binary literal 0b0010.
> 
> Cc: Bin Guo <guobin@linux.alibaba.com>
> Fixes: 93d7356e4b30 ("arm64: sysreg: Describe ID_AA64DFR2_EL1 fields")
> Signed-off-by: Jia He <justin.he@arm.com>
> Reviewed-by: Mark Brown <broonie@kernel.org>

Hah, I screwed that up pretty good!

Reviewed-by: Oliver Upton <oupton@kernel.org>

> ---
>  arch/arm64/tools/sysreg | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arm64/tools/sysreg b/arch/arm64/tools/sysreg
> index bc1788b1662b..7cb61aca3797 100644
> --- a/arch/arm64/tools/sysreg
> +++ b/arch/arm64/tools/sysreg
> @@ -1806,7 +1806,7 @@ Res0	15:8
>  UnsignedEnum	7:4	BWE
>  	0b0000	NI
>  	0b0001	FEAT_BWE
> -	0b0002	FEAT_BWE2
> +	0b0010	FEAT_BWE2
>  EndEnum
>  UnsignedEnum	3:0	STEP
>  	0b0000	NI
> -- 
> 2.34.1
> 


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] arm64/sysreg: Fix BWE field encoding in ID_AA64DFR2_EL1
  2026-06-30 22:23 [PATCH] arm64/sysreg: Fix BWE field encoding in ID_AA64DFR2_EL1 Jia He
  2026-07-01 14:29 ` Marc Zyngier
  2026-07-01 17:09 ` Oliver Upton
@ 2026-07-02 12:58 ` Will Deacon
  2 siblings, 0 replies; 4+ messages in thread
From: Will Deacon @ 2026-07-02 12:58 UTC (permalink / raw)
  To: Catalin Marinas, Marc Zyngier, linux-arm-kernel, Jia He
  Cc: kernel-team, Will Deacon, Lorenzo Pieralisi, Mark Brown,
	Sascha Bischoff, Fuad Tabba, Anshuman Khandual, Oliver Upton,
	linux-kernel, Bin Guo

On Tue, 30 Jun 2026 22:23:47 +0000, Jia He wrote:
> Commit 93d7356e4b30 ("arm64: sysreg: Describe ID_AA64DFR2_EL1 fields")
> encodes the FEAT_BWE2 value of the BWE field as '0b0002'. Binary
> literals only accept the digits 0 and 1, so the intended value is 2,
> i.e. 0b0010.
> 
> The macro generated by gen-sysreg.awk currently expands to
> 	#define ID_AA64DFR2_EL1_BWE_FEAT_BWE2 UL(0b0002)
> is not legal C and would fail to compile if any in-tree code referenced
> it. At present no caller uses this enum value, so the kernel still
> builds cleanly, but the bug is latent.
> 
> [...]

Applied to arm64 (for-next/fixes), thanks!

[1/1] arm64/sysreg: Fix BWE field encoding in ID_AA64DFR2_EL1
      https://git.kernel.org/arm64/c/6666336d8fe5

Cheers,
-- 
Will

https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-07-02 12:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-30 22:23 [PATCH] arm64/sysreg: Fix BWE field encoding in ID_AA64DFR2_EL1 Jia He
2026-07-01 14:29 ` Marc Zyngier
2026-07-01 17:09 ` Oliver Upton
2026-07-02 12:58 ` Will Deacon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox