hv: cpu: pcpu_active_bitmap should be set atomically

It's a global parameter and could be set concurrently. So it should be set atomically.

Tracked-On: #1842
Signed-off-by: Li, Fei1 <fei1.li@intel.com>
Reviewed-by: Yin Fenwgei <fengwei.yin@intel.com>
This commit is contained in:
Li, Fei1 2019-07-16 21:35:53 +08:00 committed by ACRN System Integration
parent 1081e1000e
commit b1dd3e26f5

View File

@ -154,7 +154,7 @@ void init_pcpu_pre(uint16_t pcpu_id_args)
} }
} }
bitmap_set_nolock(pcpu_id, &pcpu_active_bitmap); bitmap_set_lock(pcpu_id, &pcpu_active_bitmap);
/* Set state for this CPU to initializing */ /* Set state for this CPU to initializing */
pcpu_set_current_state(pcpu_id, PCPU_STATE_INITIALIZING); pcpu_set_current_state(pcpu_id, PCPU_STATE_INITIALIZING);
@ -387,7 +387,7 @@ void cpu_dead(void)
/* Set state to show CPU is dead */ /* Set state to show CPU is dead */
pcpu_set_current_state(pcpu_id, PCPU_STATE_DEAD); pcpu_set_current_state(pcpu_id, PCPU_STATE_DEAD);
bitmap_clear_nolock(pcpu_id, &pcpu_active_bitmap); bitmap_clear_lock(pcpu_id, &pcpu_active_bitmap);
/* Halt the CPU */ /* Halt the CPU */
do { do {