aboutsummaryrefslogtreecommitdiff
path: root/include/qom/cpu.h
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2017-01-27 11:25:33 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2017-02-22 14:56:34 +0100
commit1aab16c28a0232d898d6f56f5a56019472296ee7 (patch)
tree26769555a8a10e4e8e7006462b30b633fc1b036b /include/qom/cpu.h
parenta1cf5fac2b929ffa2abd1285401f2535ff8c6fea (diff)
cpu-exec: unify icount_decr and tcg_exit_req
The icount interrupt flag and tcg_exit_req serve almost the same purpose, let's make them completely the same. The former TB_EXIT_REQUESTED and TB_EXIT_ICOUNT_EXPIRED cases are unified, since we can distinguish them from the value of the interrupt flag. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'include/qom/cpu.h')
-rw-r--r--include/qom/cpu.h15
1 files changed, 7 insertions, 8 deletions
diff --git a/include/qom/cpu.h b/include/qom/cpu.h
index f69b2407ea..1bc3ad230a 100644
--- a/include/qom/cpu.h
+++ b/include/qom/cpu.h
@@ -275,11 +275,11 @@ struct qemu_work_item;
* @stopped: Indicates the CPU has been artificially stopped.
* @unplug: Indicates a pending CPU unplug request.
* @crash_occurred: Indicates the OS reported a crash (panic) for this CPU
- * @tcg_exit_req: Set to force TCG to stop executing linked TBs for this
- * CPU and return to its top level loop.
* @singlestep_enabled: Flags for single-stepping.
* @icount_extra: Instructions until next timer event.
- * @icount_decr: Number of cycles left, with interrupt flag in high bit.
+ * @icount_decr: Low 16 bits: number of cycles left, only used in icount mode.
+ * High 16 bits: Set to -1 to force TCG to stop executing linked TBs for this
+ * CPU and return to its top level loop (even in non-icount mode).
* This allows a single read-compare-cbranch-write sequence to test
* for both decrementer underflow and exceptions.
* @can_do_io: Nonzero if memory-mapped IO is safe. Deterministic execution
@@ -381,10 +381,6 @@ struct CPUState {
/* TODO Move common fields from CPUArchState here. */
int cpu_index; /* used by alpha TCG */
uint32_t halted; /* used by alpha, cris, ppc TCG */
- union {
- uint32_t u32;
- icount_decr_u16 u16;
- } icount_decr;
uint32_t can_do_io;
int32_t exception_index; /* used by m68k TCG */
@@ -397,7 +393,10 @@ struct CPUState {
offset from AREG0. Leave this field at the end so as to make the
(absolute value) offset as small as possible. This reduces code
size, especially for hosts without large memory offsets. */
- uint32_t tcg_exit_req;
+ union {
+ uint32_t u32;
+ icount_decr_u16 u16;
+ } icount_decr;
bool hax_vcpu_dirty;
struct hax_vcpu_state *hax_vcpu;