mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-22 01:07:57 +00:00
hv:add volatile keyword for some variables
pcpu_active_bitmap was read continuously in wait_pcpus_offline(), acrn_vcpu->running was read continuously in pause_vcpu(), add volatile keyword to ensure that such accesses are not optimised away by the complier. Tracked-On: #1842 Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
This commit is contained in:
@@ -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 */
|
||||
|
Reference in New Issue
Block a user