qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [RFC v3 10/13] Simple TLB flush wrap to use as exit callbac


From: Alvise Rigo
Subject: [Qemu-devel] [RFC v3 10/13] Simple TLB flush wrap to use as exit callback
Date: Fri, 10 Jul 2015 10:23:43 +0200

Add a new way to query a TLB flush request for a given vCPU using the
new callback support.

Suggested-by: Jani Kokkonen <address@hidden>
Suggested-by: Claudio Fontana <address@hidden>
Signed-off-by: Alvise Rigo <address@hidden>
---
 cputlb.c          | 6 ++++++
 include/qom/cpu.h | 1 +
 2 files changed, 7 insertions(+)

diff --git a/cputlb.c b/cputlb.c
index fa38714..9794e6b 100644
--- a/cputlb.c
+++ b/cputlb.c
@@ -85,6 +85,12 @@ static void tlb_flush_async_work(void *opaque)
     g_free(params);
 }
 
+static void cpu_exit_tlb_flush_all_cb(CPUState *cpu, void *opaque)
+{
+    tlb_flush(cpu, 1);
+    cpu->pending_tlb_flush = 0;
+}
+
 void tlb_flush_all(int flush_global)
 {
     CPUState *cpu;
diff --git a/include/qom/cpu.h b/include/qom/cpu.h
index 0ec020b..c5b93c9 100644
--- a/include/qom/cpu.h
+++ b/include/qom/cpu.h
@@ -326,6 +326,7 @@ struct CPUState {
     /* One-shot callbacks for stopping requests. */
     struct CPUExitCBs exit_cbs;
     volatile int pending_rdv;
+    volatile int pending_tlb_flush;
 
     /* In order to avoid passing too many arguments to the MMIO helpers,
      * we store some rarely used information in the CPU context.
-- 
2.4.5




reply via email to

[Prev in Thread] Current Thread [Next in Thread]