OSDN Git Service

RISC-V: Improve /proc/cpuinfo output for ISA extensions
authorAtish Patra <atishp@rivosinc.com>
Mon, 14 Mar 2022 20:38:45 +0000 (13:38 -0700)
committerPalmer Dabbelt <palmer@rivosinc.com>
Thu, 17 Mar 2022 19:18:12 +0000 (12:18 -0700)
commita9b202606c69312cdaa4db187837820ebf7213b2
treefbdf37215b1eb9cc4efae77eaabecb6ae3aa8fa3
parent3f96db125d68127ffef6fdeeb777d94ccf95c09f
RISC-V: Improve /proc/cpuinfo output for ISA extensions

Currently, the /proc/cpuinfo outputs the entire riscv,isa string which
is not ideal when we have multiple ISA extensions present in the ISA
string. Some of them may not be enabled in kernel as well.
Same goes for the single letter extensions as well which prints the
entire ISA string. Some of they may not be valid ISA extensions as
well (e.g 'su')

Parse only the valid & enabled ISA extension and print them.

Tested-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Atish Patra <atishp@rivosinc.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
arch/riscv/include/asm/hwcap.h
arch/riscv/kernel/cpu.c