[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v4 4/9] exec: [tcg] Refactor flush of per-CPU virtua
From: |
Lluís Vilanova |
Subject: |
[Qemu-devel] [PATCH v4 4/9] exec: [tcg] Refactor flush of per-CPU virtual TB cache |
Date: |
Fri, 15 Jan 2016 17:38:14 +0100 |
User-agent: |
StGit/0.17.1-dirty |
The function is reused in later patches.
Signed-off-by: Lluís Vilanova <address@hidden>
---
cputlb.c | 2 +-
include/exec/exec-all.h | 6 ++++++
translate-all.c | 7 ++++++-
3 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/cputlb.c b/cputlb.c
index bf1d50a..74bf989 100644
--- a/cputlb.c
+++ b/cputlb.c
@@ -61,7 +61,7 @@ void tlb_flush(CPUState *cpu, int flush_global)
memset(env->tlb_table, -1, sizeof(env->tlb_table));
memset(env->tlb_v_table, -1, sizeof(env->tlb_v_table));
- memset(cpu->tb_jmp_cache, 0, sizeof(cpu->tb_jmp_cache));
+ tb_flush_jmp_cache_all(cpu);
env->vtlb_index = 0;
env->tlb_flush_addr = -1;
diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h
index d900b0d..0859873 100644
--- a/include/exec/exec-all.h
+++ b/include/exec/exec-all.h
@@ -238,6 +238,12 @@ struct TBContext {
};
void tb_free(TranslationBlock *tb);
+/**
+ * tb_flush_jmp_cache_all:
+ *
+ * Flush the virtual translation block cache.
+ */
+void tb_flush_jmp_cache_all(CPUState *env);
void tb_flush(CPUState *cpu);
void tb_phys_invalidate(TranslationBlock *tb, tb_page_addr_t page_addr);
diff --git a/translate-all.c b/translate-all.c
index 042a857..56899ee 100644
--- a/translate-all.c
+++ b/translate-all.c
@@ -846,7 +846,7 @@ void tb_flush(CPUState *cpu)
tcg_ctx.tb_ctx.nb_tbs = 0;
CPU_FOREACH(cpu) {
- memset(cpu->tb_jmp_cache, 0, sizeof(cpu->tb_jmp_cache));
+ tb_flush_jmp_cache_all(cpu);
}
memset(tcg_ctx.tb_ctx.tb_phys_hash, 0,
sizeof(tcg_ctx.tb_ctx.tb_phys_hash));
@@ -1586,6 +1586,11 @@ void tb_check_watchpoint(CPUState *cpu)
}
}
+void tb_flush_jmp_cache_all(CPUState *cpu)
+{
+ memset(cpu->tb_jmp_cache, 0, sizeof(cpu->tb_jmp_cache));
+}
+
#ifndef CONFIG_USER_ONLY
/* in deterministic execution mode, instructions doing device I/Os
must be at the end of the TB */
- [Qemu-devel] [PATCH v4 0/9] trace: Per-vCPU tracing states, Lluís Vilanova, 2016/01/15
- [Qemu-devel] [PATCH v4 2/9] trace: Add 'vcpu' event property, Lluís Vilanova, 2016/01/15
- [Qemu-devel] [PATCH v4 3/9] trace: [tcg] Identify events with the 'vcpu' property, Lluís Vilanova, 2016/01/15
- [Qemu-devel] [PATCH v4 4/9] exec: [tcg] Refactor flush of per-CPU virtual TB cache,
Lluís Vilanova <=
- [Qemu-devel] [PATCH v4 5/9] exec: [tcg] Use multiple physical TB caches, Lluís Vilanova, 2016/01/15
- [Qemu-devel] [PATCH v4 7/9] disas: Remove unused macro '_', Lluís Vilanova, 2016/01/15
- [Qemu-devel] [PATCH v4 9/9] trace: [tcg] Generate TCG code to trace guest events on a per-vCPU basis, Lluís Vilanova, 2016/01/15
- [Qemu-devel] [PATCH v4 8/9] trace: [tcg] Add per-vCPU tracing states for events with the 'vcpu' property, Lluís Vilanova, 2016/01/15
- [Qemu-devel] [PATCH v4 1/9] trace: Add support for vCPU pointers in trace events, Lluís Vilanova, 2016/01/15
- [Qemu-devel] [PATCH v4 6/9] exec: [tcg] Track which vCPU is performing translation and execution, Lluís Vilanova, 2016/01/15