Merge tag 'v9.0.0-rc3'
[qemu/ar7.git] / accel / tcg / tb-jmp-cache.h
blob4ab8553afcc02ff2cc754d1ff545bda9b29830f9
1 /*
2 * The per-CPU TranslationBlock jump cache.
4 * Copyright (c) 2003 Fabrice Bellard
6 * SPDX-License-Identifier: GPL-2.0-or-later
7 */
9 #ifndef ACCEL_TCG_TB_JMP_CACHE_H
10 #define ACCEL_TCG_TB_JMP_CACHE_H
12 #define TB_JMP_CACHE_BITS 12
13 #define TB_JMP_CACHE_SIZE (1 << TB_JMP_CACHE_BITS)
16 * Invalidated in parallel; all accesses to 'tb' must be atomic.
17 * A valid entry is read/written by a single CPU, therefore there is
18 * no need for qatomic_rcu_read() and pc is always consistent with a
19 * non-NULL value of 'tb'. Strictly speaking pc is only needed for
20 * CF_PCREL, but it's used always for simplicity.
22 struct CPUJumpCache {
23 struct rcu_head rcu;
24 struct {
25 TranslationBlock *tb;
26 vaddr pc;
27 } array[TB_JMP_CACHE_SIZE];
30 #endif /* ACCEL_TCG_TB_JMP_CACHE_H */