From a6c7e68b5d4c2d81c8fd6bb83db7bc6f309cecdd Mon Sep 17 00:00:00 2001 From: Yanfeng Liu Date: Tue, 30 Jul 2024 14:34:46 +0800 Subject: [PATCH] riscv/qemu-rv: skip reloading mhartid As a0 already has mhartid passed by SBI or ZSBL, no need to load it again here. Signed-off-by: Yanfeng Liu --- arch/risc-v/src/qemu-rv/qemu_rv_head.S | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/arch/risc-v/src/qemu-rv/qemu_rv_head.S b/arch/risc-v/src/qemu-rv/qemu_rv_head.S index 979fe43536..6c6531a0ca 100644 --- a/arch/risc-v/src/qemu-rv/qemu_rv_head.S +++ b/arch/risc-v/src/qemu-rv/qemu_rv_head.S @@ -43,11 +43,7 @@ __start: /* Preserve a1 as it contains the pointer to DTB */ - /* Load mhartid (cpuid) */ - -#ifndef CONFIG_ARCH_USE_S_MODE - csrr a0, CSR_MHARTID -#endif + /* Preserve a0 as it has mhartid */ /* Load the number of CPUs that the kernel supports */ li t1, CONFIG_SMP_NCPUS