[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <E75B9DE8-8943-4F40-8374-2E74C50D7A00@jrtc27.com>
Date: Thu, 6 Oct 2022 17:10:37 +0100
From: Jessica Clarke <jrtc27@...c27.com>
To: Nikita Shubin <nikita.shubin@...uefel.me>
Cc: Atish Patra <atishp@...osinc.com>,
Albert Ou <aou@...s.berkeley.edu>,
Yury Norov <yury.norov@...il.com>,
Nikita Shubin <n.shubin@...ro.com>,
Anup Patel <anup@...infault.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
linux <linux@...ro.com>,
Tsukasa OI <research_trasio@....a4lg.com>,
Sunil V L <sunilvl@...tanamicro.com>,
Palmer Dabbelt <palmer@...belt.com>,
Jisheng Zhang <jszhang@...nel.org>,
Paul Walmsley <paul.walmsley@...ive.com>,
Guo Ren <guoren@...nel.org>, linux-riscv@...ts.infradead.org,
Heiko Stuebner <heiko@...ech.de>
Subject: Re: [PATCH] riscv: fix multi-letter extension compare
On 6 Oct 2022, at 08:02, Nikita Shubin <nikita.shubin@...uefel.me> wrote:
>
> From: Nikita Shubin <n.shubin@...ro.com>
>
> Increment ext pointer to match letters after 'z' character, so it points
> to actual extension name.
>
> Fixes: 4905ec2fb7e6 ("RISC-V: Add sscofpmf extension support")
> Signed-off-by: Nikita Shubin <n.shubin@...ro.com>
> ---
> Hello Atish,
>
> Sorry to blame you, but i double checked this and i don't see a way
> how extensions from device tree could be successfully matched with
> encoded ones without incrementing the ext pointer or prepending
> the encoded extensions with 'z' letter.
>
> I have no idea how this could slip through review - am i missing something ?
> ---
> arch/riscv/kernel/cpufeature.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/arch/riscv/kernel/cpufeature.c b/arch/riscv/kernel/cpufeature.c
> index 3b5583db9d80..031546052dc0 100644
> --- a/arch/riscv/kernel/cpufeature.c
> +++ b/arch/riscv/kernel/cpufeature.c
> @@ -199,6 +199,7 @@ void __init riscv_fill_hwcap(void)
> this_hwcap |= isa2hwcap[(unsigned char)(*ext)];
> set_bit(*ext - 'a', this_isa);
> } else {
> + ext++;
> SET_ISA_EXT_MAP("sscofpmf", RISCV_ISA_EXT_SSCOFPMF);
> SET_ISA_EXT_MAP("svpbmt", RISCV_ISA_EXT_SVPBMT);
> SET_ISA_EXT_MAP("zicbom", RISCV_ISA_EXT_ZICBOM);
This makes no sense. The single-letter prefix that’s part of the actual
extension name is already in the string there, whether s or z. Your
code means (a) you’d have to double up the prefix in the device tree
(which is obviously wrong) (b) you could use s or z interchangeably as
the first character (e.g. you’d make zzicbom and szicbom parsed as
zicbom).
Are you actually seeing a bug? Did you test this at all? This looks
like you misunderstood code and wrote an untested patch for a bug you
thought you saw.
Jess
> --
> 2.35.1
>
>
> _______________________________________________
> linux-riscv mailing list
> linux-riscv@...ts.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-riscv
Powered by blists - more mailing lists