lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <603eb4c7-5570-438c-b747-cdcc67b09ea6@arm.com>
Date: Fri, 27 Jun 2025 10:04:21 +0100
From: Ben Horgan <ben.horgan@....com>
To: Colton Lewis <coltonlewis@...gle.com>, kvm@...r.kernel.org
Cc: Paolo Bonzini <pbonzini@...hat.com>, Jonathan Corbet <corbet@....net>,
 Russell King <linux@...linux.org.uk>,
 Catalin Marinas <catalin.marinas@....com>, Will Deacon <will@...nel.org>,
 Marc Zyngier <maz@...nel.org>, Oliver Upton <oliver.upton@...ux.dev>,
 Mingwei Zhang <mizhang@...gle.com>, Joey Gouly <joey.gouly@....com>,
 Suzuki K Poulose <suzuki.poulose@....com>, Zenghui Yu
 <yuzenghui@...wei.com>, Mark Rutland <mark.rutland@....com>,
 Shuah Khan <shuah@...nel.org>, linux-doc@...r.kernel.org,
 linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
 kvmarm@...ts.linux.dev, linux-perf-users@...r.kernel.org,
 linux-kselftest@...r.kernel.org
Subject: Re: [PATCH v3 02/22] arm64: Generate sign macro for sysreg Enums

Hi Colton,

On 6/26/25 21:04, Colton Lewis wrote:
> There's no reason Enums shouldn't be equivalent to UnsignedEnums and
> explicitly specify they are unsigned. This will avoid the annoyance I
> had with HPMN0.
An Enum can be annotated with the field's sign by updating it to 
UnsignedEnum or SignedEnum. This is explained in [1].

With this change ID_AA64PFR1_EL1.MTE_frac would be marked as unsigned 
when it should really be considered signed.

Enum	43:40	MTE_frac
	0b0000	ASYNC
	0b1111	NI
EndEnum


> 
> Signed-off-by: Colton Lewis <coltonlewis@...gle.com>
> ---
>   arch/arm64/tools/gen-sysreg.awk | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/arch/arm64/tools/gen-sysreg.awk b/arch/arm64/tools/gen-sysreg.awk
> index f2a1732cb1f6..fa21a632d9b7 100755
> --- a/arch/arm64/tools/gen-sysreg.awk
> +++ b/arch/arm64/tools/gen-sysreg.awk
> @@ -308,6 +308,7 @@ $1 == "Enum" && (block_current() == "Sysreg" || block_current() == "SysregFields
>   	parse_bitdef(reg, field, $2)
>   
>   	define_field(reg, field, msb, lsb)
> +	define_field_sign(reg, field, "false")
>   
>   	next
>   }

Thanks,

Ben

[1] 
https://lore.kernel.org/all/20221207-arm64-sysreg-helpers-v4-1-25b6b3fb9d18@kernel.org/


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ