From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KqDVP-0003OJ-Tn for qemu-devel@nongnu.org; Wed, 15 Oct 2008 17:02:07 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KqDVP-0003O5-Cf for qemu-devel@nongnu.org; Wed, 15 Oct 2008 17:02:07 -0400 Received: from [199.232.76.173] (port=56499 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KqDVP-0003Nj-5A for qemu-devel@nongnu.org; Wed, 15 Oct 2008 17:02:07 -0400 Received: from yx-out-1718.google.com ([74.125.44.155]:27967) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KqDVM-0004iq-0k for qemu-devel@nongnu.org; Wed, 15 Oct 2008 17:02:04 -0400 Received: by yx-out-1718.google.com with SMTP id 3so607654yxi.82 for ; Wed, 15 Oct 2008 14:02:02 -0700 (PDT) Message-ID: <5d6222a80810151402v315b1e0j6963a71f2d39d397@mail.gmail.com> Date: Wed, 15 Oct 2008 19:02:01 -0200 From: "Glauber Costa" Subject: Re: [Qemu-devel] Re: [PATCH 04/21] wrap cache flushing functions into accel drivers In-Reply-To: <48F6514E.8050307@us.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <1224107718-19128-1-git-send-email-glommer@redhat.com> <1224107718-19128-5-git-send-email-glommer@redhat.com> <48F6514E.8050307@us.ibm.com> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: jan.kiszka@siemens.com, Glauber Costa , jes@sgi.com, avi@qumranet.com, Glauber Costa , dmitry.baryshkov@siemens.com On Wed, Oct 15, 2008 at 6:23 PM, Anthony Liguori wrote: > Glauber Costa wrote: >> >> From: Glauber Costa >> >> Yet another accel field: cache flushing functions >> Signed-off-by: Glauber Costa >> --- >> 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."