From nobody Mon Feb 9 09:15:36 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=1620076291; cv=none; d=zohomail.com; s=zohoarc; b=bzwUFo6+wJoogQhgOMZjySyarFuTNZqD9aOZh9236JAY3IHaxslHuibWP/xMTMz8xA7QT44o8iLGRC0dSmlaCYizxtPN/nt+QRwR/9D5ULy2qaAYa6SxfXRvHht78ciE3k7werqTyPklq0Cs79qbpWqPFdI/kkhGDRJxiy+dkOU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1620076291; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=55DSOQd/Ti/CUKuyk0Cp1QnVj2/mT8NrttR0T4lOw2k=; b=hb1rzViqQ8JV91nuJqo2lU0RCma6tSGXGS42mxD/w9ja7Bf6r2sy56NZgaAw7wquz8bZaoveK2OuZGaD+W+yd7uN4YHvjzBSvSwxyyHlcMO9pH5U8f8AhJDJsJEgeQ1XY2dDjGlXPHD69bFyEc4BHw78fFRxk5PIdZrOR93rr/I= 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 162007629146015.523745000297026; Mon, 3 May 2021 14:11:31 -0700 (PDT) Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-241-L_JbTu2xMWu5zjcWU5YXDw-1; Mon, 03 May 2021 17:11:19 -0400 Received: by mail-wr1-f69.google.com with SMTP id t5-20020adfb7c50000b029010dd0bb24cfso4007375wre.2 for ; Mon, 03 May 2021 14:11:19 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.redhat.com (anancy-651-1-208-144.w109-217.abo.wanadoo.fr. [109.217.237.144]) by smtp.gmail.com with ESMTPSA id y5sm721079wmj.25.2021.05.03.14.11.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 May 2021 14:11:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1620076290; 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=55DSOQd/Ti/CUKuyk0Cp1QnVj2/mT8NrttR0T4lOw2k=; b=SuK/m+f3i4ullLCDceh72hqDiZYi6ND9LQtJQs0k4htliGgWQ1azVoFA6IHlVIvg/M+M+O wo1UKKJq6XaeWxPS4afxfqXDhgzFyyLKaP1nQFqCoUfFBUgejzDRPF4xxByXEYKbCqdGKo T8U1hNFOBK574nIQNgBD4b4CWobpmew= X-MC-Unique: L_JbTu2xMWu5zjcWU5YXDw-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=55DSOQd/Ti/CUKuyk0Cp1QnVj2/mT8NrttR0T4lOw2k=; b=Oss54BBVPnnxPA51U8kvOX2gVSoBL4saYR7ztFt4rPxJ/ANAOIXyyqytApN1OFx8fE qV1DaHGbYTaIzSOpIdKsKI4YyTOl8r8lFXcoq7xyig2dzFNFZHOjDLJF1h8dVq6JOpL6 EMbjXP86EJ3N2XCutnZaz3+BNU6P3wTBufuwNKaKp/jQKhahKGK6NcAUB3zI4fJu1Hk9 5GDnmrjCX48EcXcDEJMt+PGzj2XKZc28A08Key8rJdnkSa5mmqJtv2Mw2dbrF5MBgPUX p3rQHm8jV93lAR/CGIEbC46trTZ3DuwRT8TCmkvPUORDxAvufDarp0VKKXJC+Iljb7xJ O3Vw== X-Gm-Message-State: AOAM5336UZ/+c+/ycMgIUuR5Xwz9RlmzwD+AflVXgUbzfbbSAEDbTWXk VcwMn29B69mxL4PbYMJ2+IGHUlQa2fQs3AODhl6NqvB9YdjCPERjANiXgTechJGpnDBQeQMoTYS e/PXJ3AzOO7m5+Q== X-Received: by 2002:a5d:590a:: with SMTP id v10mr27356366wrd.306.1620076278575; Mon, 03 May 2021 14:11:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyV1qhTF/cSFGi6edJcm6U39w2RXor4odw2skyISAbixSE9bV3i2oLRbybHHM5Z1O7CgeQAjQ== X-Received: by 2002:a5d:590a:: with SMTP id v10mr27356350wrd.306.1620076278480; Mon, 03 May 2021 14:11:18 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: "Michael S. Tsirkin" , Thomas Huth , Markus Armbruster , Eric Blake , Paolo Bonzini , qemu-arm@nongnu.org, Igor Mammedov , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= Subject: [PATCH v6 11/12] qtest/bios-tables-test: Make test build-independent from accelerator Date: Mon, 3 May 2021 23:10:19 +0200 Message-Id: <20210503211020.894589-12-philmd@redhat.com> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20210503211020.894589-1-philmd@redhat.com> References: <20210503211020.894589-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 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. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Alex Benn=C3=A9e Reviewed-by: Eric Blake Reviewed-by: Igor Mammedov --- v5 had: Reviewed-by: Eric Blake Reviewed-by: Alex Benn=C3=A9e v6 is simplified and keeps the same logic, however since it is different, I'm not keeping the R-b tags. --- 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