diff mbox

[v1,10/22] exec: On AS changes, only flush affected CPU TLBs

Message ID 1387181170-23267-11-git-send-email-edgar.iglesias@gmail.com
State New
Headers show

Commit Message

Edgar E. Iglesias Dec. 16, 2013, 8:05 a.m. UTC
From: "Edgar E. Iglesias" <edgar.iglesias@xilinx.com>

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
---
 exec.c |    5 +++++
 1 file changed, 5 insertions(+)

Comments

Andreas Färber Dec. 16, 2013, 12:54 p.m. UTC | #1
Am 16.12.2013 09:05, schrieb edgar.iglesias@gmail.com:
> From: "Edgar E. Iglesias" <edgar.iglesias@xilinx.com>
> 
> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
> ---
>  exec.c |    5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/exec.c b/exec.c
> index edb6a43..203c8e4 100644
> --- a/exec.c
> +++ b/exec.c
> @@ -1810,6 +1810,11 @@ static void tcg_commit(MemoryListener *listener)
>         reset the modified entries */
>      /* XXX: slow ! */
>      CPU_FOREACH(cpu) {
> +        /* FIXME: Disentangle the cpu.h circular files deps so we can
> +           directly get the right CPU from listener.  */

Was this circular dependency explained somewhere?

> +        if (cpu->tcg_as_listener != listener) {
> +            continue;
> +        }

If this is to be committed (rather than fixed in a v2), please move to
below variables as usual.

Regards,
Andreas

>          CPUArchState *env = cpu->env_ptr;
>  
>          tlb_flush(env, 1);
Edgar E. Iglesias Dec. 17, 2013, 12:57 a.m. UTC | #2
On Mon, Dec 16, 2013 at 01:54:11PM +0100, Andreas Färber wrote:
> Am 16.12.2013 09:05, schrieb edgar.iglesias@gmail.com:
> > From: "Edgar E. Iglesias" <edgar.iglesias@xilinx.com>
> > 
> > Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
> > ---
> >  exec.c |    5 +++++
> >  1 file changed, 5 insertions(+)
> > 
> > diff --git a/exec.c b/exec.c
> > index edb6a43..203c8e4 100644
> > --- a/exec.c
> > +++ b/exec.c
> > @@ -1810,6 +1810,11 @@ static void tcg_commit(MemoryListener *listener)
> >         reset the modified entries */
> >      /* XXX: slow ! */
> >      CPU_FOREACH(cpu) {
> > +        /* FIXME: Disentangle the cpu.h circular files deps so we can
> > +           directly get the right CPU from listener.  */
> 
> Was this circular dependency explained somewhere?

Not really, I dont remember the exact details of which files it involves
but basically MemoryListeners storage size is not known at the time
CPUState is declared. I've got a patch that fixes it but it involves
changing lots of files so I opted to leave it out if the first round
as this patch already is fairly intrusive...

Ill post that change later as a follow-up.


> 
> > +        if (cpu->tcg_as_listener != listener) {
> > +            continue;
> > +        }
> 
> If this is to be committed (rather than fixed in a v2), please move to
> below variables as usual.


Fixed, thanks.


> 
> Regards,
> Andreas
> 
> >          CPUArchState *env = cpu->env_ptr;
> >  
> >          tlb_flush(env, 1);
> 
> -- 
> SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
> GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
diff mbox

Patch

diff --git a/exec.c b/exec.c
index edb6a43..203c8e4 100644
--- a/exec.c
+++ b/exec.c
@@ -1810,6 +1810,11 @@  static void tcg_commit(MemoryListener *listener)
        reset the modified entries */
     /* XXX: slow ! */
     CPU_FOREACH(cpu) {
+        /* FIXME: Disentangle the cpu.h circular files deps so we can
+           directly get the right CPU from listener.  */
+        if (cpu->tcg_as_listener != listener) {
+            continue;
+        }
         CPUArchState *env = cpu->env_ptr;
 
         tlb_flush(env, 1);