When we start kernel on a SMP system, CPU0 starts kernel code where in main memory, cache and MMU specific to CPU0 is nitialized while CPUx are in WFI state. When cpu_up(x) is sent from CPU0, each of CPUx is then initialized and calls secondary_startup where again the main memory, cache and MMU specific to CPUx is initialized.
Now I know abut cache which can be different for different core but do we have main memory and MMU for different core too? I have never heard of it. What exactly happens here and how do the division of main memory and MMU happen between CPUs?
In an SMP system (or a NUMA system like today's x86 CPUs), all memory is accessible to all CPUs. So CPU0 can initialize all the memory.
There's still room for CPU specific initialization: