[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 11/45] exec-all: bring tb->invalid into tb->cflag
From: |
Emilio G. Cota |
Subject: |
[Qemu-devel] [PATCH v2 11/45] exec-all: bring tb->invalid into tb->cflags |
Date: |
Sun, 16 Jul 2017 16:03:54 -0400 |
This gets rid of a hole in struct TranslationBlock.
Signed-off-by: Emilio G. Cota <address@hidden>
---
include/exec/exec-all.h | 3 +--
accel/tcg/cpu-exec.c | 2 +-
accel/tcg/translate-all.c | 3 +--
3 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h
index 28e3a24..78a1714 100644
--- a/include/exec/exec-all.h
+++ b/include/exec/exec-all.h
@@ -326,12 +326,11 @@ struct TranslationBlock {
#define CF_NOCACHE 0x10000 /* To be freed after execution */
#define CF_USE_ICOUNT 0x20000
#define CF_IGNORE_ICOUNT 0x40000 /* Do not generate icount code */
+#define CF_INVALID 0x80000 /* Protected by tb_lock */
/* Per-vCPU dynamic tracing state used to generate this TB */
uint32_t trace_vcpu_dstate;
- uint16_t invalid;
-
void *tc_ptr; /* pointer to the translated code */
uint8_t *tc_search; /* pointer to search data */
/* original tb when cflags has CF_NOCACHE */
diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c
index 9b5ce13..34841cd 100644
--- a/accel/tcg/cpu-exec.c
+++ b/accel/tcg/cpu-exec.c
@@ -387,7 +387,7 @@ static inline TranslationBlock *tb_find(CPUState *cpu,
tb_lock();
acquired_tb_lock = true;
}
- if (!tb->invalid) {
+ if (!(tb->cflags & CF_INVALID)) {
tb_add_jump(last_tb, tb_exit, tb);
}
}
diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c
index 6d4c05f..53fbb06 100644
--- a/accel/tcg/translate-all.c
+++ b/accel/tcg/translate-all.c
@@ -1082,7 +1082,7 @@ void tb_phys_invalidate(TranslationBlock *tb,
tb_page_addr_t page_addr)
* Mark the TB as invalid *after* it's been removed from tb_hash, which
* eliminates the need to check this bit on lookups.
*/
- tb->invalid = true;
+ tb->cflags |= CF_INVALID;
/* remove the TB from the page list */
if (tb->page_addr[0] != page_addr) {
@@ -1273,7 +1273,6 @@ TranslationBlock *tb_gen_code(CPUState *cpu,
tb->flags = flags;
tb->cflags = cflags;
tb->trace_vcpu_dstate = *cpu->trace_dstate;
- tb->invalid = false;
#ifdef CONFIG_PROFILER
tcg_ctx.tb_count1++; /* includes aborted translations because of
--
2.7.4
- [Qemu-devel] [PATCH v2 01/45] vl: fix breakage of -tb-size, (continued)
- [Qemu-devel] [PATCH v2 01/45] vl: fix breakage of -tb-size, Emilio G. Cota, 2017/07/16
- [Qemu-devel] [PATCH v2 02/45] translate-all: remove redundant !tcg_enabled check in dump_exec_info, Emilio G. Cota, 2017/07/16
- [Qemu-devel] [PATCH v2 08/45] tcg/i386: constify tcg_target_callee_save_regs, Emilio G. Cota, 2017/07/16
- [Qemu-devel] [PATCH v2 03/45] cputlb: bring back tlb_flush_count under !TLB_DEBUG, Emilio G. Cota, 2017/07/16
- [Qemu-devel] [PATCH v2 04/45] tcg: fix corruption of code_time profiling counter upon tb_flush, Emilio G. Cota, 2017/07/16
- [Qemu-devel] [PATCH v2 06/45] translate-all: make have_tb_lock static, Emilio G. Cota, 2017/07/16
- [Qemu-devel] [PATCH v2 07/45] cpu-exec: rename have_tb_lock to acquired_tb_lock in tb_find, Emilio G. Cota, 2017/07/16
- [Qemu-devel] [PATCH v2 20/45] target/sparc: check CF_PARALLEL instead of parallel_cpus, Emilio G. Cota, 2017/07/16
- [Qemu-devel] [PATCH v2 11/45] exec-all: bring tb->invalid into tb->cflags,
Emilio G. Cota <=
- [Qemu-devel] [PATCH v2 09/45] tcg/mips: constify tcg_target_callee_save_regs, Emilio G. Cota, 2017/07/16
- [Qemu-devel] [PATCH v2 23/45] translate-all: define and use DEBUG_TB_FLUSH_GATE, Emilio G. Cota, 2017/07/16
- [Qemu-devel] [PATCH v2 22/45] cpu-exec: lookup/generate TB outside exclusive region during step_atomic, Emilio G. Cota, 2017/07/16
- [Qemu-devel] [PATCH v2 33/45] tcg: take .helpers out of TCGContext, Emilio G. Cota, 2017/07/16
- [Qemu-devel] [PATCH v2 26/45] translate-all: define and use DEBUG_TB_CHECK_GATE, Emilio G. Cota, 2017/07/16