summary refs log tree commit diff stats
path: root/include/exec
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2018-10-23 03:57:11 +0100
committerRichard Henderson <richard.henderson@linaro.org>2018-10-31 12:15:28 +0000
commit53d284554cfb476a43807fe94fa59909ed5d9ff8 (patch)
tree685565b3fa7436adc95bf5b763d43f4fb4dab271 /include/exec
parenta2e002ff7913ce93aa0f7dbedd2123dce5f1a9cd (diff)
downloadfocaccia-qemu-53d284554cfb476a43807fe94fa59909ed5d9ff8.tar.gz
focaccia-qemu-53d284554cfb476a43807fe94fa59909ed5d9ff8.zip
cputlb: Move tlb_lock to CPUTLBCommon
This is the first of several moves to reduce the size of the
CPU_COMMON_TLB macro and improve some locality of refernce.

Tested-by: Emilio G. Cota <cota@braap.org>
Reviewed-by: Emilio G. Cota <cota@braap.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'include/exec')
-rw-r--r--include/exec/cpu-defs.h17
1 files changed, 14 insertions, 3 deletions
diff --git a/include/exec/cpu-defs.h b/include/exec/cpu-defs.h
index 4ff62f32bf..9005923b4d 100644
--- a/include/exec/cpu-defs.h
+++ b/include/exec/cpu-defs.h
@@ -141,10 +141,21 @@ typedef struct CPUIOTLBEntry {
     MemTxAttrs attrs;
 } CPUIOTLBEntry;
 
+/*
+ * Data elements that are shared between all MMU modes.
+ */
+typedef struct CPUTLBCommon {
+    /* lock serializes updates to tlb_table and tlb_v_table */
+    QemuSpin lock;
+} CPUTLBCommon;
+
+/*
+ * The meaning of each of the MMU modes is defined in the target code.
+ * Note that NB_MMU_MODES is not yet defined; we can only reference it
+ * within preprocessor defines that will be expanded later.
+ */
 #define CPU_COMMON_TLB \
-    /* The meaning of the MMU modes is defined in the target code. */   \
-    /* tlb_lock serializes updates to tlb_table and tlb_v_table */      \
-    QemuSpin tlb_lock;                                                  \
+    CPUTLBCommon tlb_c;                                                 \
     CPUTLBEntry tlb_table[NB_MMU_MODES][CPU_TLB_SIZE];                  \
     CPUTLBEntry tlb_v_table[NB_MMU_MODES][CPU_VTLB_SIZE];               \
     CPUIOTLBEntry iotlb[NB_MMU_MODES][CPU_TLB_SIZE];                    \