Commit a2693fe2 authored by Greentime Hu's avatar Greentime Hu Committed by Palmer Dabbelt

RISC-V: Use a local variable instead of smp_processor_id()

Store the smp_processor_id() in a local variable to save some
pointer chasing.
Signed-off-by: default avatarGreentime Hu <greentime.hu@sifive.com>
Signed-off-by: default avatarAtish Patra <atish.patra@wdc.com>
Signed-off-by: default avatarPalmer Dabbelt <palmerdabbelt@google.com>
parent 234e9d7a
...@@ -146,6 +146,7 @@ void __init smp_cpus_done(unsigned int max_cpus) ...@@ -146,6 +146,7 @@ void __init smp_cpus_done(unsigned int max_cpus)
asmlinkage __visible void smp_callin(void) asmlinkage __visible void smp_callin(void)
{ {
struct mm_struct *mm = &init_mm; struct mm_struct *mm = &init_mm;
unsigned int curr_cpuid = smp_processor_id();
if (!IS_ENABLED(CONFIG_RISCV_SBI)) if (!IS_ENABLED(CONFIG_RISCV_SBI))
clint_clear_ipi(cpuid_to_hartid_map(smp_processor_id())); clint_clear_ipi(cpuid_to_hartid_map(smp_processor_id()));
...@@ -155,9 +156,9 @@ asmlinkage __visible void smp_callin(void) ...@@ -155,9 +156,9 @@ asmlinkage __visible void smp_callin(void)
current->active_mm = mm; current->active_mm = mm;
trap_init(); trap_init();
notify_cpu_starting(smp_processor_id()); notify_cpu_starting(curr_cpuid);
update_siblings_masks(smp_processor_id()); update_siblings_masks(curr_cpuid);
set_cpu_online(smp_processor_id(), 1); set_cpu_online(curr_cpuid, 1);
/* /*
* Remote TLB flushes are ignored while the CPU is offline, so emit * Remote TLB flushes are ignored while the CPU is offline, so emit
* a local TLB flush right now just in case. * a local TLB flush right now just in case.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment