From patchwork Fri Sep 9 21:47:38 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 9324481 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 51E5460752 for ; Fri, 9 Sep 2016 21:55:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3167829DF8 for ; Fri, 9 Sep 2016 21:55:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 24EFB29E3D; Fri, 9 Sep 2016 21:55:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8D7FE29DF8 for ; Fri, 9 Sep 2016 21:55:17 +0000 (UTC) Received: from localhost ([::1]:60442 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1biTlT-00022i-Kw for patchwork-qemu-devel@patchwork.kernel.org; Fri, 09 Sep 2016 17:55:15 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40427) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1biTeI-0004Pc-4F for qemu-devel@nongnu.org; Fri, 09 Sep 2016 17:47:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1biTeD-0004Ts-37 for qemu-devel@nongnu.org; Fri, 09 Sep 2016 17:47:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34520) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1biTeC-0004T7-SP for qemu-devel@nongnu.org; Fri, 09 Sep 2016 17:47:45 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 686C17F7A9; Fri, 9 Sep 2016 21:47:44 +0000 (UTC) Received: from redhat.com (vpn-62-83.rdu2.redhat.com [10.10.62.83]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with SMTP id u89Llc3d018061; Fri, 9 Sep 2016 17:47:39 -0400 Date: Sat, 10 Sep 2016 00:47:38 +0300 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Message-ID: <1473456998-14863-14-git-send-email-mst@redhat.com> References: <1473456998-14863-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1473456998-14863-1-git-send-email-mst@redhat.com> X-Mutt-Fcc: =sent X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Fri, 09 Sep 2016 21:47:44 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL v2 13/14] tests/acpi: speedup acpi tests X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Marcel Apfelbaum , Peter Maydell , Michael Tokarev , Igor Mammedov Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Marcel Apfelbaum 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. Acked-by: Michael S. Tsirkin Signed-off-by: Marcel Apfelbaum Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- tests/bios-tables-test.c | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/tests/bios-tables-test.c b/tests/bios-tables-test.c index de4019e..7e27ea9 100644 --- a/tests/bios-tables-test.c +++ b/tests/bios-tables-test.c @@ -711,9 +711,12 @@ static void test_acpi_one(const char *params, test_data *data) { char *args; - args = g_strdup_printf("-net none -display none %s " + /* Disable kernel irqchip to be able to override apic irq0. */ + args = g_strdup_printf("-machine %s,accel=%s,kernel-irqchip=off " + "-net none -display none %s " "-drive id=hd0,if=none,file=%s,format=raw " "-device ide-hd,drive=hd0 ", + data->machine, "kvm:tcg", params ? params : "", disk); qtest_start(args); @@ -758,7 +761,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 +774,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 +786,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 +799,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 +811,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 +823,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 +841,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 +859,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 +877,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);