Received: by 2002:ac2:5e6c:0:0:0:0:0 with SMTP id a12csp667402lfr; Thu, 15 Apr 2021 09:10:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxXnu3OG0xdv+i0mhQZo7vlY0QgYkg9ltRXJMknOR1M0uFAe4yhCLHiJCeeqPl8rSmOq1uf X-Received: by 2002:a05:6638:1401:: with SMTP id k1mr52535jad.82.1618503037760; Thu, 15 Apr 2021 09:10:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618503037; cv=none; d=google.com; s=arc-20160816; b=qoe8BtQipxYAfj1EwEc8DVGz1fwTJFJib8iYkRWOgHaExpHqDxsExmMhbJZgrI0yvB 50DA7Y4/0rR1NgYrisn8TIMZCAU3dn9vUBoip5V/4eabTEup+j14UK4ae0m/UlIpo4JI 3VU7ntT+1dIeGDNHTMnCO6PwpfHcunHo6IHa/HCgHEhfZhSSGkyB8VCfe0jr5lwz9ln5 PF+S0PVFFmtG83H5HV+Yk8UgFnAlCM4eDH74nK2f9B7GqZg3/xLJs8UFHJ7pGNWXri96 wcET8cdkDCcj/6OhWQX+f3WEPRCJoafhUeQVMBjjEusN39bpHPsCJ5IWy33/IAk4dD7h +suw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:to:subject:dkim-signature; bh=dpZF+Y7ogSRWg8vOKWxNowPnzUaKyrkc4oaT6d4L2z0=; b=ysxxf5cxHtXPb1isisoJsAoCDPNzrfhNGle/1CSlwK3yN5i19H0m0o0+M6vOvrfApu 2dIb/5tlVth+i9P2lXCmQ6197NPFV/rC5lvHXl8kTqxmqHBbcP8h9r03gXhVFYX6/rST MZXX1skQ+/KYcMczjXIhJ+hKjnbsX56QWMehuU1GQ7oI80E0bLBWO2be44bM/3cduB12 9mcIzXYEgJqWtx9dVaNu9ruvbqFuUrIfafJoptrt/KUwu2OKsfjNjDA2XgajVAv5SAGu 6S9j2LwoM56atJ/cSsgWv5rp/8UOo5IToXTPT61uIrv4rfHfGm2nZkplJwHLc833r2CO 0Ktg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@redhat.com header.s=mimecast20190719 header.b=F+2Tn5PS; spf=pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id y1si868708jat.125.2021.04.15.09.10.37 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 15 Apr 2021 09:10:37 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@redhat.com header.s=mimecast20190719 header.b=F+2Tn5PS; spf=pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from localhost ([::1]:36372 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lX4Zg-0007Av-2B for alex.bennee@linaro.org; Thu, 15 Apr 2021 12:10:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60578) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lX4Qv-00009l-Lf for qemu-arm@nongnu.org; Thu, 15 Apr 2021 12:01:33 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:42310) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lX4Qs-0008Td-U2 for qemu-arm@nongnu.org; Thu, 15 Apr 2021 12:01:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1618502489; 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=dpZF+Y7ogSRWg8vOKWxNowPnzUaKyrkc4oaT6d4L2z0=; b=F+2Tn5PStnhFK6OVn6EcPR4UBxHg5fzmpyCM9qISxP6QOegyqxJBF230q9NTkDPVp9RSV4 8AP3PCimnrsnEwxkp38a+m80radTZbA/BeE/GIfy3auw6mdTfdO4mIJRu33eF7zH5fvbhB 8SBpLbJS2BLT4yKWZt3CtHuqZyubCUk= 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-469-f7Ac2Vs4Pmy9UChp1QShMw-1; Thu, 15 Apr 2021 12:01:27 -0400 X-MC-Unique: f7Ac2Vs4Pmy9UChp1QShMw-1 Received: by mail-wm1-f69.google.com with SMTP id o18-20020a05600c3792b0290128219cbc7bso3042714wmr.4 for ; Thu, 15 Apr 2021 09:01:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=dpZF+Y7ogSRWg8vOKWxNowPnzUaKyrkc4oaT6d4L2z0=; b=VMD6P7zj65pX4ir1AxFZUNCeBSzv9a63vztjK5urTx+I6MhtUZZ469kz7GjYEqecoV oLLim7kuSswHghe9pyLfKqlBPdldbT/vmRbJo3Cd8AVkR/vMZt80TClh6kBjfc5M3X+k R8xB419xhlyC2p52A6QAMEGtoXxuNMVRH2RzM9oIj3i0yJXyRLiNEofMsV1W8/2sUxXY vvTpAox0d+Cgl+03/JG4Xy2fJ8I0azfRHKN19mhjcmg2p9Zjn7QmtKaHzMWQZnd4tySK Bkc1WUsEWhUYy1csi1lnZHo1XY7tDLLloCLx59g0ppG2bEfatoQnuRRN07enBmyrpv0d ZGDg== X-Gm-Message-State: AOAM530OdrVnibwfNIfM92uLTaDoPbWvR096pzKmVVHJoPtZxMKQvDOW hLf9HWoMbb5DwgD/cy44IUlZKdhCvbIcTNbMS3d2AoafYbR494XE3ErhnBag7mWp5ITbzN/kRf7 h+zrWiQ2qWknC X-Received: by 2002:adf:b1d3:: with SMTP id r19mr4420145wra.97.1618502486370; Thu, 15 Apr 2021 09:01:26 -0700 (PDT) X-Received: by 2002:adf:b1d3:: with SMTP id r19mr4420127wra.97.1618502486165; Thu, 15 Apr 2021 09:01:26 -0700 (PDT) Received: from [192.168.1.36] (39.red-81-40-121.staticip.rima-tde.net. [81.40.121.39]) by smtp.gmail.com with ESMTPSA id f7sm469905wrp.48.2021.04.15.09.01.25 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 15 Apr 2021 09:01:25 -0700 (PDT) Subject: Re: [PATCH v3 7/6] qtest/arm-cpu-features: Use generic qtest_has_accel() to check for KVM To: Andrew Jones References: <20210415122633.4054644-1-philmd@redhat.com> <20210415125737.4064646-1-philmd@redhat.com> <20210415132317.rcnlq2iptbryeivs@kamzik.brq.redhat.com> From: =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= Message-ID: <0ca279e1-e173-355c-76c7-cf066ac824d2@redhat.com> Date: Thu, 15 Apr 2021 18:01:24 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <20210415132317.rcnlq2iptbryeivs@kamzik.brq.redhat.com> 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-Language: en-US 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: -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, NICE_REPLY_A=-0.001, 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-arm@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 , Thomas Huth , qemu-devel@nongnu.org, Eric Auger , qemu-arm@nongnu.org, Claudio Fontana , Paolo Bonzini Errors-To: qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org Sender: "Qemu-arm" X-TUID: TYK9olvYihfJ Hi Drew, On 4/15/21 3:23 PM, Andrew Jones wrote: > On Thu, Apr 15, 2021 at 02:57:37PM +0200, Philippe Mathieu-Daudé wrote: >> 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é >> --- >> tests/qtest/arm-cpu-features.c | 25 +------------------------ >> 1 file changed, 1 insertion(+), 24 deletions(-) >> 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")) { > > With this new guard in main(), we should be able to drop the tcg fallback > in MACHINE_KVM. But, to do that, we also need to guard the call to > sve_tests_sve_off_kvm(). OK, I'll have a look. >> qtest_add_data_func("/arm/kvm/query-cpu-model-expansion", >> NULL, test_query_cpu_model_expansion_kvm); >> } >> -- >> 2.26.3 >> > > And, shouldn't we also guard all the other tests, which require tcg, with > qtest_has_accel("tcg")? Now that we have this qtest_has_accel() method, there is certainly room for improvements / simplifications. This doesn't have to block this patch set and could be done on top. (Beside helping Claudio's effort, my main selfish motivation was to stop compile pointless objects and reduce minutes wasted on CI). Thanks, Phil.