From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id ED8D6C433B4 for ; Wed, 5 May 2021 13:06:13 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 618D461222 for ; Wed, 5 May 2021 13:06:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 618D461222 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:46692 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1leHEC-0000sT-7I for qemu-devel@archiver.kernel.org; Wed, 05 May 2021 09:06:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46896) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1leH6n-0001C8-0Q for qemu-devel@nongnu.org; Wed, 05 May 2021 08:58:33 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:44807) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1leH6l-0003we-7B for qemu-devel@nongnu.org; Wed, 05 May 2021 08:58:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1620219510; 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=gbCY1AUipzGikkOE43fSVQOwLwLGrNF9GC5HPtUsWXKbxm27K9DUgIeMp3u6mmiB+B6l9T vNKb5ZfU7jOZRKyMnusn69TiRM49nd4SBGf10c0hRAcm23yuuRz+2iAIL2WTTd3C0w9ARi NjG3gHiZbLytSmrMzgUt7IQOYyC1IV4= 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-137-10949d8JP4Kp5Rz56iLJ4w-1; Wed, 05 May 2021 08:58:29 -0400 X-MC-Unique: 10949d8JP4Kp5Rz56iLJ4w-1 Received: by mail-wm1-f70.google.com with SMTP id o8-20020a1c41080000b0290145d961cdc4so527607wma.6 for ; Wed, 05 May 2021 05:58:28 -0700 (PDT) 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=uElL8hqksdeuiSHpqlnXhisd1/cscOILGP5eBufs1k7eAc3V53NOKxgcUYDOjhwEZu bFqbf6KE+uEKzPG7o5BZbs4g8nVyBrJbAoHGlGAX+rUJdhdp8ZWfjeD0UL6Ly2gs4roR 8XEoMYOf69frnWBZuHL005UnILvuE0Q79yk9xaDIz1PhNWJSY/X7iiIflsiE57bPBYTL f29/t3dB91dQnp2jwCYesP0P67Id5gY4OWX0rH8TpHxMMZQ3doLaTPB8zuJwGFUmlcdm d9s/TYuaZcopchuTbpyyF441l5QUWgc41uX8W/ZCA9NToHSh8jdP3Sq+buwg2wc4ooyQ PueA== X-Gm-Message-State: AOAM530UTbqgjQINtI7JsGIgFNokZ73mrXJvkzzIiQFHw8v3nyoKSIS+ 2XAyWuqOg9l+EZtbq5CfD/Bt3v1EZoLT1tDlHLp9LwP/EadTDZ7Yj7ocX07jnqf6tpMoD2NSLtY m4bkzO97oW/N0h167Knqkphsj45gEUGAE8SqzO31Tpfj6Xp3JJk3lCmYM6vKYRYm1 X-Received: by 2002:adf:a116:: with SMTP id o22mr37998940wro.397.1620219507651; 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) 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org 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: 8bit Received-SPF: pass client-ip=216.205.24.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -34 X-Spam_score: -3.5 X-Spam_bar: --- X-Spam_report: (-3.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.693, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, 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 , "open list:ARM TCG CPUs" , Claudio Fontana , Paolo Bonzini , =?UTF-8?q?Alex=20Benn=C3=A9e?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" 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ée Signed-off-by: Philippe Mathieu-Daudé --- 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 "}}" -static bool kvm_enabled(QTestState *qts) -{ - QDict *resp, *qdict; - bool enabled; - - resp = qtest_qmp(qts, "{ 'execute': 'query-kvm' }"); - g_assert(qdict_haskey(resp, "return")); - qdict = qdict_get_qdict(resp, "return"); - g_assert(qdict_haskey(qdict, "enabled")); - enabled = 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 void *data) qts = qtest_init(MACHINE_KVM "-cpu max"); - /* - * 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); } -- 2.26.3