From patchwork Thu Apr 15 16:32:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12205775 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,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 81367C433ED for ; Thu, 15 Apr 2021 16:49:04 +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 C1DFD6117A for ; Thu, 15 Apr 2021 16:49:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C1DFD6117A 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]:55800 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lX5As-0005IF-Ir for qemu-devel@archiver.kernel.org; Thu, 15 Apr 2021 12:49:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41592) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lX4wV-0003R3-4p for qemu-devel@nongnu.org; Thu, 15 Apr 2021 12:34:11 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:42905) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lX4wF-0006Gi-90 for qemu-devel@nongnu.org; Thu, 15 Apr 2021 12:34:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1618504431; 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=IKnx1UsTiNnjJfU2KcMKe9foiZqOxTrajgakDx3VSoU=; b=GeDLPthjT1WOZCiFGr8Br0hs+OUGO6ScY5ZmFSQXb2hraMnAAnt16907YnGFautvW8GNzn DyXCQXN3Vm4GYIYJ8ZwsMjzG5uQoW9gpQd4Hp9HkPWc5CPwI8grq9bdnYf2e4K0L6qEfDZ myI68N5pfxn2najlPMKkCRJrdGhGgHE= 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-480-ldoskwD9Ok22_OwKzkB1sg-1; Thu, 15 Apr 2021 12:33:49 -0400 X-MC-Unique: ldoskwD9Ok22_OwKzkB1sg-1 Received: by mail-wr1-f71.google.com with SMTP id 91-20020adf92640000b02901060747826eso1295638wrj.13 for ; Thu, 15 Apr 2021 09:33:49 -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=IKnx1UsTiNnjJfU2KcMKe9foiZqOxTrajgakDx3VSoU=; b=Sia+MyF1idp4zkzs4At1g7zp8ORb+Xjdk4n/JOOsMiLz5BVtm/ck5QL3X0yb10gBlZ tlfkyM1WKX00WOLi8W2obkL2OoLcWP5JIjByzTf1DMskAaGdDeY4At2zL3TwLE9TtQa1 eNmWxWzMN/1KVVwC9mG93B6RSsEx5jw3XWAVIPGKPsNtfeYzHs9gLltABERR2Hc3Tbmg U6hSspW357mqYWFO+BLsW0oyjsjCw187bziO8CKqhOsjHv6huFggLALVs4d7gyh5X6tG E6LU4ITZV2mXhAgqQr9E/VIm3ivcajwgyO396vsu1kTscIYUSmKaJqDvOhPmCmvHtJeL EHEw== X-Gm-Message-State: AOAM5331q1mrcPctRj8BB1CVGeGVeZ05YYQ9QI/gjqzId/mU+zrsCwZJ vEj0wDTQ18AAxsATFAyuCLEvSnY/kRC3mLlG+Y1mPPHveoZ1sWh99QgtvSFKqQ9dXY5oDPz/VDq LoehQKGyd/cidF7bYmqgXLbi24i2rqlSsAaMqR/Hq4Wt2VbJn80WFHPIeFyu7bvhh X-Received: by 2002:adf:fe86:: with SMTP id l6mr4580834wrr.390.1618504428190; Thu, 15 Apr 2021 09:33:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxFVULUhOKWBrh54/W+muyqJnSUaT5CgVbHS+dWc17jz2PcfiXy9XAMSjn2ooCobSsC4UHrDw== X-Received: by 2002:adf:fe86:: with SMTP id l6mr4580801wrr.390.1618504428000; Thu, 15 Apr 2021 09:33:48 -0700 (PDT) Received: from localhost.localdomain (39.red-81-40-121.staticip.rima-tde.net. [81.40.121.39]) by smtp.gmail.com with ESMTPSA id e13sm4820531wrg.72.2021.04.15.09.33.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Apr 2021 09:33:47 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v4 07/12] qtest/arm-cpu-features: Use generic qtest_has_accel() to check for TCG Date: Thu, 15 Apr 2021 18:32:59 +0200 Message-Id: <20210415163304.4120052-8-philmd@redhat.com> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20210415163304.4120052-1-philmd@redhat.com> References: <20210415163304.4120052-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 Received-SPF: pass client-ip=170.10.133.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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=unavailable 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?Daniel_P_=2E_Berrang=C3=A9?= , Eduardo Habkost , "Michael S. Tsirkin" , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Juan Quintela , Richard Henderson , Markus Armbruster , "Dr. David Alan Gilbert" , qemu-arm@nongnu.org, Claudio Fontana , Paolo Bonzini , Thomas Huth , Igor Mammedov Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Now than we can probe if the TCG accelerator is available at runtime with a QMP command, only run these tests if TCG is built into the QEMU binary. Suggested-by: Andrew Jones Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Andrew Jones Reviewed-by: Alex Bennée --- tests/qtest/arm-cpu-features.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/tests/qtest/arm-cpu-features.c b/tests/qtest/arm-cpu-features.c index b1d406542f7..0d9145dd168 100644 --- a/tests/qtest/arm-cpu-features.c +++ b/tests/qtest/arm-cpu-features.c @@ -20,7 +20,7 @@ */ #define SVE_MAX_VQ 16 -#define MACHINE "-machine virt,gic-version=max -accel tcg " +#define MACHINE_TCG "-machine virt,gic-version=max -accel tcg " #define MACHINE_KVM "-machine virt,gic-version=max -accel kvm " #define QUERY_HEAD "{ 'execute': 'query-cpu-model-expansion', " \ " 'arguments': { 'type': 'full', " @@ -337,7 +337,7 @@ static void sve_tests_sve_max_vq_8(const void *data) { QTestState *qts; - qts = qtest_init(MACHINE "-cpu max,sve-max-vq=8"); + qts = qtest_init(MACHINE_TCG "-cpu max,sve-max-vq=8"); assert_sve_vls(qts, "max", BIT_ULL(8) - 1, NULL); @@ -372,7 +372,7 @@ static void sve_tests_sve_off(const void *data) { QTestState *qts; - qts = qtest_init(MACHINE "-cpu max,sve=off"); + qts = qtest_init(MACHINE_TCG "-cpu max,sve=off"); /* SVE is off, so the map should be empty. */ assert_sve_vls(qts, "max", 0, NULL); @@ -428,7 +428,7 @@ static void test_query_cpu_model_expansion(const void *data) { QTestState *qts; - qts = qtest_init(MACHINE "-cpu max"); + qts = qtest_init(MACHINE_TCG "-cpu max"); /* Test common query-cpu-model-expansion input validation */ assert_type_full(qts); @@ -593,8 +593,10 @@ int main(int argc, char **argv) { g_test_init(&argc, &argv, NULL); - qtest_add_data_func("/arm/query-cpu-model-expansion", - NULL, test_query_cpu_model_expansion); + if (qtest_has_accel("tcg")) { + qtest_add_data_func("/arm/query-cpu-model-expansion", + NULL, test_query_cpu_model_expansion); + } /* * For now we only run KVM specific tests with AArch64 QEMU in @@ -608,7 +610,7 @@ int main(int argc, char **argv) NULL, sve_tests_sve_off_kvm); } - if (g_str_equal(qtest_get_arch(), "aarch64")) { + if (g_str_equal(qtest_get_arch(), "aarch64") && qtest_has_accel("tcg")) { qtest_add_data_func("/arm/max/query-cpu-model-expansion/sve-max-vq-8", NULL, sve_tests_sve_max_vq_8); qtest_add_data_func("/arm/max/query-cpu-model-expansion/sve-off",