diff options
author | Atish Patra <atish.patra@wdc.com> | 2018-10-02 12:15:05 -0700 |
---|---|---|
committer | Palmer Dabbelt <palmer@sifive.com> | 2018-10-22 17:03:37 -0700 |
commit | f99fb607fb2bc0d4ce6b9adb764c65e37f40a92b (patch) | |
tree | 082100e81815f6c2fa5d152821d24351aa16a871 /arch/riscv/kernel/head.S | |
parent | 6825c7a80f1863b975a00042abe140ea24813af2 (diff) | |
download | lwn-f99fb607fb2bc0d4ce6b9adb764c65e37f40a92b.tar.gz lwn-f99fb607fb2bc0d4ce6b9adb764c65e37f40a92b.zip |
RISC-V: Use Linux logical CPU number instead of hartid
Setup the cpu_logical_map during boot. Moreover, every SBI call
and PLIC context are based on the physical hartid. Use the logical
CPU to hartid mapping to pass correct hartid to respective functions.
Signed-off-by: Atish Patra <atish.patra@wdc.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
Diffstat (limited to 'arch/riscv/kernel/head.S')
-rw-r--r-- | arch/riscv/kernel/head.S | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/riscv/kernel/head.S b/arch/riscv/kernel/head.S index c4d2c63f9a29..711190d473d4 100644 --- a/arch/riscv/kernel/head.S +++ b/arch/riscv/kernel/head.S @@ -47,6 +47,8 @@ ENTRY(_start) /* Save hart ID and DTB physical address */ mv s0, a0 mv s1, a1 + la a2, boot_cpu_hartid + REG_S a0, (a2) /* Initialize page tables and relocate to virtual addresses */ la sp, init_thread_union + THREAD_SIZE @@ -55,7 +57,7 @@ ENTRY(_start) /* Restore C environment */ la tp, init_task - sw s0, TASK_TI_CPU(tp) + sw zero, TASK_TI_CPU(tp) la sp, init_thread_union li a0, ASM_THREAD_SIZE |