From nobody Tue Feb 10 04:17:23 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1622822238; cv=none; d=zohomail.com; s=zohoarc; b=F1rn16Kss1G7Mt5kaMKhyUFVqBGc75fAR64oVRgatDnC6xPVEQ1AnQNVxMxjn3/PlU6/4IS+r3be5DAE6ixL2wcEdnmL3kv6qBgFQXK0SLstfW0bLxBSiCb8Y/ODrym5Q3GU9PZ3HJjmtqqKM4DgjVGLkVHcgHwLxNq1zl8pzt0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622822238; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=JEWHBCHxKVXeNs+cV9ChbBOU9uNopKc+RwL1IoJNYZE=; b=iywGOiRN5faBlf/BrLDIaaBS8klkPD0FBD4QgkI756e+TLu7Ry/Ehe5UMGagfaThJLpV87yCD1WgqraPjES5D6bgpIYauZX/UzdC3isVMr06UE9UflVqMLr7TdSyvojh3/wXAz1DA8FEQ7jqZHBoPROsAl65b5fjznYlfW36x4c= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 162282223870244.949672164320305; Fri, 4 Jun 2021 08:57:18 -0700 (PDT) Received: from localhost ([::1]:57854 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lpCCD-0003ui-HK for importer@patchew.org; Fri, 04 Jun 2021 11:57:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44288) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lpC8R-0002M0-HP for qemu-devel@nongnu.org; Fri, 04 Jun 2021 11:53:23 -0400 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]:35413) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lpC8O-0008Pd-Th for qemu-devel@nongnu.org; Fri, 04 Jun 2021 11:53:23 -0400 Received: by mail-wm1-x334.google.com with SMTP id h5-20020a05600c3505b029019f0654f6f1so7677046wmq.0 for ; Fri, 04 Jun 2021 08:53:20 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id m3sm7492783wrr.32.2021.06.04.08.53.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Jun 2021 08:53:17 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id B86BB1FF90; Fri, 4 Jun 2021 16:53:12 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=JEWHBCHxKVXeNs+cV9ChbBOU9uNopKc+RwL1IoJNYZE=; b=wtMqn6thCPNnLdYttCGfqmQqMOEg+ctSBuIECrpWX+oK1LZvqOXn8sUv0eNJFaXt/d ZQujLTQrJ9MwHgvc6688BQSlphHC6nL/xfC1CE78GOLOu+6P3jmTYiJOCtE5dsdXpnXu AZW193ADBcVFdKlvwt9SxsPa6DdDebwvuXALb5iCg5fBww2tCfvSyN2VgMENVbIF8b66 GE+83yxVlxSDu2hewbTaHpZAGs00qbMGUIXIS/a44he4BG7vRbEuqq3MqszCbkEBzQBN lU/qF24r0UAgDvZkVUKByxu/QP7Z/eDU1YlNLnzkVdz07nBZE0KcQbSChkwrZQr3/T05 U7dQ== 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=JEWHBCHxKVXeNs+cV9ChbBOU9uNopKc+RwL1IoJNYZE=; b=cnlaJcXeRUyMh9drf9V5jyOEKKPyJLx76/CJ2Ay+k5V3HkOfcMybYvd5wrUWnzZfs1 8Sv2MCZ8xo8bhyZYO/uGaUOJNZOucnKR5PjyGxhfvbhOQomE8x4OQEu31NbgxUX5tEc5 DM2lU7oGPbh89zLgDCkLefG1ok19XNtJWCp8/HsHYB+njD1ebXl/wSGVNKDQ6XdScw6b +Ua0r50NiIyDL1do92gaynclMQEovtsH/2i4SgnPGD/QoW5+5FQtGvvW/zSl9ug48rpY S1lF7RcUu5SLOdI32+mL3vKydrpRBGzW2JRTWftmGQJNBQI4aZXWpl7xC/MaKRLMgtFW 3ovA== X-Gm-Message-State: AOAM532BDd61KMFJ7kWOafHObK/Dbsf4w3jAj5egG/7vUd5bMu9uM8vT W3w02icICBTNKXTnKXkiQEak2g== X-Google-Smtp-Source: ABdhPJwkgxI+WQ7cpos6cOO4lrQwqRWxP6qv6I3lso4hCIvy4fBoVLex/yO9XGF0vpkojQ8D6WGXmg== X-Received: by 2002:a1c:5f86:: with SMTP id t128mr4403114wmb.165.1622821999429; Fri, 04 Jun 2021 08:53:19 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v16 04/99] qtest/arm-cpu-features: Use generic qtest_has_accel() to check for KVM Date: Fri, 4 Jun 2021 16:51:37 +0100 Message-Id: <20210604155312.15902-5-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210604155312.15902-1-alex.bennee@linaro.org> References: <20210604155312.15902-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x334.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@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 , Peter Maydell , Andrew Jones , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , qemu-arm@nongnu.org, Claudio Fontana , Paolo Bonzini , =?UTF-8?q?Alex=20Benn=C3=A9e?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Philippe Mathieu-Daud=C3=A9 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 Signed-off-by: Alex Benn=C3=A9e Message-Id: <20210505125806.1263441-5-philmd@redhat.com> Reviewed-by: Richard Henderson --- 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 8252b85bb8..7f4b252127 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.20.1