From: Mark Rutland <mark.rutland@arm.com>
To: Mark Brown <broonie@kernel.org>
Cc: linux-arm-kernel@lists.infradead.org
Subject: Re: [boot-wrapper PATCH 2/2] aarch64: Enable use of SME by EL2 and below
Date: Wed, 2 Feb 2022 10:30:52 +0000 [thread overview]
Message-ID: <YfpdXLxEYYvjWy1Q@FVFF77S0Q05N> (raw)
In-Reply-To: <Yfl6g0K7WIa31M7K@sirena.org.uk>
On Tue, Feb 01, 2022 at 06:22:59PM +0000, Mark Brown wrote:
> On Tue, Feb 01, 2022 at 06:16:58PM +0000, Mark Rutland wrote:
> > On Tue, Feb 01, 2022 at 05:21:32PM +0000, broonie@kernel.org wrote:
>
> > > +#define ID_AA64SMFR0_EL1 s3_0_c0_c4_5
> > > +#define ID_AA64SMFR0_EL1_FA64 (1UL << 63)
>
> > For consistency with the other ID fields, I'm going to make this:
>
> > #define ID_AA64SMFR0_EL1_FA64 BIT(63)
>
> > In future I'd like to split the remaining definitions using shifted bits into
> > separate <register>_<field> and <register>_<field>_<value> definitions (or
> > something of that rought shape) so that field boundaries are always explicit,
> > but those can stay as-is for now.
>
> Sure. I was quite confused about the idioms for the use of BIT() in
> this header since it's used for for example both ID registers and SCR
> but things like the various SPSR and CPTR defines use shifts, it'd
> probably be good to just use BIT() throughout.
I generally agree, and sorry that this is a bit of a mess at present!
I'd held off converting everything to BIT() because I had planned to convert
multi-bit fields at the same time with some helper macros that I've dropped for
now to clearly separate the concept of a field of bits from the values that
field may contain.
For example, CURRENTEL_EL2 is (1 << 2), and shouldn't be converted to BIT(2),
because it is a 2-bit value 0b10 in the field bits[3:2].
That said, I'd be happy to convert all the true single-bit fields to BIT() now.
Thanks,
Mark.
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2022-02-02 10:32 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-01 17:21 [boot-wrapper PATCH 1/2] aarch64: Document what we're doing when setting ZCR_EL3.LEN broonie
2022-02-01 17:21 ` [boot-wrapper PATCH 2/2] aarch64: Enable use of SME by EL2 and below broonie
2022-02-01 18:16 ` Mark Rutland
2022-02-01 18:22 ` Mark Brown
2022-02-02 10:30 ` Mark Rutland [this message]
2022-02-04 10:59 ` Mark Rutland
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=YfpdXLxEYYvjWy1Q@FVFF77S0Q05N \
--to=mark.rutland@arm.com \
--cc=broonie@kernel.org \
--cc=linux-arm-kernel@lists.infradead.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