OSDN Git Service

riscv: use hart id instead of cpu id on machine_kexec
authorNick Kossifidis <mick@ics.forth.gr>
Fri, 26 Nov 2021 18:04:10 +0000 (20:04 +0200)
committerPalmer Dabbelt <palmer@rivosinc.com>
Sun, 9 Jan 2022 18:40:00 +0000 (10:40 -0800)
commit0e105f1d0037d677dff3c697d22f9551e6c39af8
treeb23c54e29aaf78cc05ef66173d19c73f66939e70
parenta11c07f032a0e9a562a32ece73af96b0e754c4b3
riscv: use hart id instead of cpu id on machine_kexec

raw_smp_processor_id() doesn't return the hart id as stated in
arch/riscv/include/asm/smp.h, use smp_processor_id() instead
to get the cpu id, and cpuid_to_hartid_map() to pass the hart id
to the next kernel. This fixes kexec on HiFive Unleashed/Unmatched
where cpu ids and hart ids don't match (on qemu-virt they match).

Fixes: fba8a8674f68 ("RISC-V: Add kexec support")
Signed-off-by: Nick Kossifidis <mick@ics.forth.gr>
Cc: stable@vger.kernel.org
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
arch/riscv/kernel/machine_kexec.c