diff --git a/hypervisor/arch/x86/cpu.c b/hypervisor/arch/x86/cpu.c index b040388b61..1fd09294fd 100644 --- a/hypervisor/arch/x86/cpu.c +++ b/hypervisor/arch/x86/cpu.c @@ -37,7 +37,7 @@ static uint64_t pcpu_sync = 0UL; static uint64_t startup_paddr = 0UL; /* physical cpu active bitmap, support up to 64 cpus */ -static uint64_t pcpu_active_bitmap = 0UL; +static volatile uint64_t pcpu_active_bitmap = 0UL; static void pcpu_xsave_init(void); static void set_current_pcpu_id(uint16_t pcpu_id); diff --git a/hypervisor/include/arch/x86/guest/vcpu.h b/hypervisor/include/arch/x86/guest/vcpu.h index dc8d6afa85..5394de1a2a 100644 --- a/hypervisor/include/arch/x86/guest/vcpu.h +++ b/hypervisor/include/arch/x86/guest/vcpu.h @@ -360,7 +360,7 @@ struct acrn_vcpu { struct sched_object sched_obj; bool launched; /* Whether the vcpu is launched on target pcpu */ - bool running; /* vcpu is picked up and run? */ + volatile bool running; /* vcpu is picked up and run? */ struct instr_emul_ctxt inst_ctxt; struct io_request req; /* used by io/ept emulation */