All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Lluís Vilanova" <vilanova@ac.upc.edu>
To: qemu-devel@nongnu.org
Cc: Stefan Hajnoczi <stefanha@gmail.com>,
	Eduardo Habkost <ehabkost@redhat.com>
Subject: [Qemu-devel] [PATCH v2 04/10] exec: [tcg] Refactor flush of per-CPU virtual TB cache
Date: Tue, 24 Nov 2015 18:09:09 +0100	[thread overview]
Message-ID: <144838494926.3052.17525260268705229312.stgit@localhost> (raw)
In-Reply-To: <144838492534.3052.2948919558518613064.stgit@localhost>

The function is reused in later patches.

Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
---
 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 a940bd2..ca4ea7f 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 */

  parent reply	other threads:[~2015-11-24 17:09 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-24 17:08 [Qemu-devel] [PATCH v2 00/10] trace: Per-vCPU tracing states Lluís Vilanova
2015-11-24 17:08 ` [Qemu-devel] [PATCH v2 01/10] trace: Add support for vCPU pointers in trace events Lluís Vilanova
2015-11-24 17:08 ` [Qemu-devel] [PATCH v2 02/10] trace: Add 'vcpu' event property Lluís Vilanova
2015-11-24 17:09 ` [Qemu-devel] [PATCH v2 03/10] trace: [tcg] Identify events with the 'vcpu' property Lluís Vilanova
2015-11-24 17:54   ` Eric Blake
2015-11-24 17:09 ` Lluís Vilanova [this message]
2015-11-24 17:09 ` [Qemu-devel] [PATCH v2 05/10] exec: [ŧcg] Use multiple physical TB caches Lluís Vilanova
2016-01-07  7:49   ` Stefan Hajnoczi
2016-01-07 17:56     ` Lluís Vilanova
2015-11-24 17:09 ` [Qemu-devel] [PATCH v2 06/10] exec: [tcg] Track which vCPU is performing translation and execution Lluís Vilanova
2015-11-24 17:09 ` [Qemu-devel] [PATCH v2 07/10] [trivial] Track when QEMU has finished initialization Lluís Vilanova
2015-11-24 17:09 ` [Qemu-devel] [PATCH v2 08/10] disas: Remove unused macro '_' Lluís Vilanova
2015-11-24 17:09 ` [Qemu-devel] [PATCH v2 09/10] trace: [tcg] Add per-vCPU tracing states for events with the 'vcpu' property Lluís Vilanova
2015-11-24 17:57   ` Eric Blake
2015-11-24 18:31     ` Lluís Vilanova
2016-01-07  8:03   ` Stefan Hajnoczi
2016-01-07 18:44     ` Lluís Vilanova
2016-01-14 11:22       ` Stefan Hajnoczi
2015-11-24 17:09 ` [Qemu-devel] [PATCH v2 10/10] trace: [tcg] Generate TCG code to trace guest events on a per-vCPU basis Lluís Vilanova
2016-01-07  8:05 ` [Qemu-devel] [PATCH v2 00/10] trace: Per-vCPU tracing states Stefan Hajnoczi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=144838494926.3052.17525260268705229312.stgit@localhost \
    --to=vilanova@ac.upc.edu \
    --cc=ehabkost@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.