mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 15:53:54 -06:00
cpus: access .qemu_icount with atomic64
Signed-off-by: Emilio G. Cota <cota@braap.org> Message-Id: <20180910232752.31565-10-cota@braap.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
9b4e6f4966
commit
38adcb6e41
1 changed files with 4 additions and 4 deletions
8
cpus.c
8
cpus.c
|
@ -250,8 +250,8 @@ static void cpu_update_icount_locked(CPUState *cpu)
|
||||||
int64_t executed = cpu_get_icount_executed(cpu);
|
int64_t executed = cpu_get_icount_executed(cpu);
|
||||||
cpu->icount_budget -= executed;
|
cpu->icount_budget -= executed;
|
||||||
|
|
||||||
atomic_set__nocheck(&timers_state.qemu_icount,
|
atomic_set_i64(&timers_state.qemu_icount,
|
||||||
timers_state.qemu_icount + executed);
|
timers_state.qemu_icount + executed);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -280,8 +280,8 @@ static int64_t cpu_get_icount_raw_locked(void)
|
||||||
/* Take into account what has run */
|
/* Take into account what has run */
|
||||||
cpu_update_icount_locked(cpu);
|
cpu_update_icount_locked(cpu);
|
||||||
}
|
}
|
||||||
/* The read is protected by the seqlock, so __nocheck is okay. */
|
/* The read is protected by the seqlock, but needs atomic64 to avoid UB */
|
||||||
return atomic_read__nocheck(&timers_state.qemu_icount);
|
return atomic_read_i64(&timers_state.qemu_icount);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int64_t cpu_get_icount_locked(void)
|
static int64_t cpu_get_icount_locked(void)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue