linux-riscv.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Chris Stillson <stillson@rivosinc.com>
To: linux-riscv@lists.infradead.org
Cc: palmer@dabbelt.com
Subject: [PATCH 02/17] riscv: Extending cpufeature.c to detect V-extension
Date: Wed, 21 Sep 2022 09:46:27 -0700	[thread overview]
Message-ID: <CAM2SziXUfXFHtn4GmeR8qeB60TMHMeSH2iEEpki3AWpcRCV=+g@mail.gmail.com> (raw)

Current cpufeature.c doesn't support detecting V-extension, because
"rv64" also contain a 'v' letter and we need to skip it.

Signed-off-by: Guo Ren <ren_guo@c-sky.com>
Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
Reviewed-by: Greentime Hu <greentime.hu@sifive.com>
Signed-off-by: Greentime Hu <greentime.hu@sifive.com>
Reviewed-by: Palmer Dabbelt <palmer@rivosinc.com>
---
 arch/riscv/include/uapi/asm/hwcap.h | 1 +
 arch/riscv/kernel/cpufeature.c      | 1 +
 2 files changed, 2 insertions(+)

diff --git a/arch/riscv/include/uapi/asm/hwcap.h
b/arch/riscv/include/uapi/asm/hwcap.h
index 46dc3f5ee99f..c52bb7bbbabe 100644
--- a/arch/riscv/include/uapi/asm/hwcap.h
+++ b/arch/riscv/include/uapi/asm/hwcap.h
@@ -21,5 +21,6 @@
 #define COMPAT_HWCAP_ISA_F     (1 << ('F' - 'A'))
 #define COMPAT_HWCAP_ISA_D     (1 << ('D' - 'A'))
 #define COMPAT_HWCAP_ISA_C     (1 << ('C' - 'A'))
+#define COMPAT_HWCAP_ISA_V     (1 << ('V' - 'A'))

 #endif /* _UAPI_ASM_RISCV_HWCAP_H */
diff --git a/arch/riscv/kernel/cpufeature.c b/arch/riscv/kernel/cpufeature.c
index 553d755483ed..8d4448c2d4f4 100644
--- a/arch/riscv/kernel/cpufeature.c
+++ b/arch/riscv/kernel/cpufeature.c
@@ -83,6 +83,7 @@ void __init riscv_fill_hwcap(void)
        isa2hwcap['f'] = isa2hwcap['F'] = COMPAT_HWCAP_ISA_F;
        isa2hwcap['d'] = isa2hwcap['D'] = COMPAT_HWCAP_ISA_D;
        isa2hwcap['c'] = isa2hwcap['C'] = COMPAT_HWCAP_ISA_C;
+       isa2hwcap['v'] = isa2hwcap['V'] = COMPAT_HWCAP_ISA_V;

        elf_hwcap = 0;

--
2.25.1

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

             reply	other threads:[~2022-09-21 16:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-21 16:46 Chris Stillson [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-09-21 19:46 [PATCH 00/17] Prctl to enable vector commands, previous vector patches rebased Chris Stillson
2022-09-21 19:46 ` [PATCH 02/17] riscv: Extending cpufeature.c to detect V-extension Chris Stillson
2022-09-21 20:11   ` Conor Dooley
2022-09-21 21:33     ` Conor Dooley

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='CAM2SziXUfXFHtn4GmeR8qeB60TMHMeSH2iEEpki3AWpcRCV=+g@mail.gmail.com' \
    --to=stillson@rivosinc.com \
    --cc=linux-riscv@lists.infradead.org \
    --cc=palmer@dabbelt.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).