qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [RFC v3 11/13] Introduce exit_flush_req and tcg_excl_access


From: Alvise Rigo
Subject: [Qemu-devel] [RFC v3 11/13] Introduce exit_flush_req and tcg_excl_access_lock
Date: Fri, 10 Jul 2015 10:23:44 +0200

Introduce two new variables to synchronize the vCPUs during atomic
operations.

- exit_flush_request allows one vCPU to make an exclusive flush request for all
  the running vCPUs
- tcg_excl_access_lock is a mutex that protects all the sensible
  operations concerning atomic instruction emulation. Most of all, the
  mutex is used to protect the env->exclusive_protected_hwaddr (one
  mutex for all vCPUs).

Suggested-by: Jani Kokkonen <address@hidden>
Suggested-by: Claudio Fontana <address@hidden>
Signed-off-by: Alvise Rigo <address@hidden>
---
 cputlb.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/cputlb.c b/cputlb.c
index 9794e6b..66df41a 100644
--- a/cputlb.c
+++ b/cputlb.c
@@ -39,6 +39,10 @@ void qemu_mutex_unlock_iothread(void);
 /* statistics */
 int tlb_flush_count;
 
+/* For atomic instruction handling. */
+volatile int exit_flush_request = 0;
+QemuMutex tcg_excl_access_lock;
+
 /* NOTE:
  * If flush_global is true (the usual case), flush all tlb entries.
  * If flush_global is false, flush (at least) all tlb entries not
-- 
2.4.5




reply via email to

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