RISC-V: Show CPU ID and Hart ID separately in /proc/cpuinfo
authorAnup Patel <anup@brainfault.org>
Tue, 2 Oct 2018 19:15:06 +0000 (12:15 -0700)
committerPalmer Dabbelt <palmer@sifive.com>
Tue, 23 Oct 2018 00:03:37 +0000 (17:03 -0700)
commit4b26d22fdff1e39647cc5952b01d329e83dedfe1
tree83fa6fc257ee0249ca954b35600cc468c0e5d79c
parentf99fb607fb2bc0d4ce6b9adb764c65e37f40a92b
RISC-V: Show CPU ID and Hart ID separately in /proc/cpuinfo

Currently, /proc/cpuinfo show logical CPU ID as Hart ID which
is in-correct. This patch shows CPU ID and Hart ID separately
in /proc/cpuinfo using cpuid_to_hardid_map().

With this patch, contents of /proc/cpuinfo looks as follows:
processor : 0
hart : 1
isa : rv64imafdc
mmu : sv48

processor : 1
hart : 0
isa : rv64imafdc
mmu : sv48

processor : 2
hart : 2
isa : rv64imafdc
mmu : sv48

processor : 3
hart : 3
isa : rv64imafdc
mmu : sv48

Signed-off-by: Anup Patel <anup@brainfault.org>
Signed-off-by: Atish Patra <atish.patra@wdc.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
arch/riscv/kernel/cpu.c