Received: by 2002:a05:6214:9cd:0:0:0:0 with SMTP id dp13csp1648944qvb; Thu, 15 Apr 2021 05:32:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxrhaLAK9mBfU4wlokoae1yutSgWV/f5zCO6SsIsb8F8W37Hq6HogPJg/wP6VkPFAbSR4u5 X-Received: by 2002:a67:ab03:: with SMTP id u3mr1558614vse.31.1618489930869; Thu, 15 Apr 2021 05:32:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618489930; cv=none; d=google.com; s=arc-20160816; b=beP+KbjQbz9MPv2zHZfXeWsoMfI75+pahib3Tpvypio+ODa6ZMvZ0KidRKQYSEg5KW 7bWxTL4aEr5DR0c71jF8NA7uMJI0D4atJAqttEObWaWvKvPWGJZag+0NFeOTmNJG38F6 St6cKnI6H1KC2dBUyepit/7PAmgtyNpwKjczbAYEbS0DEh4dm0Kk7sXr4K5i/BZSJAuU Uz1wijDsewaTIsmB+ghzSJjSZr/c4yNHlU3zs9ps++t6ANSUw/kxJ2utyfy3LQVLIU6E sDpBrj4cabKcfGWXJLOQYXKRImx3XvvnZlg+rQJccm4lJK5JT8knaHsTie37REAi2hIy 4wmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=tOeJRHeQ91TF8arzY33TfEs4YUKLXq9d/m6dOUlZ5Uw=; b=gN9lqE8+aCqzfgo1krw1cAX4syDsl29VNkEUpFiCS0bxG9kX9aueSssImuUV6IdGEI 8BFzip4m6GiJp7qqzbbCjqguFjnVs0PhAHGhaYkv2cAEhuk8UFapFvJ16qZt8MpFnOQF +OSHpC5wWZ0lMICrYYfJLu4QBnbIm7yaJ6ISKAoqG6gmApM3KGO88yG9LYq9oSpxph3G ZhLhh9EbW+lPdXyxfDKicADPu6djirde969dmj+J/imhhgutfKZCCMcZL7Qbp3KCIugM SHOLFCkw2aJkzpV1ZWfi492Ccur6gN1kZu+9LLzCGUyDuD8KmuspLmchLFqEg9l8z+7e YWAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@redhat.com header.s=mimecast20190719 header.b=dWfcITrK; spf=pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id c13si788085vsl.328.2021.04.15.05.32.10 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 15 Apr 2021 05:32:10 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@redhat.com header.s=mimecast20190719 header.b=dWfcITrK; spf=pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from localhost ([::1]:36558 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lX1AG-0006tz-Mc for alex.bennee@linaro.org; Thu, 15 Apr 2021 08:32:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46162) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lX15H-00031g-Ga for qemu-arm@nongnu.org; Thu, 15 Apr 2021 08:26:59 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:23190) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lX15D-00063L-WA for qemu-arm@nongnu.org; Thu, 15 Apr 2021 08:26:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1618489614; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=tOeJRHeQ91TF8arzY33TfEs4YUKLXq9d/m6dOUlZ5Uw=; b=dWfcITrKn9vH50RDxMKEEX2xiqOwgFCQPP7GfIMMpiZzRtTXXXCJxwfv0iDXQt47MwbLMC zIt19c01zrpdi8uxKpxh9uchOCY91Qy3slxC5c/MggqF4RMvIM9Ek8CM0JVr3WgF+b/aUt b3u5lOuoaEaLKBvvviJXB0rbjRzJiS8= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-139-IGva43tWOterx8jV8gmNvw-1; Thu, 15 Apr 2021 08:26:53 -0400 X-MC-Unique: IGva43tWOterx8jV8gmNvw-1 Received: by mail-wm1-f72.google.com with SMTP id o22-20020a1ca5160000b0290126af94672aso2833465wme.2 for ; Thu, 15 Apr 2021 05:26:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=tOeJRHeQ91TF8arzY33TfEs4YUKLXq9d/m6dOUlZ5Uw=; b=kZRFd2b/b66I8PnoMMkN6xPbQxLe1xjaf1QeV6Vd1JNBN4tqFYMyfUvR9m0X6W46Vs V+uOARxOu7AmaQgLAulgq627XC+ZX/AbaIda00/WQaMpDuJM/j3BPLxSPEi6KdHHuCDJ SzheJAbd502NncB7ZEfVFAs5YjdXdYn5IGn1xQAoCSBdTJPihHPrtJTIFTRuXRK/QOJ0 XiG7xVe5JwpFd/tYCDlctF9iHdNgODphv248GJ77rPcb4Rjt+mBAe8n1Vx23D1u01+fJ x7z9HHnomjC5BFCIWsG5lPVwPOUiPs2jr8mYOHzuLNndjPiNSdsdcpUOJCW5ohBNh1pX eubg== X-Gm-Message-State: AOAM5316sMfrMCO61B8VBUshc+rJj05Trz0vhX7zYqDjysqVUxhlKHen edNMXdnvmEYXt9K5IV97l+yaneIWoP89vHPV9+5R88oMuRPy6quVlHcABM7gr9vuCfNWxtvrgOP PfFmVNbVpR9Du X-Received: by 2002:a5d:550f:: with SMTP id b15mr3338564wrv.251.1618489611598; Thu, 15 Apr 2021 05:26:51 -0700 (PDT) X-Received: by 2002:a5d:550f:: with SMTP id b15mr3338542wrv.251.1618489611413; Thu, 15 Apr 2021 05:26:51 -0700 (PDT) Received: from localhost.localdomain (39.red-81-40-121.staticip.rima-tde.net. [81.40.121.39]) by smtp.gmail.com with ESMTPSA id a22sm2673010wrc.59.2021.04.15.05.26.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Apr 2021 05:26:50 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v3 3/6] qtest/bios-tables-test: Make test build-independent from accelerator Date: Thu, 15 Apr 2021 14:26:30 +0200 Message-Id: <20210415122633.4054644-4-philmd@redhat.com> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20210415122633.4054644-1-philmd@redhat.com> References: <20210415122633.4054644-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=216.205.24.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-arm@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , Thomas Huth , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= , Eduardo Habkost , "Michael S. Tsirkin" , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson , Andrew Jones , Markus Armbruster , qemu-arm@nongnu.org, Claudio Fontana , Marcel Apfelbaum , Igor Mammedov , Paolo Bonzini , Eric Blake Errors-To: qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org Sender: "Qemu-arm" X-TUID: jSGnEO0OQZss Now than we can probe if the TCG accelerator is available at runtime with a QMP command, do it once at the beginning and only register the tests we can run. We can then replace the #ifdef'ry by an assertion. Reviewed-by: Eric Blake Signed-off-by: Philippe Mathieu-Daudé --- Since v1: use global tcg_accel_available, call qtest_has_accel() once --- tests/qtest/bios-tables-test.c | 99 ++++++++++++++++++---------------- 1 file changed, 52 insertions(+), 47 deletions(-) diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c index 156d4174aa3..a4c7bddf6f3 100644 --- a/tests/qtest/bios-tables-test.c +++ b/tests/qtest/bios-tables-test.c @@ -97,6 +97,7 @@ typedef struct { QTestState *qts; } test_data; +static bool tcg_accel_available; static char disk[] = "tests/acpi-test-disk-XXXXXX"; static const char *data_dir = "tests/data/acpi"; #ifdef CONFIG_IASL @@ -718,15 +719,11 @@ static void test_acpi_one(const char *params, test_data *data) char *args; bool use_uefi = data->uefi_fl1 && data->uefi_fl2; -#ifndef CONFIG_TCG - if (data->tcg_only) { - g_test_skip("TCG disabled, skipping ACPI tcg_only test"); - return; - } -#endif /* CONFIG_TCG */ + assert(!data->tcg_only || tcg_accel_available); args = test_acpi_create_args(data, params, use_uefi); data->qts = qtest_init(args); + test_acpi_load_tables(data, use_uefi); if (getenv(ACPI_REBUILD_EXPECTED_AML)) { @@ -1504,6 +1501,8 @@ int main(int argc, char *argv[]) const char *arch = qtest_get_arch(); int ret; + tcg_accel_available = qtest_has_accel("tcg"); + g_test_init(&argc, &argv, NULL); if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) { @@ -1512,56 +1511,62 @@ int main(int argc, char *argv[]) return ret; } qtest_add_func("acpi/q35/oem-fields", test_acpi_oem_fields_q35); - qtest_add_func("acpi/q35/tpm-tis", test_acpi_q35_tcg_tpm_tis); - qtest_add_func("acpi/piix4", test_acpi_piix4_tcg); qtest_add_func("acpi/oem-fields", test_acpi_oem_fields_pc); - qtest_add_func("acpi/piix4/bridge", test_acpi_piix4_tcg_bridge); + qtest_add_func("acpi/microvm/oem-fields", test_acpi_oem_fields_microvm); qtest_add_func("acpi/piix4/pci-hotplug/no_root_hotplug", test_acpi_piix4_no_root_hotplug); qtest_add_func("acpi/piix4/pci-hotplug/no_bridge_hotplug", test_acpi_piix4_no_bridge_hotplug); qtest_add_func("acpi/piix4/pci-hotplug/off", test_acpi_piix4_no_acpi_pci_hotplug); - qtest_add_func("acpi/q35", test_acpi_q35_tcg); - qtest_add_func("acpi/q35/bridge", test_acpi_q35_tcg_bridge); - qtest_add_func("acpi/q35/mmio64", test_acpi_q35_tcg_mmio64); - 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); - qtest_add_func("acpi/piix4/memhp", test_acpi_piix4_tcg_memhp); - qtest_add_func("acpi/q35/memhp", test_acpi_q35_tcg_memhp); - qtest_add_func("acpi/piix4/numamem", test_acpi_piix4_tcg_numamem); - qtest_add_func("acpi/q35/numamem", test_acpi_q35_tcg_numamem); - qtest_add_func("acpi/piix4/nosmm", test_acpi_piix4_tcg_nosmm); - qtest_add_func("acpi/piix4/smm-compat", - test_acpi_piix4_tcg_smm_compat); - qtest_add_func("acpi/piix4/smm-compat-nosmm", - test_acpi_piix4_tcg_smm_compat_nosmm); - qtest_add_func("acpi/piix4/nohpet", test_acpi_piix4_tcg_nohpet); - qtest_add_func("acpi/q35/nosmm", test_acpi_q35_tcg_nosmm); - qtest_add_func("acpi/q35/smm-compat", - test_acpi_q35_tcg_smm_compat); - qtest_add_func("acpi/q35/smm-compat-nosmm", - test_acpi_q35_tcg_smm_compat_nosmm); - qtest_add_func("acpi/q35/nohpet", test_acpi_q35_tcg_nohpet); - qtest_add_func("acpi/piix4/dimmpxm", test_acpi_piix4_tcg_dimm_pxm); - qtest_add_func("acpi/q35/dimmpxm", test_acpi_q35_tcg_dimm_pxm); - qtest_add_func("acpi/piix4/acpihmat", test_acpi_piix4_tcg_acpi_hmat); - qtest_add_func("acpi/q35/acpihmat", test_acpi_q35_tcg_acpi_hmat); - qtest_add_func("acpi/microvm", test_acpi_microvm_tcg); - qtest_add_func("acpi/microvm/usb", test_acpi_microvm_usb_tcg); - qtest_add_func("acpi/microvm/rtc", test_acpi_microvm_rtc_tcg); - qtest_add_func("acpi/microvm/ioapic2", test_acpi_microvm_ioapic2_tcg); - qtest_add_func("acpi/microvm/oem-fields", test_acpi_oem_fields_microvm); - if (strcmp(arch, "x86_64") == 0) { - qtest_add_func("acpi/microvm/pcie", test_acpi_microvm_pcie_tcg); + if (tcg_accel_available) { + qtest_add_func("acpi/q35/tpm-tis", test_acpi_q35_tcg_tpm_tis); + 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/q35/mmio64", test_acpi_q35_tcg_mmio64); + 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); + qtest_add_func("acpi/piix4/memhp", test_acpi_piix4_tcg_memhp); + qtest_add_func("acpi/q35/memhp", test_acpi_q35_tcg_memhp); + qtest_add_func("acpi/piix4/numamem", test_acpi_piix4_tcg_numamem); + qtest_add_func("acpi/q35/numamem", test_acpi_q35_tcg_numamem); + qtest_add_func("acpi/piix4/nosmm", test_acpi_piix4_tcg_nosmm); + qtest_add_func("acpi/piix4/smm-compat", + test_acpi_piix4_tcg_smm_compat); + qtest_add_func("acpi/piix4/smm-compat-nosmm", + test_acpi_piix4_tcg_smm_compat_nosmm); + qtest_add_func("acpi/piix4/nohpet", test_acpi_piix4_tcg_nohpet); + qtest_add_func("acpi/q35/nosmm", test_acpi_q35_tcg_nosmm); + qtest_add_func("acpi/q35/smm-compat", + test_acpi_q35_tcg_smm_compat); + qtest_add_func("acpi/q35/smm-compat-nosmm", + test_acpi_q35_tcg_smm_compat_nosmm); + qtest_add_func("acpi/q35/nohpet", test_acpi_q35_tcg_nohpet); + qtest_add_func("acpi/piix4/dimmpxm", test_acpi_piix4_tcg_dimm_pxm); + qtest_add_func("acpi/q35/dimmpxm", test_acpi_q35_tcg_dimm_pxm); + qtest_add_func("acpi/piix4/acpihmat", + test_acpi_piix4_tcg_acpi_hmat); + qtest_add_func("acpi/q35/acpihmat", test_acpi_q35_tcg_acpi_hmat); + qtest_add_func("acpi/microvm", test_acpi_microvm_tcg); + qtest_add_func("acpi/microvm/usb", test_acpi_microvm_usb_tcg); + qtest_add_func("acpi/microvm/rtc", test_acpi_microvm_rtc_tcg); + qtest_add_func("acpi/microvm/ioapic2", + test_acpi_microvm_ioapic2_tcg); + if (strcmp(arch, "x86_64") == 0) { + qtest_add_func("acpi/microvm/pcie", test_acpi_microvm_pcie_tcg); + } } } else if (strcmp(arch, "aarch64") == 0) { - qtest_add_func("acpi/virt", test_acpi_virt_tcg); - qtest_add_func("acpi/virt/numamem", test_acpi_virt_tcg_numamem); - qtest_add_func("acpi/virt/memhp", test_acpi_virt_tcg_memhp); - qtest_add_func("acpi/virt/pxb", test_acpi_virt_tcg_pxb); + if (tcg_accel_available) { + qtest_add_func("acpi/virt", test_acpi_virt_tcg); + qtest_add_func("acpi/virt/numamem", test_acpi_virt_tcg_numamem); + qtest_add_func("acpi/virt/memhp", test_acpi_virt_tcg_memhp); + qtest_add_func("acpi/virt/pxb", test_acpi_virt_tcg_pxb); + } qtest_add_func("acpi/virt/oem-fields", test_acpi_oem_fields_virt); } ret = g_test_run(); -- 2.26.3