hypervisor/arch/x86/init.c
void init_primary_pcpu(void)
{
	uint64_t rsp;

	/* Clear BSS */
	(void)memset(&ld_bss_start, 0U, (size_t)(&ld_bss_end - &ld_bss_start));

	(void)parse_hv_cmdline();

	init_debug_pre();

	init_pcpu_pre(true);

	/* Switch to run-time stack */
	rsp = (uint64_t)(&get_cpu_var(stack)[CONFIG_STACK_SIZE - 1]);
	rsp &= ~(CPU_STACK_ALIGN - 1UL);
	SWITCH_TO(rsp, init_primary_pcpu_post);
}
/* NOTE: this function is using temp stack, and after SWITCH_TO(runtime_sp, to)
 * it will switch to runtime stack.
 */
this function is using temp stack, and after SWITCH_TO(runtime_sp, to)
it will switch to runtime stack.
this function is using temp stack and after SWITCH_TO ( runtime_sp to ) it will switch to runtime stack .
void init_primary_pcpu(void)
{
	uint64_t rsp;
	(void)memset(&ld_bss_start, 0U, (size_t)(&ld_bss_end - &ld_bss_start));
	(void)parse_hv_cmdline();
	init_debug_pre();
	init_pcpu_pre(true);
	rsp = (uint64_t)(&get_cpu_var(stack)[CONFIG_STACK_SIZE - 1]);
	rsp &= ~(CPU_STACK_ALIGN - 1UL);
	SWITCH_TO(rsp, init_primary_pcpu_post);
}
void init_primary_pcpu ( void ) { uint64_t rsp ; ( void ) memset ( & ld_bss_start , 0U , ( size_t ) ( & ld_bss_end - & ld_bss_start ) ) ; ( void ) parse_hv_cmdline ( ) ; init_debug_pre ( ) ; init_pcpu_pre ( true ) ; rsp = ( uint64_t ) ( & get_cpu_var ( stack ) [ CONFIG_STACK_SIZE - 1 ] ) ; rsp &= ~ ( CPU_STACK_ALIGN - 1UL ) ; SWITCH_TO ( rsp , init_primary_pcpu_post ) ; }
NOTE: this function is using temp stack, and after SWITCH_TO(runtime_sp, to)
 it will switch to runtime stack.
NOTE : this function is using temp stack and after SWITCH_TO ( runtime_sp to ) it will switch to runtime stack .
/* Clear BSS */ /* Switch to run-time stack */