Skip to content

Commit

Permalink
arch/x86_64: Fix SMP startup for ACRN Hypervisor
Browse files Browse the repository at this point in the history
This patch fixed SMP startup for ACRN Hypervisor.

Signed-off-by: ouyangxiangzhen <[email protected]>
  • Loading branch information
Fix-Point authored and xiaoxiang781216 committed Oct 11, 2024
1 parent 9189800 commit 0936c97
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions arch/x86_64/src/intel64/intel64_cpustart.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ static int x86_64_ap_startup(int cpu)

/* Send an INIT IPI to the CPU */

regval = MSR_X2APIC_ICR_INIT | dest;
regval = MSR_X2APIC_ICR_INIT | MSR_X2APIC_ICR_ASSERT
| MSR_X2APIC_ICR_LEVEL | dest;
write_msr(MSR_X2APIC_ICR, regval);

/* Wait for 10 ms */
Expand All @@ -95,16 +96,13 @@ static int x86_64_ap_startup(int cpu)

/* Wait for AP ready */

up_udelay(300);
SP_DMB();

/* Check CPU ready flag */

if (x86_64_cpu_ready_get(cpu) == false)
do
{
sinfo("failed to startup cpu=%d\n", cpu);
return -EBUSY;
up_udelay(300);
SP_DMB();
sinfo("wait for startup cpu=%d...\n", cpu);
}
while (x86_64_cpu_ready_get(cpu) == false);

return OK;
}
Expand Down

0 comments on commit 0936c97

Please sign in to comment.