mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 02:03:56 -06:00
accel/tcg: Move tb_flush_jmp_cache() to cputlb.c
Move and make the function static, as the only users are here in cputlb.c. Suggested-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
parent
d9d699dd7c
commit
0f4abea8ef
3 changed files with 18 additions and 20 deletions
|
@ -25,6 +25,7 @@
|
||||||
#include "exec/address-spaces.h"
|
#include "exec/address-spaces.h"
|
||||||
#include "exec/cpu_ldst.h"
|
#include "exec/cpu_ldst.h"
|
||||||
#include "exec/cputlb.h"
|
#include "exec/cputlb.h"
|
||||||
|
#include "exec/tb-hash.h"
|
||||||
#include "exec/memory-internal.h"
|
#include "exec/memory-internal.h"
|
||||||
#include "exec/ram_addr.h"
|
#include "exec/ram_addr.h"
|
||||||
#include "tcg/tcg.h"
|
#include "tcg/tcg.h"
|
||||||
|
@ -97,6 +98,23 @@ static void tlb_window_reset(CPUTLBDesc *desc, int64_t ns,
|
||||||
desc->window_max_entries = max_entries;
|
desc->window_max_entries = max_entries;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void tb_jmp_cache_clear_page(CPUState *cpu, target_ulong page_addr)
|
||||||
|
{
|
||||||
|
unsigned int i, i0 = tb_jmp_cache_hash_page(page_addr);
|
||||||
|
|
||||||
|
for (i = 0; i < TB_JMP_PAGE_SIZE; i++) {
|
||||||
|
qatomic_set(&cpu->tb_jmp_cache[i0 + i], NULL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void tb_flush_jmp_cache(CPUState *cpu, target_ulong addr)
|
||||||
|
{
|
||||||
|
/* Discard jump cache entries for any tb which might potentially
|
||||||
|
overlap the flushed page. */
|
||||||
|
tb_jmp_cache_clear_page(cpu, addr - TARGET_PAGE_SIZE);
|
||||||
|
tb_jmp_cache_clear_page(cpu, addr);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* tlb_mmu_resize_locked() - perform TLB resize bookkeeping; resize if necessary
|
* tlb_mmu_resize_locked() - perform TLB resize bookkeeping; resize if necessary
|
||||||
* @desc: The CPUTLBDesc portion of the TLB
|
* @desc: The CPUTLBDesc portion of the TLB
|
||||||
|
|
|
@ -2461,23 +2461,6 @@ void cpu_io_recompile(CPUState *cpu, uintptr_t retaddr)
|
||||||
cpu_loop_exit_noexc(cpu);
|
cpu_loop_exit_noexc(cpu);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void tb_jmp_cache_clear_page(CPUState *cpu, target_ulong page_addr)
|
|
||||||
{
|
|
||||||
unsigned int i, i0 = tb_jmp_cache_hash_page(page_addr);
|
|
||||||
|
|
||||||
for (i = 0; i < TB_JMP_PAGE_SIZE; i++) {
|
|
||||||
qatomic_set(&cpu->tb_jmp_cache[i0 + i], NULL);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void tb_flush_jmp_cache(CPUState *cpu, target_ulong addr)
|
|
||||||
{
|
|
||||||
/* Discard jump cache entries for any tb which might potentially
|
|
||||||
overlap the flushed page. */
|
|
||||||
tb_jmp_cache_clear_page(cpu, addr - TARGET_PAGE_SIZE);
|
|
||||||
tb_jmp_cache_clear_page(cpu, addr);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void print_qht_statistics(struct qht_stats hst)
|
static void print_qht_statistics(struct qht_stats hst)
|
||||||
{
|
{
|
||||||
uint32_t hgram_opts;
|
uint32_t hgram_opts;
|
||||||
|
|
|
@ -663,9 +663,6 @@ tb_page_addr_t get_page_addr_code_hostp(CPUArchState *env, target_ulong addr,
|
||||||
void tlb_reset_dirty(CPUState *cpu, ram_addr_t start1, ram_addr_t length);
|
void tlb_reset_dirty(CPUState *cpu, ram_addr_t start1, ram_addr_t length);
|
||||||
void tlb_set_dirty(CPUState *cpu, target_ulong vaddr);
|
void tlb_set_dirty(CPUState *cpu, target_ulong vaddr);
|
||||||
|
|
||||||
/* exec.c */
|
|
||||||
void tb_flush_jmp_cache(CPUState *cpu, target_ulong addr);
|
|
||||||
|
|
||||||
MemoryRegionSection *
|
MemoryRegionSection *
|
||||||
address_space_translate_for_iotlb(CPUState *cpu, int asidx, hwaddr addr,
|
address_space_translate_for_iotlb(CPUState *cpu, int asidx, hwaddr addr,
|
||||||
hwaddr *xlat, hwaddr *plen,
|
hwaddr *xlat, hwaddr *plen,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue