meson: Try to clarify TCG / TCI options for new users
cover meson: Try to clarify TCG / TCI options for new users
Some new users get confused between 'TCG' and 'TCI' and enable TCI when TCG is better for they needs. Try to clarify it is better to not use TCI when native backend is available.
Note, before Meson, warnings were summarized at the end of ./configure. Now they are displayed earlier, and likely missed IMHO. No clue how to improve that :/
Based-on: <[email protected]>
Philippe Mathieu-Daudé (2):
meson: Explicit TCG backend used
meson: Warn when TCI is selected but TCG backend is available
meson.build | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
Signature · 1 line
2.26.2
PATCH 1/2 meson: Explicit TCG backend used
--- meson.build | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
meson.build +5 -1
@@ -2419,8 +2419,12 @@ endif summary_info += {'TCG support': config_all.has_key('CONFIG_TCG')} if config_all.has_key('CONFIG_TCG') + if config_host.has_key('CONFIG_TCG_INTERPRETER') + summary_info += {'TCG backend': 'TCG interpreter (experimental)'} + else + summary_info += {'TCG backend': 'native (@0@)'.format(cpu)} + endif summary_info += {'TCG debug enabled': config_host.has_key('CONFIG_DEBUG_TCG')} - summary_info += {'TCG interpreter': config_host.has_key('CONFIG_TCG_INTERPRETER')} endif summary_info += {'target list': ' '.join(target_dirs)} if have_system
Signature · 1 line
2.26.2
Re: [PATCH 1/2] meson: Explicit TCG backend used
Quoted 10 lines · Philippe Mathieu-Daudé
Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- meson.build | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)meson.build +0
-0
meson.build line 2423
Quoted 5 lines
meson.build +2
-0@@ -2419,8 +2419,12 @@ endif summary_info += {'TCG support': config_all.has_key('CONFIG_TCG')} if config_all.has_key('CONFIG_TCG') + if config_host.has_key('CONFIG_TCG_INTERPRETER') + summary_info += {'TCG backend': 'TCG interpreter (experimental)'}
maybe say "experimental and slow" in the parentheses?
meson.build line 2430
Quoted 9 lines
meson.build +3
-1+ else + summary_info += {'TCG backend': 'native (@0@)'.format(cpu)} + endif summary_info += {'TCG debug enabled': config_host.has_key('CONFIG_DEBUG_TCG')} - summary_info += {'TCG interpreter': config_host.has_key('CONFIG_TCG_INTERPRETER')} endif summary_info += {'target list': ' '.join(target_dirs)} if have_system
PATCH 2/2 meson: Warn when TCI is selected but TCG backend is available
In reply to Philippe Mathieu-Daudé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.
--- meson.build | 3 +++ 1 file changed, 3 insertions(+)
meson.build +3 -0
@@ -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
Signature · 1 line
2.26.2
Re: [PATCH 2/2] meson: Warn when TCI is selected but TCG backend is available
Quoted 17 lines · Philippe Mathieu-Daudé
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é <[email protected]>--- meson.build | 3 +++ 1 file changed, 3 insertions(+)meson.build +0
-0
meson.build line 242
Quoted 9 lines
meson.build +3
-0@@ -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
... 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
Quoted 30 lines · Thomas Huth
Quoted 17 lines · Philippe Mathieu-Daudé
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é <[email protected]>--- meson.build | 3 +++ 1 file changed, 3 insertions(+)meson.build +0
-0meson.build line 242
Quoted 9 lines
meson.build +3
-0@@ -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' } endifReviewed-by Thomas Huth <[email protected]>
Quoted 3 lines
... 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
Quoted 31 lines · Philippe Mathieu-Daudé
Quoted 30 lines · Thomas Huth
Quoted 17 lines · Philippe Mathieu-Daudé
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é <[email protected]>--- meson.build | 3 +++ 1 file changed, 3 insertions(+)meson.build +0
-0meson.build line 242
Quoted 9 lines
meson.build +3
-0@@ -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' } endifReviewed-by Thomas Huth <[email protected]>
Quoted 6 lines
Quoted 3 lines
... 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
Stefan Weil
Reviewed-byRe: [PATCH 2/2] meson: Warn when TCI is selected but TCG backend is available
Am 22.01.21 um 10:47 schrieb Thomas Huth:
Quoted 39 lines · Philippe Mathieu-Daudé
Quoted 38 lines · Thomas Huth
Quoted 36 lines · Philippe Mathieu-Daudé
Quoted 20 lines
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é <[email protected]>---
meson.build | 3 +++1 file changed, 3 insertions(+)meson.build +0
-0@@ -234,6 +234,9 @@error('Unsupported CPU @0@, try
--enable-tcg-interpreter'.format(cpu))
endif
endifQuoted 9 lines
+ if '
CONFIG_TCG_INTERPRETER' inconfig_hostand cpu insupported_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' }
endifReviewed-by Thomas Huth <[email protected]>... 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 ?
Quoted 7 lines
Quoted 2 lines
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
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