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>
This commit is contained in:
Yin Fengwei 2018-07-13 17:21:21 +08:00 committed by lijinxia
parent 621425da20
commit 619c600021

View File

@ -750,14 +750,14 @@ void cpu_dead(uint16_t pcpu_id)
return;
}
/* Set state to show CPU is dead */
cpu_set_current_state(pcpu_id, CPU_STATE_DEAD);
/* clean up native stuff */
timer_cleanup();
vmx_off(pcpu_id);
CACHE_FLUSH_INVALIDATE_ALL();
/* Set state to show CPU is dead */
cpu_set_current_state(pcpu_id, CPU_STATE_DEAD);
/* Halt the CPU */
do {
asm volatile ("hlt");