Patchwork exec: avoid tcg_commit when kvm_enabled

login
register
mail settings
Submitter liguang
Date Sept. 3, 2013, 6:59 a.m.
Message ID <1378191564-6842-1-git-send-email-lig.fnst@cn.fujitsu.com>
Download mbox | patch
Permalink /patch/272125/
State New
Headers show

Comments

liguang - Sept. 3, 2013, 6:59 a.m.
Signed-off-by: liguang <lig.fnst@cn.fujitsu.com>
---
 exec.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
Andreas Färber - Sept. 3, 2013, 8:39 a.m.
Am 03.09.2013 08:59, schrieb liguang:
> Signed-off-by: liguang <lig.fnst@cn.fujitsu.com>
> ---
>  exec.c |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
> 
> diff --git a/exec.c b/exec.c
> index 3ca9381..4509daa 100644
> --- a/exec.c
> +++ b/exec.c
> @@ -1824,7 +1824,9 @@ static void memory_map_init(void)
>      address_space_init(&address_space_io, system_io, "I/O");
>  
>      memory_listener_register(&core_memory_listener, &address_space_memory);
> -    memory_listener_register(&tcg_memory_listener, &address_space_memory);
> +    if (!kvm_enabled()) {

if (tcg_enabled())? I'm guessing Xen and QTest don't need it either?

Andreas

> +        memory_listener_register(&tcg_memory_listener, &address_space_memory);
> +    }
>  }
>  
>  MemoryRegion *get_system_memory(void)
liguang - Sept. 4, 2013, 1:07 a.m.
在 2013-09-03二的 10:39 +0200,Andreas Färber写道:
> Am 03.09.2013 08:59, schrieb liguang:
> > Signed-off-by: liguang <lig.fnst@cn.fujitsu.com>
> > ---
> >  exec.c |    4 +++-
> >  1 files changed, 3 insertions(+), 1 deletions(-)
> > 
> > diff --git a/exec.c b/exec.c
> > index 3ca9381..4509daa 100644
> > --- a/exec.c
> > +++ b/exec.c
> > @@ -1824,7 +1824,9 @@ static void memory_map_init(void)
> >      address_space_init(&address_space_io, system_io, "I/O");
> >  
> >      memory_listener_register(&core_memory_listener, &address_space_memory);
> > -    memory_listener_register(&tcg_memory_listener, &address_space_memory);
> > +    if (!kvm_enabled()) {
> 
> if (tcg_enabled())? I'm guessing Xen and QTest don't need it either?
> 

can't assure that currently, 
anybody can help to assure whether Xen & QTest need tcg_commit?

> 
> > +        memory_listener_register(&tcg_memory_listener, &address_space_memory);
> > +    }
> >  }
> >  
> >  MemoryRegion *get_system_memory(void)
>
Paolo Bonzini - Sept. 4, 2013, 6:23 a.m.
Il 04/09/2013 03:07, Li Guang ha scritto:
> 在 2013-09-03二的 10:39 +0200,Andreas Färber写道:
>> Am 03.09.2013 08:59, schrieb liguang:
>>> Signed-off-by: liguang <lig.fnst@cn.fujitsu.com>
>>> ---
>>>  exec.c |    4 +++-
>>>  1 files changed, 3 insertions(+), 1 deletions(-)
>>>
>>> diff --git a/exec.c b/exec.c
>>> index 3ca9381..4509daa 100644
>>> --- a/exec.c
>>> +++ b/exec.c
>>> @@ -1824,7 +1824,9 @@ static void memory_map_init(void)
>>>      address_space_init(&address_space_io, system_io, "I/O");
>>>  
>>>      memory_listener_register(&core_memory_listener, &address_space_memory);
>>> -    memory_listener_register(&tcg_memory_listener, &address_space_memory);
>>> +    if (!kvm_enabled()) {
>>
>> if (tcg_enabled())? I'm guessing Xen and QTest don't need it either?
>>
> 
> can't assure that currently, 
> anybody can help to assure whether Xen & QTest need tcg_commit?

No, they don't.

Paolo

>>
>>> +        memory_listener_register(&tcg_memory_listener, &address_space_memory);
>>> +    }
>>>  }
>>>  
>>>  MemoryRegion *get_system_memory(void)
>>
>
liguang - Sept. 4, 2013, 6:30 a.m.
在 2013-09-04三的 08:23 +0200,Paolo Bonzini写道:
> Il 04/09/2013 03:07, Li Guang ha scritto:
> > 在 2013-09-03二的 10:39 +0200,Andreas Färber写道:
> >> Am 03.09.2013 08:59, schrieb liguang:
> >>> Signed-off-by: liguang <lig.fnst@cn.fujitsu.com>
> >>> ---
> >>>  exec.c |    4 +++-
> >>>  1 files changed, 3 insertions(+), 1 deletions(-)
> >>>
> >>> diff --git a/exec.c b/exec.c
> >>> index 3ca9381..4509daa 100644
> >>> --- a/exec.c
> >>> +++ b/exec.c
> >>> @@ -1824,7 +1824,9 @@ static void memory_map_init(void)
> >>>      address_space_init(&address_space_io, system_io, "I/O");
> >>>  
> >>>      memory_listener_register(&core_memory_listener, &address_space_memory);
> >>> -    memory_listener_register(&tcg_memory_listener, &address_space_memory);
> >>> +    if (!kvm_enabled()) {
> >>
> >> if (tcg_enabled())? I'm guessing Xen and QTest don't need it either?
> >>
> > 
> > can't assure that currently, 
> > anybody can help to assure whether Xen & QTest need tcg_commit?
> 

OK, Thanks!

> 
> >>
> >>> +        memory_listener_register(&tcg_memory_listener, &address_space_memory);
> >>> +    }
> >>>  }
> >>>  
> >>>  MemoryRegion *get_system_memory(void)
> >>
> > 
>

Patch

diff --git a/exec.c b/exec.c
index 3ca9381..4509daa 100644
--- a/exec.c
+++ b/exec.c
@@ -1824,7 +1824,9 @@  static void memory_map_init(void)
     address_space_init(&address_space_io, system_io, "I/O");
 
     memory_listener_register(&core_memory_listener, &address_space_memory);
-    memory_listener_register(&tcg_memory_listener, &address_space_memory);
+    if (!kvm_enabled()) {
+        memory_listener_register(&tcg_memory_listener, &address_space_memory);
+    }
 }
 
 MemoryRegion *get_system_memory(void)