From: Will Deacon <will@kernel.org>
To: Mark Brown <broonie@kernel.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>,
Suzuki K Poulose <suzuki.poulose@arm.com>,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/3] arm64/cpufeature: Use helper macro to specify ID register for capabilites
Date: Wed, 12 Apr 2023 10:04:48 +0100 [thread overview]
Message-ID: <20230412090447.GA24799@willie-the-truck> (raw)
In-Reply-To: <20230303-arm64-cpufeature-helpers-v1-3-b16cf36acaea@kernel.org>
On Mon, Mar 06, 2023 at 10:20:25PM +0000, Mark Brown wrote:
> When defining which value to look for in a system register field we
> currently manually specify the register, field shift, width and sign and
> the value to look for. This opens the potential for error with for example
> the wrong field width or sign being specified, an enumeration value for
> a different similarly named field or letting something be initialised to 0.
>
> Since we now generate defines for all the ID registers we now have named
> constants for all of these things generated from the system register
> description, meaning that we can generate initialisation for all the fields
> used in matching from a minimal specification of register, field and match
> value. This is both shorter and eliminates or makes build failures several
> potential errors.
>
> No change in the generated binary.
>
> Signed-off-by: Mark Brown <broonie@kernel.org>
> ---
> arch/arm64/kernel/cpufeature.c | 245 ++++++++---------------------------------
> 1 file changed, 44 insertions(+), 201 deletions(-)
[...]
> .desc = "WFx with timeout",
> .capability = ARM64_HAS_WFXT,
> .type = ARM64_CPUCAP_SYSTEM_FEATURE,
> - .sys_reg = SYS_ID_AA64ISAR2_EL1,
> - .sign = FTR_UNSIGNED,
> - .field_pos = ID_AA64ISAR2_EL1_WFxT_SHIFT,
> - .field_width = 4,
> - .matches = has_cpuid_feature,
> - .min_field_value = ID_AA64ISAR2_EL1_WFxT_IMP,
> + ARM64_CPUID_FIELDS(ID_AA64ISAR2_EL1, WFxT, IMP)
You drop the '.matches' field here.
Will
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
prev parent reply other threads:[~2023-04-12 9:05 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-06 22:20 [PATCH 0/3] arm64/cpufeature: Use macros for ID based matches Mark Brown
2023-03-06 22:20 ` [PATCH 1/3] arm64/cpufeature: Pull out helper for CPUID register definitions Mark Brown
2023-03-06 22:20 ` [PATCH 2/3] arm64/cpufeature: Consistently use symbolic constants for min_field_value Mark Brown
2023-03-06 22:20 ` [PATCH 3/3] arm64/cpufeature: Use helper macro to specify ID register for capabilites Mark Brown
2023-04-12 9:04 ` Will Deacon [this message]
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=20230412090447.GA24799@willie-the-truck \
--to=will@kernel.org \
--cc=broonie@kernel.org \
--cc=catalin.marinas@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=suzuki.poulose@arm.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