4

the booting of secondary 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 variable'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.

Pankaj Gupta
  • 309
  • 2
  • 10
  • 1
    It depends entirely on the platform - on some, it might take quite an involved sequence of hardware pokes to power a secondary core up and release it from reset; on others, secondaries may already be sat in WFI in a firmware holding pen just waiting for a release address. You're going to have to narrow it down. – Notlikethat Jan 20 '15 at 14:03
  • @Notlikethat We are using ARM, I have already traced the case when the secondaries set on the WFI instruction, in this case releasing pen from the primary core will work.. but I want to understand the flow when secondaries are powered down, and we are giving some instruction from primary to power on the secondary... from which API or instruction we do the waking thing from primary cpu. – Pankaj Gupta Jan 20 '15 at 14:10
  • 2
    To rephrase; the power controller, firmware, and anything else involved is specific to the _system_ and has nothing to do with the CPU - "ARM" is more or less irrelevant. I.e. a Samsung ARM chip is different to an Allwinner ARM chip; A Samsung Exynos 5 is different to an Samsung Exynos 4; An Exynos 5422 is not necessarily the same as an Exynos 5420; One Exynos 5422-based board might have a different firmware API to another Exynos 5422-based board. _There is no general answer_ - if you want details for the exact system you're using, then you need to provide the necessary information. – Notlikethat Jan 20 '15 at 14:51

1 Answers1

0

On Linux v4.19 + QEMU 3.0.0 aarch64, I have step debugged the Linux kernel until the PSCI CPU_ON call that wakes up the secondary kernel with an hvc instruction as explained at: ARM: Start/Wakeup/Bringup the other CPU cores/APs and pass execution start address?

Ciro Santilli
  • 2,603
  • 1
  • 8
  • 31