diff options
| author | Richard Henderson | 2018-10-20 22:54:46 +0200 |
|---|---|---|
| committer | Richard Henderson | 2018-10-31 13:16:02 +0100 |
| commit | 60a2ad7d86e7379e6669806bedaa6cfdf4f2c2f4 (patch) | |
| tree | 5be474696ef4d3007d8ac189f3d2e6bff66c2735 /include/exec | |
| parent | cputlb: Remove tcg_enabled hack from tlb_flush_nocheck (diff) | |
| download | qemu-60a2ad7d86e7379e6669806bedaa6cfdf4f2c2f4.tar.gz qemu-60a2ad7d86e7379e6669806bedaa6cfdf4f2c2f4.tar.xz qemu-60a2ad7d86e7379e6669806bedaa6cfdf4f2c2f4.zip | |
cputlb: Move cpu->pending_tlb_flush to env->tlb_c.pending_flush
Protect it with the tlb_lock instead of using atomics.
The move puts it in or near the same cacheline as the lock;
using the lock means we don't need a second atomic operation
in order to perform the update. Which makes it cheap to also
update pending_flush in tlb_flush_by_mmuidx_async_work.
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.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/include/exec/cpu-defs.h b/include/exec/cpu-defs.h index 9005923b4d..659c73d2a1 100644 --- a/include/exec/cpu-defs.h +++ b/include/exec/cpu-defs.h @@ -145,8 +145,14 @@ typedef struct CPUIOTLBEntry { * Data elements that are shared between all MMU modes. */ typedef struct CPUTLBCommon { - /* lock serializes updates to tlb_table and tlb_v_table */ + /* Serialize updates to tlb_table and tlb_v_table, and others as noted. */ QemuSpin lock; + /* + * Within pending_flush, for each bit N, there exists an outstanding + * cross-cpu flush for mmu_idx N. Further cross-cpu flushes to that + * mmu_idx may be discarded. Protected by tlb_c.lock. + */ + uint16_t pending_flush; } CPUTLBCommon; /* |
