[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87r1majh0j.wl-maz@kernel.org>
Date: Sun, 24 Jan 2021 19:01:48 +0000
From: Marc Zyngier <maz@...nel.org>
To: David Brazdil <dbrazdil@...gle.com>
Cc: linux-arm-kernel@...ts.infradead.org, kvmarm@...ts.cs.columbia.edu,
linux-kernel@...r.kernel.org,
Catalin Marinas <catalin.marinas@....com>,
Will Deacon <will@...nel.org>,
Mark Rutland <mark.rutland@....com>,
Alexandru Elisei <alexandru.elisei@....com>,
Ard Biesheuvel <ardb@...nel.org>,
Jing Zhang <jingzhangos@...gle.com>,
Ajay Patil <pajay@....qualcomm.com>,
Prasad Sodagudi <psodagud@...eaurora.org>,
Srinivas Ramana <sramana@...eaurora.org>,
James Morse <james.morse@....com>,
Julien Thierry <julien.thierry.kdev@...il.com>,
Suzuki K Poulose <suzuki.poulose@....com>,
kernel-team@...roid.com
Subject: Re: [PATCH v4 15/21] arm64: Add an aliasing facility for the idreg override
On Mon, 18 Jan 2021 13:18:39 +0000,
David Brazdil <dbrazdil@...gle.com> wrote:
>
> On Mon, Jan 18, 2021 at 09:45:27AM +0000, Marc Zyngier wrote:
> > In order to map the override of idregs to options that a user
> > can easily understand, let's introduce yet another option
> > array, which maps an option to the corresponding idreg options.
> >
> > Signed-off-by: Marc Zyngier <maz@...nel.org>
> Acked-by: David Brazdil <dbrazdil@...gle.com>
>
> > ---
> > arch/arm64/kernel/idreg-override.c | 20 ++++++++++++++++++++
> > 1 file changed, 20 insertions(+)
> >
> > diff --git a/arch/arm64/kernel/idreg-override.c b/arch/arm64/kernel/idreg-override.c
> > index 75d9845f489b..16bc8b3b93ae 100644
> > --- a/arch/arm64/kernel/idreg-override.c
> > +++ b/arch/arm64/kernel/idreg-override.c
> > @@ -37,6 +37,12 @@ static const struct reg_desc * const regs[] __initdata = {
> > &mmfr1,
> > };
> >
> > +static const struct {
> > + const char * const alias;
> > + const char * const feature;
> > +} aliases[] __initdata = {
> > +};
> > +
> > static int __init find_field(const char *cmdline, const struct reg_desc *reg,
> > int f, u64 *v)
> > {
> > @@ -80,6 +86,18 @@ static void __init match_options(const char *cmdline)
> > }
> > }
> >
> > +static __init void match_aliases(const char *cmdline)
> > +{
> > + int i;
> > +
> > + for (i = 0; i < ARRAY_SIZE(aliases); i++) {
> > + char *str = strstr(cmdline, aliases[i].alias);
> > +
> > + if ((str == cmdline || (str > cmdline && *(str - 1) == ' ')))
>
> nit: Extract to a 'cmdline_contains' helper? Took me a good few seconds to
> parse this in the previous patch. Giving it a name would help, and now it's
> also shared.
Good point. Adopted!
Thanks,
M.
--
Without deviation from the norm, progress is not possible.
Powered by blists - more mailing lists