Skip to content

Commit 0936c97

Browse files
Fix-Pointxiaoxiang781216
authored andcommitted
arch/x86_64: Fix SMP startup for ACRN Hypervisor
This patch fixed SMP startup for ACRN Hypervisor. Signed-off-by: ouyangxiangzhen <[email protected]>
1 parent 9189800 commit 0936c97

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

arch/x86_64/src/intel64/intel64_cpustart.c

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ static int x86_64_ap_startup(int cpu)
8080

8181
/* Send an INIT IPI to the CPU */
8282

83-
regval = MSR_X2APIC_ICR_INIT | dest;
83+
regval = MSR_X2APIC_ICR_INIT | MSR_X2APIC_ICR_ASSERT
84+
| MSR_X2APIC_ICR_LEVEL | dest;
8485
write_msr(MSR_X2APIC_ICR, regval);
8586

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

9697
/* Wait for AP ready */
9798

98-
up_udelay(300);
99-
SP_DMB();
100-
101-
/* Check CPU ready flag */
102-
103-
if (x86_64_cpu_ready_get(cpu) == false)
99+
do
104100
{
105-
sinfo("failed to startup cpu=%d\n", cpu);
106-
return -EBUSY;
101+
up_udelay(300);
102+
SP_DMB();
103+
sinfo("wait for startup cpu=%d...\n", cpu);
107104
}
105+
while (x86_64_cpu_ready_get(cpu) == false);
108106

109107
return OK;
110108
}

0 commit comments

Comments
 (0)