From nobody Mon Feb 9 16:44:50 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1620219550; cv=none; d=zohomail.com; s=zohoarc; b=hSStHj0qDgHHGaSGoi8V86q20MVoI3TdkQD2/AgDr5C1iXk0M/SWvgre/3GoEKpvlwL9Ibs9JgzRfuLHngAbRqxUWmS4bdsIZqGr+mgT2HTXyxUg3I67NO1nvA95Tb14mlWTt0uwlzKQ465I3yjit2UBehTsrWQ6eHbK2KlRuzU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1620219550; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=NrRlnxcfy5rfyxKOgrn4KzLZv/0uqhFPtkaZ4qrEJ9Q=; b=e35rSQ/LMSK5CL38axgplkzH2pmSLRvr60deExXav7qoW1OUK2R5Yy/zquosqunw/NgDMRxeigX/+nMVWMq/wJKcQe7tXcDe/ZN00wX2VzAwg2XLCB4AdtsetaoFPKGi3iClKEQqpQ80P9UHkzxItXG8pYL+Wq2U4jwd8ouCsd8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1620219550092553.6321713442671; Wed, 5 May 2021 05:59:10 -0700 (PDT) Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-415-NsqGgxWcN_OIJt0b2RigQg-1; Wed, 05 May 2021 08:59:02 -0400 Received: by mail-wr1-f72.google.com with SMTP id x10-20020adfc18a0000b029010d83c83f2aso673302wre.8 for ; Wed, 05 May 2021 05:59:01 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.redhat.com (astrasbourg-653-1-188-220.w90-13.abo.wanadoo.fr. [90.13.127.220]) by smtp.gmail.com with ESMTPSA id z2sm21450346wrg.6.2021.05.05.05.59.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 May 2021 05:59:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1620219549; 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=NrRlnxcfy5rfyxKOgrn4KzLZv/0uqhFPtkaZ4qrEJ9Q=; b=ZYBKExx0hqRJFISiOpKtWMIJyWcV/wKG3Q3TDNqSlK+wmN9nMO1PwmK171gYlC0/q+jSw4 OpXTM8/Syg/GBpvW7jgJGTQmzot9yhzRylF2Lxn+RMma2ORfghEzg5E9GyxTvJlnBx3KX7 c4Ck9+BaoPMib6YCP9ocwZXlkT7Pm9Y= X-MC-Unique: NsqGgxWcN_OIJt0b2RigQg-1 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=NrRlnxcfy5rfyxKOgrn4KzLZv/0uqhFPtkaZ4qrEJ9Q=; b=WmU0LeWMrbVMDc+hB9LdzmhEWOmEWyjlWC3SR4Bv8EXcL24sRDaSbOQZcGemIayprs 8zI7tM/uKQ0Q6Rn4oPiCJZjpqxxPFgQrEc3bB32INhl1e7piAbty+iFzTSH52DYRo1xP fXsqptrV15x4t9e/vZI2qgU2lKg/vz+mKjtmLfZGG1CT9mB8bXE2yjeBWq4wZMNz+Ctf N071tmcxecTA5YzP+bEii92/ePxhA8nTKoFOvtNOi7I552LHKeyj7OCN1GKIIhYhpCRJ jB208w9DOdjoRbK+BBagy0NO/M3gnu0Fz0UUMmVQ2YQJdHpzK/A5+0JDs4kO41vqpyVK Zw0Q== X-Gm-Message-State: AOAM533sDq83JU67s029O90z372zMHUvvM8Xg6DBfiPnc4qIJ9E5LPu9 BKIqwm+I1Z5VlGvyx9KU2Hmnwscg6vBv6dUmtHdK1VxCwM1CIFOGpnBm+7m+cb0CIYySf4CJkXj iFNUGvF4jPhhvgg== X-Received: by 2002:a05:600c:4f96:: with SMTP id n22mr10004771wmq.117.1620219541014; Wed, 05 May 2021 05:59:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxlB1TotUYG8y+Lqpew5ljjsVF7MwbsMdq/wWf0PXdkHKCNifjwJLE6ZgWT5InkNlOTtByYLw== X-Received: by 2002:a05:600c:4f96:: with SMTP id n22mr10004759wmq.117.1620219540885; Wed, 05 May 2021 05:59:00 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Eric Blake , Igor Mammedov , "Michael S. Tsirkin" Subject: [PATCH v7 11/12] qtest/bios-tables-test: Make test build-independent from accelerator Date: Wed, 5 May 2021 14:58:05 +0200 Message-Id: <20210505125806.1263441-12-philmd@redhat.com> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20210505125806.1263441-1-philmd@redhat.com> References: <20210505125806.1263441-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: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Now that 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 Reviewed-by: Igor Mammedov Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- tests/qtest/bios-tables-test.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c index ad877baeb1b..762d154b340 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; =20 +static bool tcg_accel_available; static char disk[] =3D "tests/acpi-test-disk-XXXXXX"; static const char *data_dir =3D "tests/data/acpi"; #ifdef CONFIG_IASL @@ -718,12 +719,7 @@ static void test_acpi_one(const char *params, test_dat= a *data) char *args; bool use_uefi =3D data->uefi_fl1 && data->uefi_fl2; =20 -#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); =20 args =3D test_acpi_create_args(data, params, use_uefi); data->qts =3D qtest_init(args); @@ -1506,6 +1502,8 @@ int main(int argc, char *argv[]) =20 g_test_init(&argc, &argv, NULL); =20 + tcg_accel_available =3D qtest_has_accel("tcg"); + if (strcmp(arch, "i386") =3D=3D 0 || strcmp(arch, "x86_64") =3D=3D 0) { ret =3D boot_sector_init(disk); if (ret) { @@ -1554,10 +1552,10 @@ int main(int argc, char *argv[]) qtest_add_func("acpi/microvm/rtc", test_acpi_microvm_rtc); qtest_add_func("acpi/microvm/ioapic2", test_acpi_microvm_ioapic2); qtest_add_func("acpi/microvm/oem-fields", test_acpi_oem_fields_mic= rovm); - if (strcmp(arch, "x86_64") =3D=3D 0) { + if (strcmp(arch, "x86_64") =3D=3D 0 && tcg_accel_available) { qtest_add_func("acpi/microvm/pcie", test_acpi_microvm_pcie_tcg= ); } - } else if (strcmp(arch, "aarch64") =3D=3D 0) { + } else if (strcmp(arch, "aarch64") =3D=3D 0 && 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); --=20 2.26.3