This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

by which instruction the secondary core is triggered while starting the secondary cpu

the booting of seconday cpu is initiated by the primary core. and some work is completed on the primary cpu and some is completed on the secondary cpu to complete the hotplug operation for cpu_up.

I am trying to find the exact instruction that is executed on the primary cpu, that triggers the secondary cpu to start, and further it will check the pen_release varaible's value.

Can you please explain the procedure of starting the secondary cpu, and the uses of pen_release global with respect to Linux kernel with SMP enabled.

  • (Disclaimer - I'm not a Linux expert)

    Grepping through the Linux kernel (Linaro Stable 3.14.22), the code seems to be in ./arch/arm64/kernel/smp_spin_table.c  (I'm assuming ARMv8).  Specifically:

    static int smp_spin_table_cpu_boot(unsigned int cpu)
    {
      /*
       * Update the pen release flag.
       */
      write_pen_release(cpu_logical_map(cpu));
    
      /*
       * Send an event, causing the secondaries to read pen_release.
       */
      sev();
    
      return 0;
    }
    
    

    So it looks like the kernel is writing a flag in memory, then using the SEV instruction to wake the other cores.

    The other cores will be in a WFE loop, checking the pen_release variables every time they wake-up.