From: Nikita Shubin <nikita.shubin@maquefel.me>
To: Atish Patra <atishp@rivosinc.com>
Cc: Albert Ou <aou@eecs.berkeley.edu>,
Yury Norov <yury.norov@gmail.com>,
Nikita Shubin <n.shubin@yadro.com>,
Anup Patel <anup@brainfault.org>,
linux-kernel@vger.kernel.org, linux@yadro.com,
Tsukasa OI <research_trasio@irq.a4lg.com>,
Sunil V L <sunilvl@ventanamicro.com>,
Palmer Dabbelt <palmer@dabbelt.com>,
Jisheng Zhang <jszhang@kernel.org>,
Paul Walmsley <paul.walmsley@sifive.com>,
Guo Ren <guoren@kernel.org>,
linux-riscv@lists.infradead.org, Heiko Stuebner <heiko@sntech.de>
Subject: [PATCH] riscv: fix multi-letter extension compare
Date: Thu, 6 Oct 2022 10:02:56 +0300 [thread overview]
Message-ID: <20221006070257.11632-1-nikita.shubin@maquefel.me> (raw)
From: Nikita Shubin <n.shubin@yadro.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@yadro.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);
--
2.35.1
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
next reply other threads:[~2022-10-06 7:06 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-06 7:02 Nikita Shubin [this message]
2022-10-06 16:10 ` [PATCH] riscv: fix multi-letter extension compare Jessica Clarke
2022-10-07 6:08 ` Nikita Shubin
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=20221006070257.11632-1-nikita.shubin@maquefel.me \
--to=nikita.shubin@maquefel.me \
--cc=anup@brainfault.org \
--cc=aou@eecs.berkeley.edu \
--cc=atishp@rivosinc.com \
--cc=guoren@kernel.org \
--cc=heiko@sntech.de \
--cc=jszhang@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=linux@yadro.com \
--cc=n.shubin@yadro.com \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
--cc=research_trasio@irq.a4lg.com \
--cc=sunilvl@ventanamicro.com \
--cc=yury.norov@gmail.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;
as well as URLs for NNTP newsgroup(s).