tests: switch tests to accel=kvm:tcg
PATCH 1/1 tests: switch tests to accel=kvm:tcg
Speed up tests on host systems with kvm support. In particular, this fixes tests with --disable-tcg.
---
Tested on x86 only.
tests/boot-serial-test.c | 2 +- tests/pnv-xscom-test.c | 4 ++-- tests/prom-env-test.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-)
tests/boot-serial-test.c +1 -1
@@ -78,7 +78,7 @@ static void test_machine(const void *data) fd =mkstemp (tmpname);g_assert (fd !=-1 ); - args =g_strdup_printf ("-M %s,accel=tcg -chardev file,id=serial0,path=%s" + args =g_strdup_printf ("-M %s,accel=kvm:tcg -chardev file,id=serial0,path=%s" " -no-shutdown -serial chardev:serial0 %s" , test->machine, tmpname, test->extra);
tests/pnv-xscom-test.c +2 -2
@@ -84,7 +84,7 @@ static void test_cfam_id(const void *data)char *args;const PnvChip *chip = data; - args =g_strdup_printf ("-M powernv,accel=tcg -cpu %s" , chip->cpu_model); + args =g_strdup_printf ("-M powernv,accel=kvm:tcg -cpu %s" , chip->cpu_model);qtest_start (args);test_xscom_cfam_id (chip);
@@ -112,7 +112,7 @@ static void test_core(const void *data)char *args;const PnvChip *chip = data; - args =g_strdup_printf ("-M powernv,accel=tcg -cpu %s" , chip->cpu_model); + args =g_strdup_printf ("-M powernv,accel=kvm:tcg -cpu %s" , chip->cpu_model);qtest_start (args);test_xscom_core (chip);
tests/prom-env-test.c +1 -1
@@ -50,7 +50,7 @@ static void test_machine(const void *machine)/* The pseries firmware boots much faster without the default devices */ extra_args =strcmp (machine,"pseries" ) ==0 ?"-nodefaults" :"" ; - args =g_strdup_printf ("-M %s,accel=tcg %s -prom-env 'use-nvramrc?=true' " + args =g_strdup_printf ("-M %s,accel=kvm:tcg %s -prom-env 'use-nvramrc?=true' " "-prom-env 'nvramrc=%x %x l!' " , (const char *)machine, extra_args,MAGIC ,ADDRESS );
Signature · 1 line
MST
Quoted 22 lines · On Mon, 14 Aug 2017 17:34:15 +0300 "Michael S. Tsirkin" <[email protected]> wrote:
Speed up tests on host systems with kvm support. In particular, this fixes tests with --disable-tcg.
Cc Paolo Bonzini <[email protected]>Cc Thomas Huth <[email protected]>Cc Laurent Vivier <[email protected]>Suggested-by Cornelia Huck <[email protected]>Signed-off-by Michael S. Tsirkin <[email protected]>---
Tested on x86 only.
tests/boot-serial-test.c | 2 +- tests/pnv-xscom-test.c | 4 ++-- tests/prom-env-test.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-)tests/boot-serial-test.c +0
-0
tests/boot-serial-test.c static void test_machine(const void *data) · line 83
Quoted 7 lines
tests/boot-serial-test.c +1
-1@@ -78,7 +78,7 @@ static void test_machine(const void *data) fd =mkstemp (tmpname);g_assert (fd !=-1 ); - args =g_strdup_printf ("-M %s,accel=tcg -chardev file,id=serial0,path=%s" + args =g_strdup_printf ("-M %s,accel=kvm:tcg -chardev file,id=serial0,path=%s" " -no-shutdown -serial chardev:serial0 %s" , test->machine, tmpname, test->extra);
This has already been changed upstream.
Quoted 15 lines
tests/pnv-xscom-test.c +1
-1@@ -84,7 +84,7 @@ static void test_cfam_id(const void *data)char *args;const PnvChip *chip = data; - args =g_strdup_printf ("-M powernv,accel=tcg -cpu %s" , chip->cpu_model); + args =g_strdup_printf ("-M powernv,accel=kvm:tcg -cpu %s" , chip->cpu_model);qtest_start (args);test_xscom_cfam_id (chip);
tests/pnv-xscom-test.c static void test_core(const void *data) · line 118
Quoted 8 lines
tests/pnv-xscom-test.c +1
-1@@ -112,7 +112,7 @@ static void test_core(const void *data)char *args;const PnvChip *chip = data; - args =g_strdup_printf ("-M powernv,accel=tcg -cpu %s" , chip->cpu_model); + args =g_strdup_printf ("-M powernv,accel=kvm:tcg -cpu %s" , chip->cpu_model);qtest_start (args);test_xscom_core (chip);
These seem to test a specified cpu model explicitly, so I'm not sure how well this will work with kvm.
tests/prom-env-test.c static void test_machine(const void *machine) · line 56
Quoted 13 lines
tests/prom-env-test.c +1
-1@@ -50,7 +50,7 @@ static void test_machine(const void *machine)/* The pseries firmware boots much faster without the default devices */ extra_args =strcmp (machine,"pseries" ) ==0 ?"-nodefaults" :"" ; - args =g_strdup_printf ("-M %s,accel=tcg %s -prom-env 'use-nvramrc?=true' " + args =g_strdup_printf ("-M %s,accel=kvm:tcg %s -prom-env 'use-nvramrc?=true' " "-prom-env 'nvramrc=%x %x l!' " , (const char *)machine, extra_args,MAGIC ,ADDRESS );
The header explicitly states that this is supposed to test tcg mode.
Thomas?
Quoted 5 lines · Cornelia Huck
Quoted 2 lines · On Mon, 14 Aug 2017 17:34:15 +0300 "Michael S. Tsirkin" <[email protected]> wrote:
Speed up tests on host systems with kvm support. In particular, this fixes tests with --disable-tcg.
[...]
Quoted 17 lines
Quoted 17 lines
tests/pnv-xscom-test.c +1
-1@@ -84,7 +84,7 @@ static void test_cfam_id(const void *data)char *args;const PnvChip *chip = data; - args =g_strdup_printf ("-M powernv,accel=tcg -cpu %s" , chip->cpu_model); + args =g_strdup_printf ("-M powernv,accel=kvm:tcg -cpu %s" , chip->cpu_model);qtest_start (args);test_xscom_cfam_id (chip);@@ -112,7 +112,7 @@ static void test_core(const void *data)char *args;const PnvChip *chip = data;
Quoted 8 lines
tests/pnv-xscom-test.c static void test_core(const void *data) · line 118
Quoted 5 lines
tests/pnv-xscom-test.c +1
-1- args =g_strdup_printf ("-M powernv,accel=tcg -cpu %s" , chip->cpu_model); + args =g_strdup_printf ("-M powernv,accel=kvm:tcg -cpu %s" , chip->cpu_model);qtest_start (args);test_xscom_core (chip);These seem to test a specified cpu model explicitly, so I'm not sure how well this will work with kvm.
AFAIK the powernv machine does not work with KVM yet (Cédric, can you confirm?), so you better drop the changes to this file.
Quoted 8 lines
Quoted 8 lines
tests/prom-env-test.c +0
-0@@ -50,7 +50,7 @@ static void test_machine(const void *machine)/* The pseries firmware boots much faster without the default devices */ extra_args =strcmp (machine,"pseries" ) ==0 ?"-nodefaults" :"" ;
Quoted 6 lines
tests/prom-env-test.c static void test_machine(const void *machine) · line 55
Quoted 4 lines
tests/prom-env-test.c +1
-1- args =g_strdup_printf ("-M %s,accel=tcg %s -prom-env 'use-nvramrc?=true' " + args =g_strdup_printf ("-M %s,accel=kvm:tcg %s -prom-env 'use-nvramrc?=true' " "-prom-env 'nvramrc=%x %x l!' " , (const char *)machine, extra_args,MAGIC ,ADDRESS );The header explicitly states that this is supposed to test tcg mode.
This change should be OK here. But it is currently not necessary yet:
The test only runs on SPARC and PPC machines, and both do not support the --disable-tcg switch yet.
Thomas
Quoted 27 lines · Thomas Huth
Quoted 5 lines · Cornelia Huck
Quoted 2 lines · On Mon, 14 Aug 2017 17:34:15 +0300 "Michael S. Tsirkin" <[email protected]> wrote:
Speed up tests on host systems with kvm support. In particular, this fixes tests with --disable-tcg.
[...]
Quoted 20 lines
Quoted 20 lines
tests/pnv-xscom-test.c +2
-2@@ -84,7 +84,7 @@ static void test_cfam_id(const void *data)char *args;const PnvChip *chip = data; - args =g_strdup_printf ("-M powernv,accel=tcg -cpu %s" , chip->cpu_model); + args =g_strdup_printf ("-M powernv,accel=kvm:tcg -cpu %s" , chip->cpu_model);qtest_start (args);test_xscom_cfam_id (chip);@@ -112,7 +112,7 @@ static void test_core(const void *data)char *args;const PnvChip *chip = data; - args =g_strdup_printf ("-M powernv,accel=tcg -cpu %s" , chip->cpu_model); + args =g_strdup_printf ("-M powernv,accel=kvm:tcg -cpu %s" , chip->cpu_model);
Quoted 8 lines
Quoted 5 lines
tests/pnv-xscom-test.c static void test_core(const void *data) · line 118
Quoted 2 lines
tests/pnv-xscom-test.c +0
-0qtest_start (args);test_xscom_core (chip);These seem to test a specified cpu model explicitly, so I'm not sure how well this will work with kvm.
AFAIK the powernv machine does not work with KVM yet (Cédric, can you confirm?), so you better drop the changes to this file.
No. the powernv machine does not work with KVM.
C.
Quoted 21 lines
Quoted 8 lines
Quoted 8 lines
tests/prom-env-test.c +0
-0@@ -50,7 +50,7 @@ static void test_machine(const void *machine)/* The pseries firmware boots much faster without the default devices */ extra_args =strcmp (machine,"pseries" ) ==0 ?"-nodefaults" :"" ;Quoted 6 lines
tests/prom-env-test.c static void test_machine(const void *machine) · line 55
Quoted 4 lines
tests/prom-env-test.c +1
-1- args =g_strdup_printf ("-M %s,accel=tcg %s -prom-env 'use-nvramrc?=true' " + args =g_strdup_printf ("-M %s,accel=kvm:tcg %s -prom-env 'use-nvramrc?=true' " "-prom-env 'nvramrc=%x %x l!' " , (const char *)machine, extra_args,MAGIC ,ADDRESS );The header explicitly states that this is supposed to test tcg mode.
This change should be OK here. But it is currently not necessary yet:
The test only runs on SPARC and PPC machines, and both do not support the --disable-tcg switch yet.Thomas
Quoted 28 lines · Cornelia Huck
Quoted 25 lines · On Mon, 14 Aug 2017 17:34:15 +0300 "Michael S. Tsirkin" <[email protected]> wrote:
Speed up tests on host systems with kvm support. In particular, this fixes tests with --disable-tcg.
Cc Paolo Bonzini <[email protected]>Cc Thomas Huth <[email protected]>Cc Laurent Vivier <[email protected]>Suggested-by Cornelia Huck <[email protected]>Signed-off-by Michael S. Tsirkin <[email protected]>---
Tested on x86 only.
tests/boot-serial-test.c | 2 +- tests/pnv-xscom-test.c | 4 ++-- tests/prom-env-test.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-)tests/boot-serial-test.c +0
-0@@ -78,7 +78,7 @@ static void test_machine(const void *data) fd =mkstemp (tmpname);g_assert (fd !=-1 );
Quoted 6 lines
tests/boot-serial-test.c static void test_machine(const void *data) · line 83
Quoted 4 lines
tests/boot-serial-test.c +1
-1- args =g_strdup_printf ("-M %s,accel=tcg -chardev file,id=serial0,path=%s" + args =g_strdup_printf ("-M %s,accel=kvm:tcg -chardev file,id=serial0,path=%s" " -no-shutdown -serial chardev:serial0 %s" , test->machine, tmpname, test->extra);This has already been changed upstream.
Ouch. This is the only real smoke test we have for the tcg backend for the host. While it is still going to test tcg for whatever machines do not run natively on the host, I can't help think we've lost testing.
Can we use accel=tcg:kvm instead?
r~
Quoted 36 lines · Richard Henderson
Quoted 28 lines · Cornelia Huck
Quoted 25 lines · On Mon, 14 Aug 2017 17:34:15 +0300 "Michael S. Tsirkin" <[email protected]> wrote:
Speed up tests on host systems with kvm support. In particular, this fixes tests with --disable-tcg.
Cc Paolo Bonzini <[email protected]>Cc Thomas Huth <[email protected]>Cc Laurent Vivier <[email protected]>Suggested-by Cornelia Huck <[email protected]>Signed-off-by Michael S. Tsirkin <[email protected]>---
Tested on x86 only.
tests/boot-serial-test.c | 2 +- tests/pnv-xscom-test.c | 4 ++-- tests/prom-env-test.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-)tests/boot-serial-test.c +0
-0@@ -78,7 +78,7 @@ static void test_machine(const void *data) fd =mkstemp (tmpname);g_assert (fd !=-1 );Quoted 6 lines
tests/boot-serial-test.c static void test_machine(const void *data) · line 83
Quoted 4 lines
tests/boot-serial-test.c +1
-1- args =g_strdup_printf ("-M %s,accel=tcg -chardev file,id=serial0,path=%s" + args =g_strdup_printf ("-M %s,accel=kvm:tcg -chardev file,id=serial0,path=%s" " -no-shutdown -serial chardev:serial0 %s" , test->machine, tmpname, test->extra);This has already been changed upstream.
Quoted 8 lines
Ouch. This is the only real smoke test we have for the tcg backend for the host. While it is still going to test tcg for whatever machines do not run natively on the host, I can't help think we've lost testing.
Can we use accel=tcg:kvm instead?
r~
We can add an environment to disable kvm on qemu side, for e.g. CI systems who have spare time.
Signature · 1 line
MST
Quoted 11 lines · Michael S. Tsirkin
Quoted 8 lines
Ouch. This is the only real smoke test we have for the tcg backend for the host. While it is still going to test tcg for whatever machines do not run natively on the host, I can't help think we've lost testing.
Can we use accel=tcg:kvm instead?
r~
We can add an environment to disable kvm on qemu side, for e.g. CI systems who have spare time.
Hum. I'm not especially keen on an environment variable that wouldn't be useful for anything else. I'd much rather adjust the test case so that plain "make check" tests all that we need to test.
r~
Quoted 36 lines · Richard Henderson
Quoted 28 lines · Cornelia Huck
Quoted 25 lines · On Mon, 14 Aug 2017 17:34:15 +0300 "Michael S. Tsirkin" <[email protected]> wrote:
Speed up tests on host systems with kvm support. In particular, this fixes tests with --disable-tcg.
Cc Paolo Bonzini <[email protected]>Cc Thomas Huth <[email protected]>Cc Laurent Vivier <[email protected]>Suggested-by Cornelia Huck <[email protected]>Signed-off-by Michael S. Tsirkin <[email protected]>---
Tested on x86 only.
tests/boot-serial-test.c | 2 +- tests/pnv-xscom-test.c | 4 ++-- tests/prom-env-test.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-)tests/boot-serial-test.c +0
-0@@ -78,7 +78,7 @@ static void test_machine(const void *data) fd =mkstemp (tmpname);g_assert (fd !=-1 );Quoted 6 lines
tests/boot-serial-test.c static void test_machine(const void *data) · line 83
Quoted 4 lines
tests/boot-serial-test.c +1
-1- args =g_strdup_printf ("-M %s,accel=tcg -chardev file,id=serial0,path=%s" + args =g_strdup_printf ("-M %s,accel=kvm:tcg -chardev file,id=serial0,path=%s" " -no-shutdown -serial chardev:serial0 %s" , test->machine, tmpname, test->extra);This has already been changed upstream.
Quoted 3 lines
Ouch. This is the only real smoke test we have for the tcg backend for the host. While it is still going to test tcg for whatever machines do not run natively on the host, I can't help think we've lost testing.
Ah, well, I didn't think of that when I suggested to use "kvm:tcg" here... I rather thought that kvm would be preferable to speed up the test. But since the test is already quite fast anyway, it's likely also OK to use "tcg:kvm" here. (But we should keep "kvm:tcg" in the pxe-test since that is quite slow with TCG, at least on ppc64).
Thomas
Quoted 41 lines · On Tue, 15 Aug 2017 21:49:16 +0200 Thomas Huth <[email protected]> wrote:
Quoted 36 lines · Richard Henderson
Quoted 28 lines · Cornelia Huck
Quoted 25 lines · On Mon, 14 Aug 2017 17:34:15 +0300 "Michael S. Tsirkin" <[email protected]> wrote:
Speed up tests on host systems with kvm support. In particular, this fixes tests with --disable-tcg.
Cc Paolo Bonzini <[email protected]>Cc Thomas Huth <[email protected]>Cc Laurent Vivier <[email protected]>Suggested-by Cornelia Huck <[email protected]>Signed-off-by Michael S. Tsirkin <[email protected]>---
Tested on x86 only.
tests/boot-serial-test.c | 2 +- tests/pnv-xscom-test.c | 4 ++-- tests/prom-env-test.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-)tests/boot-serial-test.c +0
-0@@ -78,7 +78,7 @@ static void test_machine(const void *data) fd =mkstemp (tmpname);g_assert (fd !=-1 );Quoted 6 lines
tests/boot-serial-test.c static void test_machine(const void *data) · line 83
Quoted 4 lines
tests/boot-serial-test.c +1
-1- args =g_strdup_printf ("-M %s,accel=tcg -chardev file,id=serial0,path=%s" + args =g_strdup_printf ("-M %s,accel=kvm:tcg -chardev file,id=serial0,path=%s" " -no-shutdown -serial chardev:serial0 %s" , test->machine, tmpname, test->extra);This has already been changed upstream.
Quoted 3 lines
Ouch. This is the only real smoke test we have for the tcg backend for the host. While it is still going to test tcg for whatever machines do not run natively on the host, I can't help think we've lost testing.
Quoted 5 lines
Ah, well, I didn't think of that when I suggested to use "kvm:tcg" here... I rather thought that kvm would be preferable to speed up the test. But since the test is already quite fast anyway, it's likely also OK to use "tcg:kvm" here. (But we should keep "kvm:tcg" in the pxe-test since that is quite slow with TCG, at least on ppc64).
That all means to me that we need more documentation, at least some comments.
Will there be a -rc4? I can send a patch that reverses the accelerators and adds a comment today.
Quoted 36 lines · Richard Henderson
Quoted 28 lines · Cornelia Huck
Quoted 25 lines · On Mon, 14 Aug 2017 17:34:15 +0300 "Michael S. Tsirkin" <[email protected]> wrote:
Speed up tests on host systems with kvm support. In particular, this fixes tests with --disable-tcg.
Cc Paolo Bonzini <[email protected]>Cc Thomas Huth <[email protected]>Cc Laurent Vivier <[email protected]>Suggested-by Cornelia Huck <[email protected]>Signed-off-by Michael S. Tsirkin <[email protected]>---
Tested on x86 only.
tests/boot-serial-test.c | 2 +- tests/pnv-xscom-test.c | 4 ++-- tests/prom-env-test.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-)tests/boot-serial-test.c +0
-0@@ -78,7 +78,7 @@ static void test_machine(const void *data) fd =mkstemp (tmpname);g_assert (fd !=-1 );Quoted 6 lines
tests/boot-serial-test.c static void test_machine(const void *data) · line 83
Quoted 4 lines
tests/boot-serial-test.c +1
-1- args =g_strdup_printf ("-M %s,accel=tcg -chardev file,id=serial0,path=%s" + args =g_strdup_printf ("-M %s,accel=kvm:tcg -chardev file,id=serial0,path=%s" " -no-shutdown -serial chardev:serial0 %s" , test->machine, tmpname, test->extra);This has already been changed upstream.
Quoted 5 lines
Ouch. This is the only real smoke test we have for the tcg backend for the host. While it is still going to test tcg for whatever machines do not run natively on the host, I can't help think we've lost testing.
Can we use accel=tcg:kvm instead?
can we use the following in this test main()?
/* This test is fast fast enough to use to test the host TCG backend,
* so use "tcg" as default accel if available. */
#ifdef CONFIG_TCG
static const char *accel = "tcg";
#else
static const char *accel = "kvm";
#endif
Quoted 4 lines
r~
Quoted 45 lines · On Tue, 15 Aug 2017 17:04:35 -0300 Philippe Mathieu-Daudé <[email protected]>…
Quoted 36 lines · Richard Henderson
Quoted 28 lines · Cornelia Huck
Quoted 25 lines · On Mon, 14 Aug 2017 17:34:15 +0300 "Michael S. Tsirkin" <[email protected]> wrote:
Speed up tests on host systems with kvm support. In particular, this fixes tests with --disable-tcg.
Cc Paolo Bonzini <[email protected]>Cc Thomas Huth <[email protected]>Cc Laurent Vivier <[email protected]>Suggested-by Cornelia Huck <[email protected]>Signed-off-by Michael S. Tsirkin <[email protected]>---
Tested on x86 only.
tests/boot-serial-test.c | 2 +- tests/pnv-xscom-test.c | 4 ++-- tests/prom-env-test.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-)tests/boot-serial-test.c +0
-0@@ -78,7 +78,7 @@ static void test_machine(const void *data) fd =mkstemp (tmpname);g_assert (fd !=-1 );Quoted 6 lines
tests/boot-serial-test.c static void test_machine(const void *data) · line 83
Quoted 4 lines
tests/boot-serial-test.c +1
-1- args =g_strdup_printf ("-M %s,accel=tcg -chardev file,id=serial0,path=%s" + args =g_strdup_printf ("-M %s,accel=kvm:tcg -chardev file,id=serial0,path=%s" " -no-shutdown -serial chardev:serial0 %s" , test->machine, tmpname, test->extra);This has already been changed upstream.
Quoted 5 lines
Ouch. This is the only real smoke test we have for the tcg backend for the host. While it is still going to test tcg for whatever machines do not run natively on the host, I can't help think we've lost testing.
Can we use accel=tcg:kvm instead?
can we use the following in this test
main()?
Quoted 7 lines
/* This test is fast fast enough to use to test the host TCG backend,
* so use "tcg" as default accel if available. */
#ifdefCONFIG_TCG
static const char *accel = "tcg";
#else
static const char *accel = "kvm";
#endif
accel=tcg:kvm should already have the same effect, no?
(But adding a comment may be a good idea.)