mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-25 06:51:49 +00:00
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:
parent
1081e1000e
commit
b1dd3e26f5
@ -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 */
|
||||
pcpu_set_current_state(pcpu_id, PCPU_STATE_INITIALIZING);
|
||||
@ -387,7 +387,7 @@ void cpu_dead(void)
|
||||
|
||||
/* Set state to show CPU is 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 */
|
||||
do {
|
||||
|
Loading…
Reference in New Issue
Block a user