Skip to content

Commit 619c600

Browse files
fyin1lijinxia
authored andcommitted
hv: cpu state update should be moved just before halt.
The cpu offline requester monitor the target cpu state to detect whether target cpu is put to offline already. So we should only update the cpu state to offline after all other operations are finished. Signed-off-by: Yin Fengwei <fengwei.yin@intel.com> Reviewed-by: Eddie Dong <Eddie.dong@intel.com> Acked-by: Anthony Xu <anthony.xu@intel.com>
1 parent 621425d commit 619c600

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

hypervisor/arch/x86/cpu.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -750,14 +750,14 @@ void cpu_dead(uint16_t pcpu_id)
750750
return;
751751
}
752752

753-
/* Set state to show CPU is dead */
754-
cpu_set_current_state(pcpu_id, CPU_STATE_DEAD);
755-
756753
/* clean up native stuff */
757754
timer_cleanup();
758755
vmx_off(pcpu_id);
759756
CACHE_FLUSH_INVALIDATE_ALL();
760757

758+
/* Set state to show CPU is dead */
759+
cpu_set_current_state(pcpu_id, CPU_STATE_DEAD);
760+
761761
/* Halt the CPU */
762762
do {
763763
asm volatile ("hlt");

0 commit comments

Comments
 (0)