* [Qemu-devel] [PATCH] Refactor flush of per-CPU virtual TB cache
@ 2010-10-19 19:57 Lluís
2010-10-22 18:53 ` Nathan Froyd
0 siblings, 1 reply; 3+ messages in thread
From: Lluís @ 2010-10-19 19:57 UTC (permalink / raw)
To: qemu-devel
Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
---
exec-all.h | 2 ++
exec.c | 9 +++++++--
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/exec-all.h b/exec-all.h
index 3a53fe6..2ae09c5 100644
--- a/exec-all.h
+++ b/exec-all.h
@@ -182,6 +182,8 @@ static inline unsigned int tb_phys_hash_func(tb_page_addr_t pc)
TranslationBlock *tb_alloc(target_ulong pc);
void tb_free(TranslationBlock *tb);
+/** Flush the per-CPU virtual translation block cache. */
+void tb_flush_jmp_cache(CPUState *env);
void tb_flush(CPUState *env);
void tb_link_page(TranslationBlock *tb,
tb_page_addr_t phys_pc, tb_page_addr_t phys_page2);
diff --git a/exec.c b/exec.c
index 1fbe91c..516960a 100644
--- a/exec.c
+++ b/exec.c
@@ -688,6 +688,11 @@ static void page_flush_tb(void)
}
}
+void tb_flush_jmp_cache (CPUState * env)
+{
+ memset (env->tb_jmp_cache, 0, TB_JMP_CACHE_SIZE * sizeof (void *));
+}
+
/* flush all the translation blocks */
/* XXX: tb_flush is currently not thread safe */
void tb_flush(CPUState *env1)
@@ -705,7 +710,7 @@ void tb_flush(CPUState *env1)
nb_tbs = 0;
for(env = first_cpu; env != NULL; env = env->next_cpu) {
- memset (env->tb_jmp_cache, 0, TB_JMP_CACHE_SIZE * sizeof (void *));
+ tb_flush_jmp_cache(env);
}
memset (tb_phys_hash, 0, CODE_GEN_PHYS_HASH_SIZE * sizeof (void *));
@@ -1941,7 +1946,7 @@ void tlb_flush(CPUState *env, int flush_global)
}
}
- memset (env->tb_jmp_cache, 0, TB_JMP_CACHE_SIZE * sizeof (void *));
+ tb_flush_jmp_cache(env);
env->tlb_flush_addr = -1;
env->tlb_flush_mask = 0;
--
1.7.1
--
"And it's much the same thing with knowledge, for whenever you learn
something new, the whole world becomes that much richer."
-- The Princess of Pure Reason, as told by Norton Juster in The Phantom
Tollbooth
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] Refactor flush of per-CPU virtual TB cache
2010-10-19 19:57 [Qemu-devel] [PATCH] Refactor flush of per-CPU virtual TB cache Lluís
@ 2010-10-22 18:53 ` Nathan Froyd
2010-10-22 19:34 ` Lluís
0 siblings, 1 reply; 3+ messages in thread
From: Nathan Froyd @ 2010-10-22 18:53 UTC (permalink / raw)
To: Lluís; +Cc: qemu-devel
On Tue, Oct 19, 2010 at 09:57:13PM +0200, Lluís wrote:
> --- a/exec.c
> +++ b/exec.c
> @@ -688,6 +688,11 @@ static void page_flush_tb(void)
> }
> }
>
> +void tb_flush_jmp_cache (CPUState * env)
> +{
> + memset (env->tb_jmp_cache, 0, TB_JMP_CACHE_SIZE * sizeof (void *));
> +}
> +
This is only used in this file. Why not make it static?
-Nathan
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] Refactor flush of per-CPU virtual TB cache
2010-10-22 18:53 ` Nathan Froyd
@ 2010-10-22 19:34 ` Lluís
0 siblings, 0 replies; 3+ messages in thread
From: Lluís @ 2010-10-22 19:34 UTC (permalink / raw)
To: qemu-devel
Nathan Froyd writes:
> On Tue, Oct 19, 2010 at 09:57:13PM +0200, Lluís wrote:
>> --- a/exec.c
>> +++ b/exec.c
>> @@ -688,6 +688,11 @@ static void page_flush_tb(void)
>> }
>> }
>>
>> +void tb_flush_jmp_cache (CPUState * env)
>> +{
>> + memset (env->tb_jmp_cache, 0, TB_JMP_CACHE_SIZE * sizeof (void *));
>> +}
>> +
> This is only used in this file. Why not make it static?
I use it later on the instrumentation set of patches. Which reminds me
that I should have defined it as "inline".
Lluis
--
"And it's much the same thing with knowledge, for whenever you learn
something new, the whole world becomes that much richer."
-- The Princess of Pure Reason, as told by Norton Juster in The Phantom
Tollbooth
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-10-22 19:36 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-19 19:57 [Qemu-devel] [PATCH] Refactor flush of per-CPU virtual TB cache Lluís
2010-10-22 18:53 ` Nathan Froyd
2010-10-22 19:34 ` Lluís
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.