cputlb.c (56e89f76fdf0dc8162e28105055570a83a93b15e) cputlb.c (3c16304af4241f242eeacae646457b9720aa71db)
1/*
2 * Common CPU TLB handling
3 *
4 * Copyright (c) 2003 Fabrice Bellard
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either

--- 226 unchanged lines hidden (view full) ---

235{
236 size_t n_entries = 1 << CPU_TLB_DYN_DEFAULT_BITS;
237
238 tlb_window_reset(desc, now, 0);
239 desc->n_used_entries = 0;
240 fast->mask = (n_entries - 1) << CPU_TLB_ENTRY_BITS;
241 fast->table = g_new(CPUTLBEntry, n_entries);
242 desc->iotlb = g_new(CPUIOTLBEntry, n_entries);
1/*
2 * Common CPU TLB handling
3 *
4 * Copyright (c) 2003 Fabrice Bellard
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either

--- 226 unchanged lines hidden (view full) ---

235{
236 size_t n_entries = 1 << CPU_TLB_DYN_DEFAULT_BITS;
237
238 tlb_window_reset(desc, now, 0);
239 desc->n_used_entries = 0;
240 fast->mask = (n_entries - 1) << CPU_TLB_ENTRY_BITS;
241 fast->table = g_new(CPUTLBEntry, n_entries);
242 desc->iotlb = g_new(CPUIOTLBEntry, n_entries);
243 tlb_mmu_flush_locked(desc, fast);
243}
244
245static inline void tlb_n_used_entries_inc(CPUArchState *env, uintptr_t mmu_idx)
246{
247 env_tlb(env)->d[mmu_idx].n_used_entries++;
248}
249
250static inline void tlb_n_used_entries_dec(CPUArchState *env, uintptr_t mmu_idx)

--- 4 unchanged lines hidden (view full) ---

255void tlb_init(CPUState *cpu)
256{
257 CPUArchState *env = cpu->env_ptr;
258 int64_t now = get_clock_realtime();
259 int i;
260
261 qemu_spin_init(&env_tlb(env)->c.lock);
262
244}
245
246static inline void tlb_n_used_entries_inc(CPUArchState *env, uintptr_t mmu_idx)
247{
248 env_tlb(env)->d[mmu_idx].n_used_entries++;
249}
250
251static inline void tlb_n_used_entries_dec(CPUArchState *env, uintptr_t mmu_idx)

--- 4 unchanged lines hidden (view full) ---

256void tlb_init(CPUState *cpu)
257{
258 CPUArchState *env = cpu->env_ptr;
259 int64_t now = get_clock_realtime();
260 int i;
261
262 qemu_spin_init(&env_tlb(env)->c.lock);
263
263 /* Ensure that cpu_reset performs a full flush. */
264 env_tlb(env)->c.dirty = ALL_MMUIDX_BITS;
264 /* All tlbs are initialized flushed. */
265 env_tlb(env)->c.dirty = 0;
265
266 for (i = 0; i < NB_MMU_MODES; i++) {
267 tlb_mmu_init(&env_tlb(env)->d[i], &env_tlb(env)->f[i], now);
268 }
269}
270
271/* flush_all_helper: run fn across all cpus
272 *

--- 2012 unchanged lines hidden ---
266
267 for (i = 0; i < NB_MMU_MODES; i++) {
268 tlb_mmu_init(&env_tlb(env)->d[i], &env_tlb(env)->f[i], now);
269 }
270}
271
272/* flush_all_helper: run fn across all cpus
273 *

--- 2012 unchanged lines hidden ---