From nobody Sun May 19 05:00:07 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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 170.10.133.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=1618489607; cv=none; d=zohomail.com; s=zohoarc; b=aPFtqNNOfYzr3PEfdj4bGrmBHBIy8AtLXnvrBEcVrAHoponAEIFGrr13Kp+NvF9LT8DHNT9c0bUhZWWWQSwxuUhVDFMDPTynqT4QrZDJfSqE3+TC12STMAt0PnDfp41YO6zVAhkQuc2B3xx6QaKO9Cx7TLAciDph/QOcekJo96c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1618489607; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=oX/D9vzkbuCupVtNwAphnCfZjmK6c7aD/BD5R7Zvb6A=; b=Ie/Tjv8PTtZHRXoJfW+ZLDAO3RbK1IDgxILcvN9LQ33cVE4YojpXsoA7dmErdpNTTLXYw/WlYQv78xfG0aT0EdCxVwjRA2YEPKJ24mKFlX0l/uU/H8DBLWLk97MJ6cMct5vv7Cf45FuHzjxMDyIL3h7jiU5ePNK6asoETH0SRtc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.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 [170.10.133.124]) by mx.zohomail.com with SMTPS id 1618489607595180.89146331336406; Thu, 15 Apr 2021 05:26:47 -0700 (PDT) Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-396-H5iBYhGVONG7se7FfeJS6w-1; Thu, 15 Apr 2021 08:26:42 -0400 Received: by mail-wm1-f71.google.com with SMTP id f14-20020a05600c154eb029010e7bebb623so4123379wmg.5 for ; Thu, 15 Apr 2021 05:26:42 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (39.red-81-40-121.staticip.rima-tde.net. [81.40.121.39]) by smtp.gmail.com with ESMTPSA id x8sm2812348wru.70.2021.04.15.05.26.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Apr 2021 05:26:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1618489606; 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=oX/D9vzkbuCupVtNwAphnCfZjmK6c7aD/BD5R7Zvb6A=; b=WgXCIfmAoCHB16Pmkql9bGjs3X66fCrWXGk8gr1zjaU2/CvQniIVAHaMptRKWVVy1tUA+H VuQIJXbEEhlp80I6zexNUZ5Q3o0VeDMsP8aqDx+mV0fEbyG/qwdM0luY8f+Utqxa4vtPD4 Z7A3W9gp0cCi6AVG+ycBWbCzuIOLpYA= X-MC-Unique: H5iBYhGVONG7se7FfeJS6w-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=oX/D9vzkbuCupVtNwAphnCfZjmK6c7aD/BD5R7Zvb6A=; b=frNpOK32QUyzlEhzKKf328l2U+6lMrOQa2Utujr80ghV050UAyRP+JT9mUvnn7RM3p aQOEfyExfAkbAvJ1PIlCIhJ2kZeM5WSncjtzS3fkUXOCh1EY0Zh+H1JE29IHgGKI6D00 avq7P7Nzh66R5OAda5eRZ4Bezzum3RmeWiz383Pe5RswtNbaGNbTVLVEbHqNCz9sZREq lqkYuWJ+km5D2yPb/a2cC+c4KSrS2oxbM1dRX8u4s8qzoaHjZXC3iIUOCAGzKfd1QnN0 t813AeRdLS4eEJiDTPB4JQSzgrCkUUgQrg2rKa3MVfPMwcYV3BVBYSoDX4MykEHRgKm0 dClw== X-Gm-Message-State: AOAM531Str7OXvjkgedocmMRsbjR+d6UOLc3s7Cvb/I+DSzlRPiCDBDi IBH4An4GBSoM5zFpihxjdCIXMcZUFe55Td16wDOAnpZ+ums5u8wkqt0meNvlen+a1mGVAtgDIes +hKhfHA5laI3yXQ== X-Received: by 2002:a1c:64c6:: with SMTP id y189mr3010386wmb.36.1618489601312; Thu, 15 Apr 2021 05:26:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy77SnwzzCTpW6dQaPt8XPrIwgcQTqMZAZLEF9ypayL1CVAvzWIwllZoO3iT4pNIEAypvZ4Qw== X-Received: by 2002:a1c:64c6:: with SMTP id y189mr3010375wmb.36.1618489601179; Thu, 15 Apr 2021 05:26:41 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Igor Mammedov , Markus Armbruster , Thomas Huth , Andrew Jones , qemu-arm@nongnu.org, "Michael S. Tsirkin" , Eduardo Habkost , Marcel Apfelbaum , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= , Claudio Fontana , Eric Blake , Richard Henderson , Laurent Vivier , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v3 1/6] accel: Introduce 'query-accels' QMP command Date: Thu, 15 Apr 2021 14:26:28 +0200 Message-Id: <20210415122633.4054644-2-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: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Introduce the 'query-accels' QMP command which returns a list of built-in accelerator names. - Accelerator is a QAPI enum of all existing accelerators, - AcceleratorInfo is a QAPI structure providing accelerator specific information. Currently the common structure base provides the name of the accelerator, while the specific part is empty, but each accelerator can expand it. - 'query-accels' QMP command returns a list of @AcceleratorInfo For example on a KVM-only build we get: { "execute": "query-accels" } { "return": [ { "name": "qtest" }, { "name": "kvm" } ] } Note that we can't make the enum values or union branches conditional because of target-specific poisoning of accelerator definitions. Reviewed-by: Eric Blake Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- Since v2: @since 6.0 -> 6.1, added note (Eric) Since v1: 'type' -> 'name' in comments --- qapi/machine.json | 49 +++++++++++++++++++++++++++++++++++++++++++++++ accel/accel-qmp.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++ accel/meson.build | 2 +- 3 files changed, 99 insertions(+), 1 deletion(-) create mode 100644 accel/accel-qmp.c diff --git a/qapi/machine.json b/qapi/machine.json index 6e90d463fc9..4babc06f8b0 100644 --- a/qapi/machine.json +++ b/qapi/machine.json @@ -1274,3 +1274,52 @@ ## { 'event': 'MEM_UNPLUG_ERROR', 'data': { 'device': 'str', 'msg': 'str' } } + +## +# @Accelerator: +# +# An enumeration of accelerator names. +# +# Since: 6.1 +## +{ 'enum': 'Accelerator', + 'data': [ 'qtest', 'tcg', 'kvm', 'hax', 'hvf', 'whpx', 'xen' ] } + +## +# @AcceleratorInfo: +# +# Accelerator information. +# +# @name: The accelerator name. +# +# Since: 6.1 +## +{ 'union': 'AcceleratorInfo', + 'base': {'name': 'Accelerator'}, + 'discriminator': 'name', + 'data': { } } + +## +# @query-accels: +# +# Get a list of AcceleratorInfo for all built-in accelerators. +# +# Returns: a list of @AcceleratorInfo describing each accelerator. +# +# Since: 6.1 +# +# Example: +# +# -> { "execute": "query-accels" } +# <- { "return": [ +# { +# "name": "qtest" +# }, +# { +# "name": "kvm" +# } +# ] } +# +## +{ 'command': 'query-accels', + 'returns': ['AcceleratorInfo'] } diff --git a/accel/accel-qmp.c b/accel/accel-qmp.c new file mode 100644 index 00000000000..426737b3f9a --- /dev/null +++ b/accel/accel-qmp.c @@ -0,0 +1,49 @@ +/* + * QEMU accelerators, QMP commands + * + * Copyright (c) 2021 Red Hat Inc. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "qemu/osdep.h" +#include "qapi/qapi-commands-machine.h" + +static const bool accel_builtin_list[ACCELERATOR__MAX] =3D { + [ACCELERATOR_QTEST] =3D true, +#ifdef CONFIG_TCG + [ACCELERATOR_TCG] =3D true, +#endif +#ifdef CONFIG_KVM + [ACCELERATOR_KVM] =3D true, +#endif +#ifdef CONFIG_HAX + [ACCELERATOR_HAX] =3D true, +#endif +#ifdef CONFIG_HVF + [ACCELERATOR_HVF] =3D true, +#endif +#ifdef CONFIG_WHPX + [ACCELERATOR_WHPX] =3D true, +#endif +#ifdef CONFIG_XEN_BACKEND + [ACCELERATOR_XEN] =3D true, +#endif +}; + +AcceleratorInfoList *qmp_query_accels(Error **errp) +{ + AcceleratorInfoList *list =3D NULL, **tail =3D &list; + + for (Accelerator accel =3D 0; accel < ACCELERATOR__MAX; accel++) { + if (accel_builtin_list[accel]) { + AcceleratorInfo *info =3D g_new0(AcceleratorInfo, 1); + + info->name =3D accel; + + QAPI_LIST_APPEND(tail, info); + } + } + + return list; +} diff --git a/accel/meson.build b/accel/meson.build index b44ba30c864..7a48f6d568d 100644 --- a/accel/meson.build +++ b/accel/meson.build @@ -1,4 +1,4 @@ -specific_ss.add(files('accel-common.c')) +specific_ss.add(files('accel-common.c', 'accel-qmp.c')) softmmu_ss.add(files('accel-softmmu.c')) user_ss.add(files('accel-user.c')) =20 --=20 2.26.3 From nobody Sun May 19 05:00:07 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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 170.10.133.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=1618489612; cv=none; d=zohomail.com; s=zohoarc; b=Dab9xvoO5394Ls8JBWROV6x6AiWQsvlhLNgaa4Gcgrws4D16kZxcCNfQOa0kn/TF9W2iQr0WkXw5J36lwZIvrbmnRgcCH167ZYcfTiNBVmV/+t11ubPmXlieqcW253nPyEtApsYVo5RwDPP581u1NKUUEb7wTAK8rSxFKsD4q6M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1618489612; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=WU1rsuPZSbiXCb5ZUrh9An1Xj0dCMP/3YS/3/3XzJFk=; b=AHQ6EX+c76K1nd4JWbMmyKvMaXOYUSIl6lXiG49/z27rHvqMB5OS0OhOK2tKrjl5ErELv20oW0mxnFyKAOaKThtiYq8WF7cT46vDt879zA749aNf2QqM2suFMq5uDTecDCyHvooCbuut1GhVsLmkLBDnCvz5Sueq8OsE4GAwU0A= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.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 [170.10.133.124]) by mx.zohomail.com with SMTPS id 1618489612394669.5998368940806; Thu, 15 Apr 2021 05:26:52 -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-64-yFYepM-ZOua0VOq6l65ikw-1; Thu, 15 Apr 2021 08:26:47 -0400 Received: by mail-wr1-f69.google.com with SMTP id l18-20020a0560000232b02901026f4b8548so2689061wrz.10 for ; Thu, 15 Apr 2021 05:26:47 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (39.red-81-40-121.staticip.rima-tde.net. [81.40.121.39]) by smtp.gmail.com with ESMTPSA id x17sm1399684wmi.46.2021.04.15.05.26.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Apr 2021 05:26:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1618489611; 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=WU1rsuPZSbiXCb5ZUrh9An1Xj0dCMP/3YS/3/3XzJFk=; b=NMH9F2XzumnaE3zEHUYPvf3o5kkJ8g0XsbXA/4csCYVfnvFy2m1cKaJDEVYvsVtMRFVOQp 1WjcqIM1BYC1VO0Bz2KgTaoL6d0ByXUi2rpUlER0acV5F9VykJ8GbIlrGa+BRAwhyfJ3yA BgtJHStPqplCxmSxDH396pg/iqISKmQ= X-MC-Unique: yFYepM-ZOua0VOq6l65ikw-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=WU1rsuPZSbiXCb5ZUrh9An1Xj0dCMP/3YS/3/3XzJFk=; b=FVyftt7GJxSxdKPQR3SCaYn1nB3XGHrt6+Uo5lHc3ppqaB5Hrf0q41tNz/zjKoZOl9 uHAIgNIn67h7MYq6wisBVoaeExHyr/++dHFG2gMLUX30KswGLiC+C9z2ejTQJxCVYcvS BFOQ3ltucVe/jOQU5/6DZ4omSF8ceDP/i7m7GHu0TVTpGym53ZZdEmZ/Gydtvirhyh17 RRqhZ3UhC0JXfjt3qDrAEakdt1Q1gP8+YruDDuJzkYDV52kNOBcthwRsxkxTy662klPu zH8lBMMg88293mQxPRxjUXBAD+QJLwzUSulnn1OQl+tBoJ/iBQvL2L09Yj6tfc/gDAYY GAlg== X-Gm-Message-State: AOAM530qNygFJgeOysiTz9TROaO5EdQttuJ0DAYE5xRlF8VFb1gNFFHS tJKYd4Hu9Kxq5P3xUPNdasF4dQbQ4k0lOWuwHQxGV5fftfsSzGO2f37oTO3MMDa1fb0H5OoOGX2 fcKEI8v1DxISzWg== X-Received: by 2002:adf:d1ce:: with SMTP id b14mr2619748wrd.159.1618489606358; Thu, 15 Apr 2021 05:26:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzB90NWbYaE7b8Gf0ZunPtbrJC+NSXfcFzScvhaN2FMv+oN+b1BXp3u+mFGGp9PD013jpJoIg== X-Received: by 2002:adf:d1ce:: with SMTP id b14mr2619727wrd.159.1618489606241; Thu, 15 Apr 2021 05:26:46 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Igor Mammedov , Markus Armbruster , Thomas Huth , Andrew Jones , qemu-arm@nongnu.org, "Michael S. Tsirkin" , Eduardo Habkost , Marcel Apfelbaum , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= , Claudio Fontana , Eric Blake , Richard Henderson , Laurent Vivier , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v3 2/6] tests/qtest: Add qtest_has_accel() method Date: Thu, 15 Apr 2021 14:26:29 +0200 Message-Id: <20210415122633.4054644-3-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: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Introduce the qtest_has_accel() method which allows a runtime query on whether a QEMU instance has an accelerator built-in. Reviewed-by: Eric Blake Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- Since v2: - reworded (Eric) Since v1: - rename qtest_probe_accel() -> qtest_has_accel() - run with -machine none before creating QTestState --- tests/qtest/libqos/libqtest.h | 8 ++++++++ tests/qtest/libqtest.c | 29 +++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/tests/qtest/libqos/libqtest.h b/tests/qtest/libqos/libqtest.h index a68dcd79d44..d80c618c18d 100644 --- a/tests/qtest/libqos/libqtest.h +++ b/tests/qtest/libqos/libqtest.h @@ -763,6 +763,14 @@ void qmp_expect_error_and_unref(QDict *rsp, const char= *class); */ bool qtest_probe_child(QTestState *s); =20 +/** + * qtest_has_accel: + * @accel_name: Accelerator name to check for. + * + * Returns: true if the accelerator is built in. + */ +bool qtest_has_accel(const char *accel_name); + /** * qtest_set_expected_status: * @s: QTestState instance to operate on. diff --git a/tests/qtest/libqtest.c b/tests/qtest/libqtest.c index 71e359efcd3..2156b7e3972 100644 --- a/tests/qtest/libqtest.c +++ b/tests/qtest/libqtest.c @@ -393,6 +393,35 @@ QTestState *qtest_init_with_serial(const char *extra_a= rgs, int *sock_fd) return qts; } =20 +bool qtest_has_accel(const char *accel_name) +{ + bool has_accel =3D false; + QDict *response; + QList *accels; + QListEntry *accel; + QTestState *qts; + + qts =3D qtest_initf("-accel qtest -machine none"); + response =3D qtest_qmp(qts, "{'execute': 'query-accels'}"); + accels =3D qdict_get_qlist(response, "return"); + + QLIST_FOREACH_ENTRY(accels, accel) { + QDict *accel_dict =3D qobject_to(QDict, qlist_entry_obj(accel)); + const char *name =3D qdict_get_str(accel_dict, "name"); + + if (g_str_equal(name, accel_name)) { + has_accel =3D true; + break; + } + } + qobject_unref(response); + + qtest_quit(qts); + + return has_accel; +} + + void qtest_quit(QTestState *s) { qtest_remove_abrt_handler(s); --=20 2.26.3 From nobody Sun May 19 05:00:07 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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 170.10.133.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=1618489618; cv=none; d=zohomail.com; s=zohoarc; b=Xc7Nk9PSQeXxPwAGoIw7GLwIh0CJj7YRM8T9PCDyYwvsx0Pjadea275/iu+Qbm2mI+nocGsTs8fv5NqC1HRjVCC+fsBabJv59EYwmHDS4H5G3PNbIGgZrc+qyDXh5paulAer0hkYMMW2mpOc+FRR9ne8Z4axmKkdLDfABLSYq0g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1618489618; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=tOeJRHeQ91TF8arzY33TfEs4YUKLXq9d/m6dOUlZ5Uw=; b=F8/nKKjBzgK8wnYgW3i/Asn7Fj+PC1NXixjiiPaxSDtmxFbemN6NxI9k/D8fgKMFU2QJkqLcZ9buRXC9Gq8y223N3AeW5Yii5UQI5uTuPp6rfGa4Fgt3C5xAWF33csR7PUescGKL3SwJGmNUUDLB0VE9xfuPC7z+V2Xizvc8ZXQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.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 [170.10.133.124]) by mx.zohomail.com with SMTPS id 1618489618218821.0089797930085; Thu, 15 Apr 2021 05:26:58 -0700 (PDT) Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-480-i54iakboPqiRfAykX3xqhQ-1; Thu, 15 Apr 2021 08:26:53 -0400 Received: by mail-wm1-f70.google.com with SMTP id g21-20020a1c4e150000b0290125a227e5bbso2828267wmh.0 for ; Thu, 15 Apr 2021 05:26:52 -0700 (PDT) Return-Path: Return-Path: 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1618489615; 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=h7rMyxJ/9GIPFMrO/0mxey7PSbUqs7On1ULU4SLB1s77wGnt2O2xZWTjbt2OWAOo36goJe ifnYChfLEyU1ZbG3O2jVRFcrJShCQsN8SzybRF2QBspqDNbKXVLYwgv3hvLG+hBqmG5BVF RNSDxyl93lQGNNnypRHD/ftGvOoINHY= X-MC-Unique: i54iakboPqiRfAykX3xqhQ-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=tOeJRHeQ91TF8arzY33TfEs4YUKLXq9d/m6dOUlZ5Uw=; b=pJ/Gq5CXx0+UirAgdR6EUSmJ/9lt9+xqk8iKJTU26lkXZYE+ePNg+R04mECI+Y9XYf JJ+DPytNly5ug9l0HbIO3gsv1USL2RdhUOSdbJOEg1B9D8kG6XpA9Sw9W5WGIDJvijWm gRSUTXznVUcYJD6u1ijf7VhBiQd8KerUgSb4lQbVPp5NxsjgWPw5LWgcX2kTaKDpfsav k+9h2z9HKNsKLMuYaCNAOZvCucmBwI1BkS6iVAOAfN9OWWC7MhJ7WVqpeibFdtxMX/cJ +bBh5U2yOA7siaKovFSoOsJJT309gXsdCA3iJkmEoam7pBSDcyS+oyO1rWXJ1jckPqo3 +aLg== X-Gm-Message-State: AOAM533VG3rgisjpRYST5OzNvbTdW+6YNyW9VBQybn9InlJYo0EXohqI 6lBo9c5EEU3HNQUK2zPVAbRBlGH1/vFOlFxtMTQEfZshy1xLn5BV65NzzDeyEe131X28395sPoa 1y1+8HabTkP4C/A== X-Received: by 2002:a5d:550f:: with SMTP id b15mr3338567wrv.251.1618489611598; Thu, 15 Apr 2021 05:26:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwCp1FUcz2HjWsOSUtXdHsiauYR74k09wwS+BxetNhwZyGgYzqhESLyq4fx9CvqN7hHd5iA2A== X-Received: by 2002:a5d:550f:: with SMTP id b15mr3338542wrv.251.1618489611413; Thu, 15 Apr 2021 05:26:51 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Igor Mammedov , Markus Armbruster , Thomas Huth , Andrew Jones , qemu-arm@nongnu.org, "Michael S. Tsirkin" , Eduardo Habkost , Marcel Apfelbaum , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= , Claudio Fontana , Eric Blake , Richard Henderson , Laurent Vivier , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= 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: 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. Reviewed-by: Eric Blake Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- 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; =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,15 +719,11 @@ static void test_acpi_one(const char *params, test_da= ta *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); + test_acpi_load_tables(data, use_uefi); =20 if (getenv(ACPI_REBUILD_EXPECTED_AML)) { @@ -1504,6 +1501,8 @@ int main(int argc, char *argv[]) const char *arch =3D qtest_get_arch(); int ret; =20 + tcg_accel_available =3D qtest_has_accel("tcg"); + g_test_init(&argc, &argv, NULL); =20 if (strcmp(arch, "i386") =3D=3D 0 || strcmp(arch, "x86_64") =3D=3D 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_mic= rovm); 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_hma= t); - 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_t= cg); - qtest_add_func("acpi/microvm/oem-fields", test_acpi_oem_fields_mic= rovm); - if (strcmp(arch, "x86_64") =3D=3D 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_numam= em); + 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_hma= t); + 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") =3D=3D 0) { + qtest_add_func("acpi/microvm/pcie", test_acpi_microvm_pcie= _tcg); + } } } else if (strcmp(arch, "aarch64") =3D=3D 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 =3D g_test_run(); --=20 2.26.3 From nobody Sun May 19 05:00:07 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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 170.10.133.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=1618489622; cv=none; d=zohomail.com; s=zohoarc; b=Chxn9kR/vi99jt0xaA2U8vG2mCR/6vNc4DmXJSO3kUxWmUjNnvXMEpTm2Jsl+NojGMBec7MOmIGgZqU+Skm95m7To+lJHEzCXZjPUFHVhaZh5HMSxebqi4NtAH2WAVi2U1zf9bcR2L09Re8MNcMczCYWBpWPRBn+PZZF7uR/iOs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1618489622; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=gXF3I2HiTrXmapky2sFUIdU4HSA6Nendcs7h4VxHKIw=; b=h3jCoKwXisuPv5pqA6E5cjQY6RAHXfEkIJqwTWjIsFLuwGLzl7yoLlQTtuL4mwxy2fZhLQSlspuvo5HFZf5UZo5lpQlryhOzDB6JDHciO0ybaxLiWe+MaPZgYF1hDQn5s9+3aKrDzRBH+ky8wiz+NZQY1W1uL0lWNM9uFov+g7I= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.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 [170.10.133.124]) by mx.zohomail.com with SMTPS id 1618489622848787.1108216853465; Thu, 15 Apr 2021 05:27:02 -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-200-TdMdxAxMO4a1a6oQkiBZ7g-1; Thu, 15 Apr 2021 08:26:58 -0400 Received: by mail-wr1-f69.google.com with SMTP id j16-20020adfd2100000b02901022328749eso2676304wrh.4 for ; Thu, 15 Apr 2021 05:26:57 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (39.red-81-40-121.staticip.rima-tde.net. [81.40.121.39]) by smtp.gmail.com with ESMTPSA id p18sm2754498wrs.68.2021.04.15.05.26.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Apr 2021 05:26:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1618489621; 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=gXF3I2HiTrXmapky2sFUIdU4HSA6Nendcs7h4VxHKIw=; b=T/QOQntbwSahbn9uBN8Kp0fCa8oL7haIJOQNJEYjDdkOUy3wnESxGQfrfT6BQCN11YHs/G 0fM9l785iaQM2i3A/fyDEHtz2gGxiiyOEjidYHz7eKB+B+LeD/8ceCcLKst4oBo1Y/T0N4 3LTi2xCaQlacduDm8o7OHe4zCPvN03M= X-MC-Unique: TdMdxAxMO4a1a6oQkiBZ7g-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=gXF3I2HiTrXmapky2sFUIdU4HSA6Nendcs7h4VxHKIw=; b=jEwnqSGIOLvbcO3ykxabaPdN+VMZRh1ZWL+3D5hAAqyMnHfzH1To9JKhRlrLkIynLG M9IQmQXTEhUgS329UepJVZ7XTiEri+JbrioV7LwXgjcWT0bSQ9OaY3m9G0zAzY9dWwx3 4xlpgkge/IwQZ3q21OmaDNi4JXACkNJyzc/9dxwv8fRr4I6hvhgm8BSw28RxzTWWWq5Z Ogtwjpj6B2QQkDoYCMfayHv6bvySKxFaOT1PA280UTmIQrKZ1tcdYeyPt9kMNV7kxL8T L25CyoiXXtV5KKxfhyxyJFIZqNNXgXlNxo+lPBpgRgDEr+LmqfJxPZK4srSTrfKS15N5 ETxA== X-Gm-Message-State: AOAM532NHpJOqhIIwhP7Hx+4DCV73TmC9EDoGfP/tHcl8KcbmzOAWxOH bgzLV7gTU2xJCWlzgjUPyCZ0pgYEAx+MSCUPMCwsstXU1gLiMz8K93JZmm6f5UyERA94u2Y+LKt YZqwBqwHrVCAZBg== X-Received: by 2002:a1c:6244:: with SMTP id w65mr2923514wmb.27.1618489616705; Thu, 15 Apr 2021 05:26:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy8J+lFcTf5KIFEhbrwHJ6+rzq/h6zamQqjhIsLdqljew46wDI+MFnjCaFqLakdx3bbxihSRg== X-Received: by 2002:a1c:6244:: with SMTP id w65mr2923493wmb.27.1618489616564; Thu, 15 Apr 2021 05:26:56 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Igor Mammedov , Markus Armbruster , Thomas Huth , Andrew Jones , qemu-arm@nongnu.org, "Michael S. Tsirkin" , Eduardo Habkost , Marcel Apfelbaum , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= , Claudio Fontana , Eric Blake , Richard Henderson , Laurent Vivier , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v3 4/6] qtest/qmp-cmd-test: Make test build-independent from accelerator Date: Thu, 15 Apr 2021 14:26:31 +0200 Message-Id: <20210415122633.4054644-5-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: 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 a runtime check. Suggested-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- tests/qtest/qmp-cmd-test.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/tests/qtest/qmp-cmd-test.c b/tests/qtest/qmp-cmd-test.c index c98b78d0339..8902d2f169f 100644 --- a/tests/qtest/qmp-cmd-test.c +++ b/tests/qtest/qmp-cmd-test.c @@ -21,19 +21,24 @@ const char common_args[] =3D "-nodefaults -machine none= "; =20 /* Query smoke tests */ =20 +static bool tcg_accel_available; + static int query_error_class(const char *cmd) { - static struct { + static const struct { const char *cmd; int err_class; + /* + * Pointer to boolean. + * If non-NULL and value is %true, the error class is skipped. + */ + bool *skip_err_class; } fails[] =3D { /* Success depends on build configuration: */ #ifndef CONFIG_SPICE { "query-spice", ERROR_CLASS_COMMAND_NOT_FOUND }, #endif -#ifndef CONFIG_TCG - { "query-replay", ERROR_CLASS_COMMAND_NOT_FOUND }, -#endif + { "query-replay", ERROR_CLASS_COMMAND_NOT_FOUND, &tcg_accel_availa= ble }, #ifndef CONFIG_VNC { "query-vnc", ERROR_CLASS_GENERIC_ERROR }, { "query-vnc-servers", ERROR_CLASS_GENERIC_ERROR }, @@ -51,6 +56,9 @@ static int query_error_class(const char *cmd) int i; =20 for (i =3D 0; fails[i].cmd; i++) { + if (fails[i].skip_err_class && *fails[i].skip_err_class) { + continue; + } if (!strcmp(cmd, fails[i].cmd)) { return fails[i].err_class; } @@ -334,6 +342,8 @@ int main(int argc, char *argv[]) QmpSchema schema; int ret; =20 + tcg_accel_available =3D qtest_has_accel("tcg"); + g_test_init(&argc, &argv, NULL); =20 qmp_schema_init(&schema); --=20 2.26.3 From nobody Sun May 19 05:00:07 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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 170.10.133.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=1618489625; cv=none; d=zohomail.com; s=zohoarc; b=BFxnLykBeCH2nkvN5dwQCxb4Rr8Vmk1J6+Js/2SNPm6TNUNkV2TCDYOrflyT5D2ZtVlUvcY/d9LBAWarOjy8uy7bnU1nX8O7LJazbjbTn9f/Z0RnzvadnhnGChbw3ncqZ7L/tZ+GWWtSYLiPyJTPuZOFfducVxaEM2ptVO3E1AI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1618489625; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=VGzikIBP/Z5SEBvKQqeWbm5PvQswPv/9xcZd1fSf1xk=; b=CjvkZaFyCGtG3krwMjH111449r1hJXXLCQf/tyZV+Y1WhQAxx5R/cSHQDdMcQ+//rBljkAPwTZoOBTAKvSrzkLUqGka2cTTt3E+PW2k1w7b3S0E8yLsweuGnWYPmFOUbI54KJeCd9Ak8S723UImogA4qUPq91dJuKwbLQLoGmXI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.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 [170.10.133.124]) by mx.zohomail.com with SMTPS id 1618489625866550.357409544422; Thu, 15 Apr 2021 05:27:05 -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-186-YAFVBSK5P_mdfGznvBmLKQ-1; Thu, 15 Apr 2021 08:27:03 -0400 Received: by mail-wr1-f72.google.com with SMTP id l18-20020a0560000232b02901026f4b8548so2689317wrz.10 for ; Thu, 15 Apr 2021 05:27:02 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (39.red-81-40-121.staticip.rima-tde.net. [81.40.121.39]) by smtp.gmail.com with ESMTPSA id u3sm2456551wmg.48.2021.04.15.05.27.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Apr 2021 05:27:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1618489624; 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=VGzikIBP/Z5SEBvKQqeWbm5PvQswPv/9xcZd1fSf1xk=; b=ggBUHSuSDXbFNETPJsNn5M3bZAyYLqQu0xCq46rpqJUFVaN11MiBjIYRi9B4jVSx0mLAVt uOE6q7T0D5Bnil6H1lqgLdox7ocaBb6kb5jYD+1LPS+U/Ynn2Pgl4W/E44/IXd8efuBeDI zKpOs193WJQO7iTQEa2z87musoGKb1w= X-MC-Unique: YAFVBSK5P_mdfGznvBmLKQ-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=VGzikIBP/Z5SEBvKQqeWbm5PvQswPv/9xcZd1fSf1xk=; b=nWaurc3J3Y8OHyBYPbgl5TOd18zw5Ngmx9+EZu1+hmWiByomOapxGXCdA4x9d7lTK6 Zm1lHRAxvmbHfgIntvTDMgsCib86nBfyK8hcdzcnj0BI63GuLKJbI5GiJDnmJuit+QTZ oNNRgyTatIAhaodzJu+IgIyM5HxykwXBTjDs/6Lu2Ww9t6wAa90O0NHwLWCh9uE/3bc2 Pwm6gRkr+QA3Wus1VYWaWEDazhzlJaSCbA/9aWcGqebU6qaRPheOjsXA0IIv/rVEgSRq 9OfpuiIxiQ9LXiS75mh/cx1JLB5k88wiH9GSV3Y1lxFRqCYXAUdPieYv/kMZyxuro08B drUQ== X-Gm-Message-State: AOAM533wBDMy0DHFVO5nIlNEzAhNmvFLploGpRXANtrqfvODhbhifmNf lc4AIG71H6HVSCQJA0OPdc2ra/5f8IPjqL8dMFoPgAzf3vd/F9LoDCNY8eCHtktg5gZET58q/3w QUcmUFPgpe4vwRw== X-Received: by 2002:a05:600c:649:: with SMTP id p9mr3008089wmm.47.1618489621839; Thu, 15 Apr 2021 05:27:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxC5NXLBgOzOhUouyDApWFT7C8LlF+mZV5ojCSMSkE36v7aKPPrnEJCbdjyb290Dn6K+qcTvQ== X-Received: by 2002:a05:600c:649:: with SMTP id p9mr3008057wmm.47.1618489621666; Thu, 15 Apr 2021 05:27:01 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Igor Mammedov , Markus Armbruster , Thomas Huth , Andrew Jones , qemu-arm@nongnu.org, "Michael S. Tsirkin" , Eduardo Habkost , Marcel Apfelbaum , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= , Claudio Fontana , Eric Blake , Richard Henderson , Laurent Vivier , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v3 5/6] tests/qtest: Do not restrict bios-tables-test to Aarch64 hosts anymore Date: Thu, 15 Apr 2021 14:26:32 +0200 Message-Id: <20210415122633.4054644-6-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: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Since commit 82bf7ae84ce ("target/arm: Remove KVM support for 32-bit Arm hosts") we can remove the comment / check added in commit ab6b6a77774 and directly run the bios-tables-test. Reviewed-by: Eric Blake Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- tests/qtest/meson.build | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build index 0c767389217..46de073d155 100644 --- a/tests/qtest/meson.build +++ b/tests/qtest/meson.build @@ -175,14 +175,13 @@ 'boot-serial-test', 'hexloader-test'] =20 -# TODO: once aarch64 TCG is fixed on ARM 32 bit host, make bios-tables-tes= t unconditional qtests_aarch64 =3D \ - (cpu !=3D 'arm' ? ['bios-tables-test'] : []) + = \ (config_all_devices.has_key('CONFIG_TPM_TIS_SYSBUS') ? ['tpm-tis-device-= test'] : []) + \ (config_all_devices.has_key('CONFIG_TPM_TIS_SYSBUS') ? ['tpm-tis-device-= swtpm-test'] : []) + \ ['arm-cpu-features', 'numa-test', 'boot-serial-test', + 'bios-tables-test', 'xlnx-can-test', 'migration-test'] =20 --=20 2.26.3 From nobody Sun May 19 05:00:07 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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 170.10.133.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=1618489632; cv=none; d=zohomail.com; s=zohoarc; b=CbA0yQE/6TVZMgF7N0+GaOLmDExaIvStcOa1U+R//LExWtweVncj3iaUI7mCr2muhk9RXa/DAW6tgZdbXJLVeXGTCx4f8FXzE7fDXpqy6efCDHuQp39Lcd4lmKh0xb3xP5QZr2Bd7EDujTF+Vs+EJcZQDKvfmpgbSjM4WvweFoM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1618489632; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=sTefL8KFB03yS8Z+kdiNHNixKSuiXSG+jyZydBtqNkg=; b=YlMDupCmypgQREXyRPsiNZzqfMHs087d8DJEEgK7sMvE5kb1Y9pBhM97tN103333+nX0vWa4lxHidv6zqZUVopFFo0hym0XNqwTj2dsknZ3dDCejtwEVr2aYNZXDOwRZkMmAoaSugF7UswubHxeOwlOm+/dv5tVF8/J9ZPYvfOk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.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 [170.10.133.124]) by mx.zohomail.com with SMTPS id 1618489632907901.8425614082925; Thu, 15 Apr 2021 05:27:12 -0700 (PDT) Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-128-OKQ3pFcyOH6ISga3JkIVEw-1; Thu, 15 Apr 2021 08:27:08 -0400 Received: by mail-wm1-f69.google.com with SMTP id o16-20020a05600c4fd0b0290114d6580911so4118243wmq.8 for ; Thu, 15 Apr 2021 05:27:08 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (39.red-81-40-121.staticip.rima-tde.net. [81.40.121.39]) by smtp.gmail.com with ESMTPSA id q5sm3014005wrv.17.2021.04.15.05.27.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Apr 2021 05:27:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1618489630; 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=sTefL8KFB03yS8Z+kdiNHNixKSuiXSG+jyZydBtqNkg=; b=AfRz/DCPCaBzJWAD1IZY8Z69tYVE4ZpxKMHxCRtlWoG8b+PcfHEZJ6S0MH1JjrAFBd+nqi C86Pw58eIRZzj8NhJoskEM+VFEbJwa3KJsGIgyKBNOoZ02trrkqpZEpowPXjoTrIrGdN9/ dQO61NfsBapX81Z8zm1u5DeSbIIkKpk= X-MC-Unique: OKQ3pFcyOH6ISga3JkIVEw-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=sTefL8KFB03yS8Z+kdiNHNixKSuiXSG+jyZydBtqNkg=; b=VzGupymFWpwG6h1CxRkh+Qcc8I8cB/7Tmxj19vctxh61y+QDafYlaA9ILLQ3Z7LYNS vpR8AxMakrilo8yRsRAgmKozCmueiydrE60NGZqRavKAGRx8mepgYM+Fk5/xeJgSv8Yi 0j9sK0kT/t4cgDMxrscx5AjVSexPKPlMjUwqhd8cfv3xobHtJe2NBPSK/hZY4wKj6FnW H5/n7ufXI9tpjB7/Mg3qnwufioEipseC8HhuNHouUuZdg80rowO4VgDJO4b7Jp/X9XxA OTP56uI5MBffdmvYK9a26IJHjzjBWypnDA4LkiA97dncivPPU8SH2dS6yt0L4RcuY1zw ddDw== X-Gm-Message-State: AOAM532kbodPcDMzaVPYoIg8DNCi5gIAyFuycYv000LNqYcIaPFUI6wb +mfcEsNJdTxttiC+5DE7J/J7LAL6UKor6Z8x73rmko621/EjMNjqLVKuh3SBiK8GTwgkTVlCQE1 YDZKojvReY/1Rwg== X-Received: by 2002:a05:6000:1564:: with SMTP id 4mr1781769wrz.197.1618489627063; Thu, 15 Apr 2021 05:27:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxZAiOPR+Qhi3AUy09fgxkgg+Rre7WuZBPsycy6ykBF0cHFL3asGkc4vd28EHzUJevZprqzqA== X-Received: by 2002:a05:6000:1564:: with SMTP id 4mr1781763wrz.197.1618489626954; Thu, 15 Apr 2021 05:27:06 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Igor Mammedov , Markus Armbruster , Thomas Huth , Andrew Jones , qemu-arm@nongnu.org, "Michael S. Tsirkin" , Eduardo Habkost , Marcel Apfelbaum , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= , Claudio Fontana , Eric Blake , Richard Henderson , Laurent Vivier , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= , "Emilio G . Cota" Subject: [PATCH v3 6/6] tests/meson: Only build softfloat objects if TCG is selected Date: Thu, 15 Apr 2021 14:26:33 +0200 Message-Id: <20210415122633.4054644-7-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: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) From: Philippe Mathieu-Daud=C3=A9 The previous attempt (commit f77147cd4de) doesn't work as expected, as we still have CONFIG_TCG=3D1 when using: configure --disable-system --disable-user Now than we have removed the use of CONFIG_TCG from target-dependent files in tests/qtest/, we can remove the unconditional definition of CONFIG_TCG in config_host. This avoid to build a bunch of unrequired objects when building with --disable-tcg (in particular the softfloat tests): Before: $ make [1/812] Generating trace-qom.h with a custom command ... After: $ make [1/349] Generating trace-qom.h with a custom command ... A difference of 463 objects... Reported-by: Claudio Fontana Suggested-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- v3: Include Paolo's feedback: https://www.mail-archive.com/qemu-devel@nongnu.org/msg793872.html therefore o not include Alex's R-b tag. Cc: Richard Henderson Cc: Alex Benn=C3=A9e Cc: Emilio G. Cota --- meson.build | 1 - 1 file changed, 1 deletion(-) diff --git a/meson.build b/meson.build index c6f4b0cf5e8..623cbe50685 100644 --- a/meson.build +++ b/meson.build @@ -262,7 +262,6 @@ language: ['c', 'cpp', 'objc']) =20 accelerators +=3D 'CONFIG_TCG' - config_host +=3D { 'CONFIG_TCG': 'y' } endif =20 if 'CONFIG_KVM' not in accelerators and get_option('kvm').enabled() --=20 2.26.3 From nobody Sun May 19 05:00:07 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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 170.10.133.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=1618491464; cv=none; d=zohomail.com; s=zohoarc; b=Nt7b/9ZhzME1rtFhCFwMUJABqMa7cHtDfguF1DpnphpO3V3V2oiicWuG4IpmTsG4Yrm+ROu4atHNT3YgrGiW/D9dsMWOyI9oihW1W+rEhSwlb6oBvngPUAZtZmqgIJX1KBKoE383YVjcQxn4QumB1m5ghTLeCRUsTCO5QKtpM+g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1618491464; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=guk+TFRH4H8npjA92ucehbcfrQY0sqYaSCHgw+fxV9U=; b=ZaiaHP+rSDlxG/zZ3ws4gf8Tu8RJMYUzbS6iiEgc7nj4fWz8GTGWVcDK/BTtXiDDP7RH0hQ8sfl6UrNtmNt1b2OMlI/Xkty9Yxz/CwqyYlKZ7zDcU+YzygNMYDqhbokWgNn7TpEAxEvPr7NmGITaLrbLwHu830q+cDHUT47XQFc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.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 [170.10.133.124]) by mx.zohomail.com with SMTPS id 16184914639961013.0099766073464; Thu, 15 Apr 2021 05:57:43 -0700 (PDT) Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-486-S3uQesrXOwypbQuGWEm0Jw-1; Thu, 15 Apr 2021 08:57:41 -0400 Received: by mail-wr1-f71.google.com with SMTP id j16-20020adfd2100000b02901022328749eso2708927wrh.4 for ; Thu, 15 Apr 2021 05:57:40 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (39.red-81-40-121.staticip.rima-tde.net. [81.40.121.39]) by smtp.gmail.com with ESMTPSA id 24sm3016453wmk.18.2021.04.15.05.57.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Apr 2021 05:57:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1618491462; 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=guk+TFRH4H8npjA92ucehbcfrQY0sqYaSCHgw+fxV9U=; b=NrK8NlQKgj6HXInW/itDPqlSljwvbqduijbZ4i/MosYYWdPElubMwjt35z8g3AwckwE2C3 kuhjRCPOHJ+Gp2ZDV0/Ke1HcsDm346MGI6oraaA2p0PaI7YzIsFkqb6uRG3JZtbY+37j9h sik/G4PCTZy8Aj78GIBfM7fHutQqU7M= X-MC-Unique: S3uQesrXOwypbQuGWEm0Jw-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=guk+TFRH4H8npjA92ucehbcfrQY0sqYaSCHgw+fxV9U=; b=YpWK0u8R8csshQEARCmFvA0A1mEHv5mGgsDzN58rbf4z9nDLbyxFWSFblFQzj8C8J/ fbzE0yZlP1YgflXrFFGL03hR4WDd/kFNugO8cv8QZaFcJdJuHNn5Vv8+oXsj6MkjNUzF 96s4VWnvFr/V57+DIroSGTZJwReGAtvybdctM+UpQBGJo0rni1TlLdilDn86PRN1yiOq ilOHDGVhTHls/lEFo7SyJGXzmyoFfPvb4639OPn7xraRAp1NiFS7B56N62DbrTIzul/0 CAcMfC5QgsZ2HwXD8nVn36zHVDxPTntCJdxO0CaAV2a2Vmwv8yxsJMEzl8iLClYDSHff gGOQ== X-Gm-Message-State: AOAM5303IUXjaKZbCCwcuoShZyZ7So9+5OtCo1779QzF49mUg8erDxxq DXP7QKAtY29/QUl6JmGwcLIXrmzVfVFPNgeDlm/Be+Ude8IoOxohSz6L1aedwFPqvS1a6Shcc2u RKoDXtIGbYM7/nQ== X-Received: by 2002:a1c:ed0a:: with SMTP id l10mr3014240wmh.151.1618491459912; Thu, 15 Apr 2021 05:57:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxHgK/B9xdBozvUa0Dz97seOiLaXYEXB8pLdaGBRX8bv4ipUgORSdQROblkAX1QksL+KxFXtQ== X-Received: by 2002:a1c:ed0a:: with SMTP id l10mr3014231wmh.151.1618491459807; Thu, 15 Apr 2021 05:57:39 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Andrew Jones , Eric Auger , Thomas Huth , Laurent Vivier , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Claudio Fontana Subject: [PATCH v3 7/6] qtest/arm-cpu-features: Use generic qtest_has_accel() to check for KVM Date: Thu, 15 Apr 2021 14:57:37 +0200 Message-Id: <20210415125737.4064646-1-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: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Use the recently added generic qtest_has_accel() method to check if KVM is available. Suggested-by: Claudio Fontana Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- tests/qtest/arm-cpu-features.c | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/tests/qtest/arm-cpu-features.c b/tests/qtest/arm-cpu-features.c index 8252b85bb85..7f4b2521277 100644 --- a/tests/qtest/arm-cpu-features.c +++ b/tests/qtest/arm-cpu-features.c @@ -26,21 +26,6 @@ " 'arguments': { 'type': 'full', " #define QUERY_TAIL "}}" =20 -static bool kvm_enabled(QTestState *qts) -{ - QDict *resp, *qdict; - bool enabled; - - resp =3D qtest_qmp(qts, "{ 'execute': 'query-kvm' }"); - g_assert(qdict_haskey(resp, "return")); - qdict =3D qdict_get_qdict(resp, "return"); - g_assert(qdict_haskey(qdict, "enabled")); - enabled =3D qdict_get_bool(qdict, "enabled"); - qobject_unref(resp); - - return enabled; -} - static QDict *do_query_no_props(QTestState *qts, const char *cpu_type) { return qtest_qmp(qts, QUERY_HEAD "'model': { 'name': %s }" @@ -493,14 +478,6 @@ static void test_query_cpu_model_expansion_kvm(const v= oid *data) =20 qts =3D qtest_init(MACHINE_KVM "-cpu max"); =20 - /* - * These tests target the 'host' CPU type, so KVM must be enabled. - */ - if (!kvm_enabled(qts)) { - qtest_quit(qts); - return; - } - /* Enabling and disabling kvm-no-adjvtime should always work. */ assert_has_feature_disabled(qts, "host", "kvm-no-adjvtime"); assert_set_feature(qts, "host", "kvm-no-adjvtime", true); @@ -624,7 +601,7 @@ int main(int argc, char **argv) * order avoid attempting to run an AArch32 QEMU with KVM on * AArch64 hosts. That won't work and isn't easy to detect. */ - if (g_str_equal(qtest_get_arch(), "aarch64")) { + if (g_str_equal(qtest_get_arch(), "aarch64") && qtest_has_accel("kvm")= ) { qtest_add_data_func("/arm/kvm/query-cpu-model-expansion", NULL, test_query_cpu_model_expansion_kvm); } --=20 2.26.3