[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] Re: [PATCH 04/21] wrap cache flushing functions into ac
From: |
Glauber Costa |
Subject: |
Re: [Qemu-devel] Re: [PATCH 04/21] wrap cache flushing functions into accel drivers |
Date: |
Wed, 15 Oct 2008 19:02:01 -0200 |
On Wed, Oct 15, 2008 at 6:23 PM, Anthony Liguori <address@hidden> wrote:
> Glauber Costa wrote:
>>
>> From: Glauber Costa <address@hidden>
>>
>> Yet another accel field: cache flushing functions
>> Signed-off-by: Glauber Costa <address@hidden>
>> ---
>> accel.c | 2 ++
>> accel.h | 11 +++++++++++
>> exec.c | 15 +++++++--------
>> kqemu.c | 15 +++++++++------
>> 4 files changed, 29 insertions(+), 14 deletions(-)
>>
>> diff --git a/accel.c b/accel.c
>> index 3a17dc5..6776244 100644
>> --- a/accel.c
>> +++ b/accel.c
>> @@ -14,5 +14,7 @@ int _accel_nop(void)
>> QEMUAccel noaccel = {
>> .cpu_interrupt = accel_nop,
>> .init_env = accel_nop,
>> + .flush_cache = accel_nop,
>> + .flush_page = accel_nop,
>> };
>>
>> diff --git a/accel.h b/accel.h
>> index 0d916dc..935cfef 100644
>> --- a/accel.h
>> +++ b/accel.h
>> @@ -4,6 +4,8 @@
>> typedef struct QEMUAccel {
>> void (*cpu_interrupt)(CPUState *env);
>> void (*init_env)(CPUState *env);
>> + void (*flush_cache)(CPUState *env, int global);
>> + void (*flush_page)(CPUState *env, target_ulong addr);
>> } QEMUAccel;
>>
>> extern QEMUAccel *current_accel;
>> @@ -24,4 +26,13 @@ static inline void accel_init_env(CPUState *env)
>> current_accel->init_env(env);
>> }
>>
>> +static inline void accel_flush_cache(CPUState *env, int global)
>> +{
>> + current_accel->flush_cache(env, global);
>> +}
>> +
>> +static inline void accel_flush_page(CPUState *env, target_ulong addr)
>> +{
>> + current_accel->flush_page(env, addr);
>> +}
>> #endif
>> diff --git a/exec.c b/exec.c
>> index 21253cc..c761f4a 100644
>> --- a/exec.c
>> +++ b/exec.c
>> @@ -1684,10 +1684,10 @@ void tlb_flush(CPUState *env, int flush_global)
>>
>> memset (env->tb_jmp_cache, 0, TB_JMP_CACHE_SIZE * sizeof (void *));
>>
>> -#ifdef USE_KQEMU
>> - if (env->kqemu_enabled) {
>> - kqemu_flush(env, flush_global);
>> - }
>> + accel_flush_cache(env, flush_global);
>> +
>> +#if !defined(CONFIG_SOFTMMU)
>> + munmap((void *)MMAP_AREA_START, MMAP_AREA_END - MMAP_AREA_START);
>>
>
> Where did this come from?? I understand the rather simple conversion of
> kqemu_flush to accel_flush_cache but it's not at all clear where this munmap
> came from.
Ancient versions of the patch. This code was removed and I didn't notice it.
thanks
>
>> #endif
>> tlb_flush_count++;
>> }
>> @@ -1730,10 +1730,9 @@ void tlb_flush_page(CPUState *env, target_ulong
>> addr)
>>
>> tlb_flush_jmp_cache(env, addr);
>>
>> -#ifdef USE_KQEMU
>> - if (env->kqemu_enabled) {
>> - kqemu_flush_page(env, addr);
>> - }
>> + accel_flush_page(env, addr);
>> +#if !defined(CONFIG_SOFTMMU)
>> + if (addr < MMAP_AREA_END)
>>
>
> And what is this if() being added for?
>
>
> Regards,
>
> Anthony Liguori
>
>
>
--
Glauber Costa.
"Free as in Freedom"
http://glommer.net
"The less confident you are, the more serious you have to act."
- [Qemu-devel] [PATCH 05/21] turn info kqemu into generic info accelerator, (continued)
- [Qemu-devel] [PATCH 01/21] split kqemu_init into two, Glauber Costa, 2008/10/15
- [Qemu-devel] [PATCH 02/21] introduce QEMUAccel and fill it with interrupt specific driver, Glauber Costa, 2008/10/15
- [Qemu-devel] [PATCH 04/21] wrap cache flushing functions into accel drivers, Glauber Costa, 2008/10/15
- [Qemu-devel] [PATCH 03/21] init env made accel driver, Glauber Costa, 2008/10/15
- [Qemu-devel] [PATCH 07/21] move kqemu externs to kqemu.h, Glauber Costa, 2008/10/15
- [Qemu-devel] [PATCH 06/21] separate accelerator part of info profiler, Glauber Costa, 2008/10/15
- [Qemu-devel] [PATCH 09/21] set_notdirty goes through accel wrapper, Glauber Costa, 2008/10/15
- [Qemu-devel] [PATCH 08/21] move disabling code to kqemu.c instead of vl.c, Glauber Costa, 2008/10/15
- [Qemu-devel] [PATCH 10/21] wrap modify_page through accel calls, Glauber Costa, 2008/10/15
- [Qemu-devel] [PATCH 11/21] remove kqemu reference from hw/pc.c, Glauber Costa, 2008/10/15
- [Qemu-devel] [PATCH 12/21] build list of available accelerators, Glauber Costa, 2008/10/15