* [Qemu-devel] [PATCH V2] tests/acpi: speedup acpi tests
@ 2016-09-06 17:18 Marcel Apfelbaum
2016-09-06 18:30 ` Paolo Bonzini
0 siblings, 1 reply; 3+ messages in thread
From: Marcel Apfelbaum @ 2016-09-06 17:18 UTC (permalink / raw)
To: qemu-devel; +Cc: mst, imammedo, pbonzini
Use kvm acceleration if available.
Disable kernel-irqchip and use qemu64 cpu
for both kvm and tcg cases.
Using kvm acceleration saves about a second
and disabling kernel-irqchip has no visible
performance impact.
Signed-off-by: Marcel Apfelbaum <marcel@redhat.com>
---
v1->v2:
- Disable kernel_irqchip an use qemu64 cpu (Michael)
- Replace check_kvm function with -machine accel=kvm:tcg (Paolo)
- Don't pass the machine parameter to test_acpi_one
tests/bios-tables-test.c | 40 ++++++++++++++++++++--------------------
1 file changed, 20 insertions(+), 20 deletions(-)
diff --git a/tests/bios-tables-test.c b/tests/bios-tables-test.c
index de4019e..ac8ddfd 100644
--- a/tests/bios-tables-test.c
+++ b/tests/bios-tables-test.c
@@ -711,9 +711,11 @@ static void test_acpi_one(const char *params, test_data *data)
{
char *args;
- args = g_strdup_printf("-net none -display none %s "
+ args = g_strdup_printf("-machine %s,accel=%s,kernel-irqchip=off "
+ "-cpu qemu64 -net none -display none %s "
"-drive id=hd0,if=none,file=%s,format=raw "
- "-device ide-hd,drive=hd0 ",
+ "-device ide-hd,drive=hd0",
+ data->machine, "kvm:tcg",
params ? params : "", disk);
qtest_start(args);
@@ -758,7 +760,7 @@ static void test_acpi_piix4_tcg(void)
data.machine = MACHINE_PC;
data.required_struct_types = base_required_struct_types;
data.required_struct_types_len = ARRAY_SIZE(base_required_struct_types);
- test_acpi_one("-machine accel=tcg", &data);
+ test_acpi_one(NULL, &data);
free_test_data(&data);
}
@@ -771,7 +773,7 @@ static void test_acpi_piix4_tcg_bridge(void)
data.variant = ".bridge";
data.required_struct_types = base_required_struct_types;
data.required_struct_types_len = ARRAY_SIZE(base_required_struct_types);
- test_acpi_one("-machine accel=tcg -device pci-bridge,chassis_nr=1", &data);
+ test_acpi_one("-device pci-bridge,chassis_nr=1", &data);
free_test_data(&data);
}
@@ -783,7 +785,7 @@ static void test_acpi_q35_tcg(void)
data.machine = MACHINE_Q35;
data.required_struct_types = base_required_struct_types;
data.required_struct_types_len = ARRAY_SIZE(base_required_struct_types);
- test_acpi_one("-machine q35,accel=tcg", &data);
+ test_acpi_one(NULL, &data);
free_test_data(&data);
}
@@ -796,7 +798,7 @@ static void test_acpi_q35_tcg_bridge(void)
data.variant = ".bridge";
data.required_struct_types = base_required_struct_types;
data.required_struct_types_len = ARRAY_SIZE(base_required_struct_types);
- test_acpi_one("-machine q35,accel=tcg -device pci-bridge,chassis_nr=1",
+ test_acpi_one("-device pci-bridge,chassis_nr=1",
&data);
free_test_data(&data);
}
@@ -808,8 +810,7 @@ static void test_acpi_piix4_tcg_cphp(void)
memset(&data, 0, sizeof(data));
data.machine = MACHINE_PC;
data.variant = ".cphp";
- test_acpi_one("-machine accel=tcg"
- " -smp 2,cores=3,sockets=2,maxcpus=6",
+ test_acpi_one("-smp 2,cores=3,sockets=2,maxcpus=6",
&data);
free_test_data(&data);
}
@@ -821,8 +822,7 @@ static void test_acpi_q35_tcg_cphp(void)
memset(&data, 0, sizeof(data));
data.machine = MACHINE_Q35;
data.variant = ".cphp";
- test_acpi_one("-machine q35,accel=tcg"
- " -smp 2,cores=3,sockets=2,maxcpus=6",
+ test_acpi_one(" -smp 2,cores=3,sockets=2,maxcpus=6",
&data);
free_test_data(&data);
}
@@ -840,7 +840,7 @@ static void test_acpi_q35_tcg_ipmi(void)
data.variant = ".ipmibt";
data.required_struct_types = ipmi_required_struct_types;
data.required_struct_types_len = ARRAY_SIZE(ipmi_required_struct_types);
- test_acpi_one("-machine q35,accel=tcg -device ipmi-bmc-sim,id=bmc0"
+ test_acpi_one("-device ipmi-bmc-sim,id=bmc0"
" -device isa-ipmi-bt,bmc=bmc0",
&data);
free_test_data(&data);
@@ -858,7 +858,7 @@ static void test_acpi_piix4_tcg_ipmi(void)
data.variant = ".ipmikcs";
data.required_struct_types = ipmi_required_struct_types;
data.required_struct_types_len = ARRAY_SIZE(ipmi_required_struct_types);
- test_acpi_one("-machine accel=tcg -device ipmi-bmc-sim,id=bmc0"
+ test_acpi_one("-device ipmi-bmc-sim,id=bmc0"
" -device isa-ipmi-kcs,irq=0,bmc=bmc0",
&data);
free_test_data(&data);
@@ -876,14 +876,14 @@ int main(int argc, char *argv[])
g_test_init(&argc, &argv, NULL);
if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) {
- qtest_add_func("acpi/piix4/tcg", test_acpi_piix4_tcg);
- qtest_add_func("acpi/piix4/tcg/bridge", test_acpi_piix4_tcg_bridge);
- qtest_add_func("acpi/q35/tcg", test_acpi_q35_tcg);
- qtest_add_func("acpi/q35/tcg/bridge", test_acpi_q35_tcg_bridge);
- qtest_add_func("acpi/piix4/tcg/ipmi", test_acpi_piix4_tcg_ipmi);
- qtest_add_func("acpi/q35/tcg/ipmi", test_acpi_q35_tcg_ipmi);
- qtest_add_func("acpi/piix4/tcg/cpuhp", test_acpi_piix4_tcg_cphp);
- qtest_add_func("acpi/q35/tcg/cpuhp", test_acpi_q35_tcg_cphp);
+ qtest_add_func("acpi/piix4", test_acpi_piix4_tcg);
+ qtest_add_func("acpi/piix4/bridge", test_acpi_piix4_tcg_bridge);
+ qtest_add_func("acpi/q35", test_acpi_q35_tcg);
+ qtest_add_func("acpi/q35/bridge", test_acpi_q35_tcg_bridge);
+ qtest_add_func("acpi/piix4/ipmi", test_acpi_piix4_tcg_ipmi);
+ qtest_add_func("acpi/q35/ipmi", test_acpi_q35_tcg_ipmi);
+ qtest_add_func("acpi/piix4/cpuhp", test_acpi_piix4_tcg_cphp);
+ qtest_add_func("acpi/q35/cpuhp", test_acpi_q35_tcg_cphp);
}
ret = g_test_run();
boot_sector_cleanup(disk);
--
2.5.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH V2] tests/acpi: speedup acpi tests
2016-09-06 17:18 [Qemu-devel] [PATCH V2] tests/acpi: speedup acpi tests Marcel Apfelbaum
@ 2016-09-06 18:30 ` Paolo Bonzini
2016-09-06 18:38 ` Marcel Apfelbaum
0 siblings, 1 reply; 3+ messages in thread
From: Paolo Bonzini @ 2016-09-06 18:30 UTC (permalink / raw)
To: Marcel Apfelbaum, qemu-devel; +Cc: imammedo, mst
On 06/09/2016 19:18, Marcel Apfelbaum wrote:
> diff --git a/tests/bios-tables-test.c b/tests/bios-tables-test.c
> index de4019e..ac8ddfd 100644
> --- a/tests/bios-tables-test.c
> +++ b/tests/bios-tables-test.c
> @@ -711,9 +711,11 @@ static void test_acpi_one(const char *params, test_data *data)
> {
> char *args;
>
> - args = g_strdup_printf("-net none -display none %s "
> + args = g_strdup_printf("-machine %s,accel=%s,kernel-irqchip=off "
> + "-cpu qemu64 -net none -display none %s "
> "-drive id=hd0,if=none,file=%s,format=raw "
> - "-device ide-hd,drive=hd0 ",
> + "-device ide-hd,drive=hd0",
> + data->machine, "kvm:tcg",
> params ? params : "", disk);
qemu64 is the default for qemu-system-x86_64; perhaps you wanted "-cpu
kvm64"?
Paolo
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH V2] tests/acpi: speedup acpi tests
2016-09-06 18:30 ` Paolo Bonzini
@ 2016-09-06 18:38 ` Marcel Apfelbaum
0 siblings, 0 replies; 3+ messages in thread
From: Marcel Apfelbaum @ 2016-09-06 18:38 UTC (permalink / raw)
To: Paolo Bonzini, qemu-devel; +Cc: imammedo, mst
On 09/06/2016 09:30 PM, Paolo Bonzini wrote:
>
>
> On 06/09/2016 19:18, Marcel Apfelbaum wrote:
>> diff --git a/tests/bios-tables-test.c b/tests/bios-tables-test.c
>> index de4019e..ac8ddfd 100644
>> --- a/tests/bios-tables-test.c
>> +++ b/tests/bios-tables-test.c
>> @@ -711,9 +711,11 @@ static void test_acpi_one(const char *params, test_data *data)
>> {
>> char *args;
>>
>> - args = g_strdup_printf("-net none -display none %s "
>> + args = g_strdup_printf("-machine %s,accel=%s,kernel-irqchip=off "
>> + "-cpu qemu64 -net none -display none %s "
>> "-drive id=hd0,if=none,file=%s,format=raw "
>> - "-device ide-hd,drive=hd0 ",
>> + "-device ide-hd,drive=hd0",
>> + data->machine, "kvm:tcg",
>> params ? params : "", disk);
>
> qemu64 is the default for qemu-system-x86_64; perhaps you wanted "-cpu
> kvm64"?
>
No, I wanted qemu64. I'll get rid of it.
Thanks,
Marcel
> Paolo
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-09-06 18:39 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-06 17:18 [Qemu-devel] [PATCH V2] tests/acpi: speedup acpi tests Marcel Apfelbaum
2016-09-06 18:30 ` Paolo Bonzini
2016-09-06 18:38 ` Marcel Apfelbaum
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).