diff --git a/hypervisor/arch/x86/cpu.c b/hypervisor/arch/x86/cpu.c index 41e11c1fe..ef804463f 100644 --- a/hypervisor/arch/x86/cpu.c +++ b/hypervisor/arch/x86/cpu.c @@ -322,6 +322,10 @@ static void start_pcpu(uint16_t pcpu_id) write_trampoline_stack_sym(pcpu_id); clac(); + /* Using the MFENCE to make sure trampoline code + * has been updated (clflush) into memory beforing start APs. + */ + cpu_memory_barrier(); send_startup_ipi(pcpu_id, startup_paddr); /* Wait until the pcpu with pcpu_id is running and set the active bitmap or