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: <16dcb986-74df-9a78-5cfc-e9f59fbe0997@arm.com>
Date:   Fri, 13 Jan 2023 08:32:47 +0530
From:   Anshuman Khandual <anshuman.khandual@....com>
To:     Mark Rutland <mark.rutland@....com>
Cc:     linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
        Catalin Marinas <catalin.marinas@....com>,
        Will Deacon <will@...nel.org>, Marc Zyngier <maz@...nel.org>,
        Mark Brown <broonie@...nel.org>
Subject: Re: [PATCH V7 2/6] arm64/perf: Add BRBE registers and fields

On 1/12/23 18:54, Mark Rutland wrote:
> Hi Anshuman,
> 
> On Thu, Jan 05, 2023 at 08:40:35AM +0530, Anshuman Khandual wrote:
>> This adds BRBE related register definitions and various other related field
>> macros there in. These will be used subsequently in a BRBE driver which is
>> being added later on.
> 
> I haven't verified the specific values, but this looks good to me aside from
> one minor nit below.
> 
> [...]
> 
>> +# This is just a dummy register declaration to get all common field masks and
>> +# shifts for accessing given BRBINF contents.
>> +Sysreg	BRBINF_EL1	2	1	8	0	0
> 
> We don't need a dummy declaration, as we have 'SysregFields' that can be used
> for this, e.g.
> 
>   SysregFields BRBINFx_EL1
>   ...
>   EndSysregFields
> 
> ... which will avoid accidental usage of the register encoding. Note that I've
> also added an 'x' there in place of the index, which we do for other registers,
> e.g. TTBRx_EL1.
> 
> Could you please update to that?

There is a problem in defining SysregFields (which I did explore earlier as well).
SysregFields unfortunately does not support enums fields. Following build failure
comes up, while trying to convert BRBINFx_EL1 into a SysregFields definition.

Error at 932: unexpected Enum (inside SysregFields)

===============================================================================
diff --git a/arch/arm64/tools/sysreg b/arch/arm64/tools/sysreg
index a7f9054bd84c..519c4f080898 100644
--- a/arch/arm64/tools/sysreg
+++ b/arch/arm64/tools/sysreg
@@ -921,10 +921,7 @@ Enum       3:0     BT
 EndEnum
 EndSysreg
 
-
-# This is just a dummy register declaration to get all common field masks and
-# shifts for accessing given BRBINF contents.
-Sysreg BRBINF_EL1      2       1       8       0       0
+SysregFields BRBINFx_EL1
 Res0   63:47
 Field  46      CCU
 Field  45:32   CC
@@ -967,7 +964,7 @@ Enum        1:0     VALID
        0b10    SOURCE
        0b11    FULL
 EndEnum
-EndSysreg
+EndSysregFields
 
 Sysreg BRBCR_EL1       2       1       9       0       0
 Res0   63:24
===============================================================================

There are three enum fields in BRBINFx_EL1 as listed here.

Enum    13:8            TYPE
Enum    7:6		EL
Enum    1:0     	VALID

However, BRBINF_EL1 can be changed as BRBINFx_EL1, indicating its more generic
nature with a potential to be used for any index value register thereafter.

> 
> With that:
> 
> Acked-by: Mark Rutland <mark.rutland@....com>
> 
> Mark.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ