From nobody Mon Feb 9 16:18:19 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=1620219513; cv=none; d=zohomail.com; s=zohoarc; b=I5QENSjt7XJ1QAtWCH5c3JwhYOxFfVD2VhLGlwNE7VADqkyJgJRdTVTag0i0ayKf+4tRbBwSH6X6BC75SJQ3FPwjiFjMmN3ZDZAlQd3/5qhYnKOePVI96HyA3OsvGLiYLWbrLPpqeG29mJBRnoY5Wp7HSOeXraGzjE4nNuNbi5k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1620219513; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=MeNb2Atwfh/sX8kxLzvRexJijoqF1JUDJOimaLT3mRk=; b=fxqjHJXI5meAFuVsLq4BcusakZ5K3VanWtO/rgc1hMqGLYFhXcjrx2rsfryxyZSMDL7cCB0vgO8C21LbsOrlMwFcILsQXcAGK1Q4rCf7QZ5hU05YiTnFK+OBRcN5TY3l9p5+2MPmU/UzNg7rjZdXflJBKTM1XfCA1IzoNEgKDn0= 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 1620219513120523.4391610595004; Wed, 5 May 2021 05:58:33 -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-537-hC5xxXZENzuyIs7vWurMgA-1; Wed, 05 May 2021 08:58:28 -0400 Received: by mail-wm1-f69.google.com with SMTP id o126-20020a1c28840000b0290149b8f27c99so536457wmo.2 for ; Wed, 05 May 2021 05:58:28 -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 s6sm5774653wms.0.2021.05.05.05.58.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 May 2021 05:58:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1620219512; 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=MeNb2Atwfh/sX8kxLzvRexJijoqF1JUDJOimaLT3mRk=; b=MGVjSmFaReSYZGpO0VbdZCU6c2Wc9D2yfhRfxs7F++QPtAsdMsKr0SCtHqsTn0ShPZpcB1 N6sR+IFAj+K7qvzgWosrHVhRN/ngI7StgubDhrnByGX0TMMI89OTgosOtGCc3eO8ZBwSTu YkXfxvPSz3ebBCAnAxkiJ0xrVPaUvkY= X-MC-Unique: hC5xxXZENzuyIs7vWurMgA-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=MeNb2Atwfh/sX8kxLzvRexJijoqF1JUDJOimaLT3mRk=; b=EbsexmnKCJhYW6y94oGH0ltdzefSxP0ZiXUPpPfQ0Zej+K0drI4cnOKEnFlyYSel5r bPecQIwqS03KtBFPw69ixdQfMgXYJFWGg3V1ss2zP7lP7Zzdye8o4N/WDQbX7jo429xb dPQ2enTiQ02GdMIe9Z94x4M05V8eYu+tlw/IG16tkKO+MZb1Ckr9MOu/OoMBSQhBYGBc v+FNgA4t29UDoD+wMOisvfBq2Q74S8L/aiZy2m6wTkzKd23hmQGJv2GaXbtl0xespqgH tsX+hcTBOF6CBVyG0Qb5zpwyvjc4PAm+nPEi8TeyGwGOfvRODXUkSNOMuTjqXeKDq1MW 9k0g== X-Gm-Message-State: AOAM531vYiBZAGanAv16l8eCsXPUFiKVRRuhn77lPcwYUjzq+E059Irx vabzgAIY/OnZrdWUtD9l+BJkSj2uD2VPunDmfQIvAqrDJFWJzdvd3Mv3Kcy0xS2oSksQstFIeke C5afxW7zMHCVlTw== X-Received: by 2002:adf:a116:: with SMTP id o22mr37998933wro.397.1620219507622; Wed, 05 May 2021 05:58:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyge0h/wiymcVXjJXd3QBty/x8vuP8k4DCj0Zye558z4zmLGVpjcqA6r95tFIn+sD0l+a2+kw== X-Received: by 2002:adf:a116:: with SMTP id o22mr37998915wro.397.1620219507504; Wed, 05 May 2021 05:58:27 -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?= , Claudio Fontana , Andrew Jones , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Peter Maydell , Thomas Huth , Laurent Vivier , qemu-arm@nongnu.org (open list:ARM TCG CPUs) Subject: [PATCH v7 04/12] qtest/arm-cpu-features: Use generic qtest_has_accel() to check for KVM Date: Wed, 5 May 2021 14:57:58 +0200 Message-Id: <20210505125806.1263441-5-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) Use the recently added generic qtest_has_accel() method to check if KVM is available. Suggested-by: Claudio Fontana Reviewed-by: Andrew Jones Reviewed-by: Alex Benn=C3=A9e 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