[PATCH 2/2] meson: Warn when TCI is selected but TCG backend is available

Philippe Mathieu-Daudé posted 2 patches 4 years, 10 months ago
There is a newer version of this series
[PATCH 2/2] meson: Warn when TCI is selected but TCG backend is available
Posted by Philippe Mathieu-Daudé 4 years, 10 months ago
Some new users get confused with 'TCG' and 'TCI', and enable TCI
support expecting to enable TCG.

Emit a warning when native TCG backend is available on the
host architecture, mentioning this is a suboptimal configuration.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 meson.build | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/meson.build b/meson.build
index 0a645e54662..7aa52d306c6 100644
--- a/meson.build
+++ b/meson.build
@@ -234,6 +234,9 @@
       error('Unsupported CPU @0@, try --enable-tcg-interpreter'.format(cpu))
     endif
   endif
+  if 'CONFIG_TCG_INTERPRETER' in config_host and cpu in supported_cpus
+    warning('Experimental TCI requested while native TCG is available on @0@, suboptimal performance expected'.format(cpu))
+  endif
   accelerators += 'CONFIG_TCG'
   config_host += { 'CONFIG_TCG': 'y' }
 endif
-- 
2.26.2

Re: [PATCH 2/2] meson: Warn when TCI is selected but TCG backend is available
Posted by Thomas Huth 4 years, 10 months ago
On 22/01/2021 10.22, Philippe Mathieu-Daudé wrote:
> Some new users get confused with 'TCG' and 'TCI', and enable TCI
> support expecting to enable TCG.
> 
> Emit a warning when native TCG backend is available on the
> host architecture, mentioning this is a suboptimal configuration.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
>   meson.build | 3 +++
>   1 file changed, 3 insertions(+)
> 
> diff --git a/meson.build b/meson.build
> index 0a645e54662..7aa52d306c6 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -234,6 +234,9 @@
>         error('Unsupported CPU @0@, try --enable-tcg-interpreter'.format(cpu))
>       endif
>     endif
> +  if 'CONFIG_TCG_INTERPRETER' in config_host and cpu in supported_cpus
> +    warning('Experimental TCI requested while native TCG is available on @0@, suboptimal performance expected'.format(cpu))
> +  endif
>     accelerators += 'CONFIG_TCG'
>     config_host += { 'CONFIG_TCG': 'y' }
>   endif
> 

Reviewed-by: Thomas Huth <thuth@redhat.com>

... maybe you could also add some wording to the help text of the configure 
script? Or maybe we could simply rename the "--enable-tcg-interpreter" 
option into "--enable-tci" to avoid confusion with the normal TCG ?



Re: [PATCH 2/2] meson: Warn when TCI is selected but TCG backend is available
Posted by Philippe Mathieu-Daudé 4 years, 10 months ago
On Fri, Jan 22, 2021 at 10:43 AM Thomas Huth <thuth@redhat.com> wrote:
> On 22/01/2021 10.22, Philippe Mathieu-Daudé wrote:
> > Some new users get confused with 'TCG' and 'TCI', and enable TCI
> > support expecting to enable TCG.
> >
> > Emit a warning when native TCG backend is available on the
> > host architecture, mentioning this is a suboptimal configuration.
> >
> > Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> > ---
> >   meson.build | 3 +++
> >   1 file changed, 3 insertions(+)
> >
> > diff --git a/meson.build b/meson.build
> > index 0a645e54662..7aa52d306c6 100644
> > --- a/meson.build
> > +++ b/meson.build
> > @@ -234,6 +234,9 @@
> >         error('Unsupported CPU @0@, try --enable-tcg-interpreter'.format(cpu))
> >       endif
> >     endif
> > +  if 'CONFIG_TCG_INTERPRETER' in config_host and cpu in supported_cpus
> > +    warning('Experimental TCI requested while native TCG is available on @0@, suboptimal performance expected'.format(cpu))
> > +  endif
> >     accelerators += 'CONFIG_TCG'
> >     config_host += { 'CONFIG_TCG': 'y' }
> >   endif
> >
>
> Reviewed-by: Thomas Huth <thuth@redhat.com>
>
> ... maybe you could also add some wording to the help text of the configure
> script? Or maybe we could simply rename the "--enable-tcg-interpreter"
> option into "--enable-tci" to avoid confusion with the normal TCG ?

I also thought about renaming as --enable-experimental-tci but then doubt that
would help, some users just want to enable everything :)


Re: [PATCH 2/2] meson: Warn when TCI is selected but TCG backend is available
Posted by Thomas Huth 4 years, 10 months ago
On 22/01/2021 10.46, Philippe Mathieu-Daudé wrote:
> On Fri, Jan 22, 2021 at 10:43 AM Thomas Huth <thuth@redhat.com> wrote:
>> On 22/01/2021 10.22, Philippe Mathieu-Daudé wrote:
>>> Some new users get confused with 'TCG' and 'TCI', and enable TCI
>>> support expecting to enable TCG.
>>>
>>> Emit a warning when native TCG backend is available on the
>>> host architecture, mentioning this is a suboptimal configuration.
>>>
>>> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
>>> ---
>>>    meson.build | 3 +++
>>>    1 file changed, 3 insertions(+)
>>>
>>> diff --git a/meson.build b/meson.build
>>> index 0a645e54662..7aa52d306c6 100644
>>> --- a/meson.build
>>> +++ b/meson.build
>>> @@ -234,6 +234,9 @@
>>>          error('Unsupported CPU @0@, try --enable-tcg-interpreter'.format(cpu))
>>>        endif
>>>      endif
>>> +  if 'CONFIG_TCG_INTERPRETER' in config_host and cpu in supported_cpus
>>> +    warning('Experimental TCI requested while native TCG is available on @0@, suboptimal performance expected'.format(cpu))
>>> +  endif
>>>      accelerators += 'CONFIG_TCG'
>>>      config_host += { 'CONFIG_TCG': 'y' }
>>>    endif
>>>
>>
>> Reviewed-by: Thomas Huth <thuth@redhat.com>
>>
>> ... maybe you could also add some wording to the help text of the configure
>> script? Or maybe we could simply rename the "--enable-tcg-interpreter"
>> option into "--enable-tci" to avoid confusion with the normal TCG ?
> 
> I also thought about renaming as --enable-experimental-tci but then doubt that
> would help, some users just want to enable everything :)

Then we should rename it into --disable-native-tcg ;-)

  Thomas


Re: [PATCH 2/2] meson: Warn when TCI is selected but TCG backend is available
Posted by Stefan Weil 4 years, 10 months ago
Am 22.01.21 um 10:47 schrieb Thomas Huth:

> On 22/01/2021 10.46, Philippe Mathieu-Daudé wrote:
>> On Fri, Jan 22, 2021 at 10:43 AM Thomas Huth <thuth@redhat.com> wrote:
>>> On 22/01/2021 10.22, Philippe Mathieu-Daudé wrote:
>>>> Some new users get confused with 'TCG' and 'TCI', and enable TCI
>>>> support expecting to enable TCG.
>>>>
>>>> Emit a warning when native TCG backend is available on the
>>>> host architecture, mentioning this is a suboptimal configuration.
>>>>
>>>> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
>>>> ---
>>>>    meson.build | 3 +++
>>>>    1 file changed, 3 insertions(+)
>>>>
>>>> diff --git a/meson.build b/meson.build
>>>> index 0a645e54662..7aa52d306c6 100644
>>>> --- a/meson.build
>>>> +++ b/meson.build
>>>> @@ -234,6 +234,9 @@
>>>>          error('Unsupported CPU @0@, try 
>>>> --enable-tcg-interpreter'.format(cpu))
>>>>        endif
>>>>      endif
>>>> +  if 'CONFIG_TCG_INTERPRETER' in config_host and cpu in 
>>>> supported_cpus
>>>> +    warning('Experimental TCI requested while native TCG is 
>>>> available on @0@, suboptimal performance expected'.format(cpu))
>>>> +  endif
>>>>      accelerators += 'CONFIG_TCG'
>>>>      config_host += { 'CONFIG_TCG': 'y' }
>>>>    endif
>>>>
>>>
>>> Reviewed-by: Thomas Huth <thuth@redhat.com>
>>>
>>> ... maybe you could also add some wording to the help text of the 
>>> configure
>>> script? Or maybe we could simply rename the "--enable-tcg-interpreter"
>>> option into "--enable-tci" to avoid confusion with the normal TCG ?
>>
>> I also thought about renaming as --enable-experimental-tci but then 
>> doubt that
>> would help, some users just want to enable everything :)
>
> Then we should rename it into --disable-native-tcg ;-)
>
>  Thomas
>

Both patches are fine (also optionally with the suggested addition of 
"slow"), so

Reviewed-by: Stefan Weil <sw@weilnetz.de>

I think that --enable-tci would increase the TCI/TCG confusion and 
suggest to keep the current --enable-tcg-interpreter as most experts 
know that an interpreter is usually something which is slow.

As soon as time permits I also plan to make a new effort to integrate 
TCI as a run time option. Some years ago it was not possible to have 
code which supports both native and interpreted TCG, but this might have 
changed now. If it is possible, this would simplify CI a lot, and users 
could select the interpreter via a command line argument.

Stefan