From nobody Wed Nov 27 07:45:03 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=canonical.com ARC-Seal: i=1; a=rsa-sha256; t=1556196654; cv=none; d=zoho.com; s=zohoarc; b=We2NJ3ro3rWW/lPl8FSrq4Hw19D6fRkr7TpW7sCV7t4XsUDNFaPyxRKg7e0RAE/kMyzfhwBrLSF4SApgyJGJdvn/yRWesAyOnv0EXW4jBVf/9VyqCo8tAvQHCDIog8dNlLxrc9FqUGkjo9UlN8T/rXrCrBFAdXCXWTBn+4BcBwg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1556196654; 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:ARC-Authentication-Results; bh=AjA0fbfr+LnfmKAn71hnR6arCuEd4wYrXZQpr72XGPk=; b=FHDQf6rrAzI6fsyCgbvpCexKSQ0yrWhiG/9Gc+X8irZFCZ9FENXyhAF1RicZx6mK/SytEH4IAmmDfEe3YajiKeWA3cx39yNj8Wd6GbGHWTGtmpBbALcI2IS+Sb1P8otazYxM5YwXOLpA/bq1b4CFevkd0aW/33cjdYldgMHk5Es= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1556196654904837.6136353849423; Thu, 25 Apr 2019 05:50:54 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 75824307AD19; Thu, 25 Apr 2019 12:50:53 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 474DA5D9C5; Thu, 25 Apr 2019 12:50:53 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 62D7C181AC90; Thu, 25 Apr 2019 12:50:52 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x3PCopOA003875 for ; Thu, 25 Apr 2019 08:50:51 -0400 Received: by smtp.corp.redhat.com (Postfix) id 874EA60C9A; Thu, 25 Apr 2019 12:50:51 +0000 (UTC) Received: from mx1.redhat.com (ext-mx15.extmail.prod.ext.phx2.redhat.com [10.5.110.44]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6561760BE5; Thu, 25 Apr 2019 12:50:49 +0000 (UTC) Received: from youngberry.canonical.com (youngberry.canonical.com [91.189.89.112]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 406BB308A109; Thu, 25 Apr 2019 12:50:48 +0000 (UTC) Received: from 2.general.paelzer.uk.vpn ([10.172.196.173] helo=localhost.localdomain) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1hJdpu-0000Xu-VX; Thu, 25 Apr 2019 12:50:47 +0000 From: Christian Ehrhardt To: libvir-list@redhat.com Date: Thu, 25 Apr 2019 14:50:43 +0200 Message-Id: <20190425125044.2981-2-christian.ehrhardt@canonical.com> In-Reply-To: <20190425125044.2981-1-christian.ehrhardt@canonical.com> References: <20190425125044.2981-1-christian.ehrhardt@canonical.com> X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 216 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Thu, 25 Apr 2019 12:50:48 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Thu, 25 Apr 2019 12:50:48 +0000 (UTC) for IP:'91.189.89.112' DOMAIN:'youngberry.canonical.com' HELO:'youngberry.canonical.com' FROM:'christian.ehrhardt@canonical.com' RCPT:'' X-RedHat-Spam-Score: -5 (RCVD_IN_DNSWL_HI) 91.189.89.112 youngberry.canonical.com 91.189.89.112 youngberry.canonical.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.44 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Cc: jdenemar@redhat.com, ehabkost@redhat.com, Christian Ehrhardt Subject: [libvirt] [PATCH 1/2] qemu: do not define known no-op features X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Thu, 25 Apr 2019 12:50:54 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Qemu dropped cpu features for osxsave and ospke [1][2]. The reason for the instant removal is that those features were never configurable as discussed in [3]. Fortunately the use cases adding those flags in the past are rare, but they exist. One that I identified are e.g. older virt-install when used with --cpu=3Dhost-model and there always could be the case of a user adding it to the guest xml. This triggers an issue like: qemu-system-x86_64: can't apply global Broadwell-noTSX-x86_64- cpu.osxsave=3Don: Property '.osxsave' not found Ensure that this does no more break spawning newer qemu versions by not rendering those features into the qemu command line. Fixes: https://bugs.launchpad.net/fedora/+source/qemu/+bug/1825195 Resolves: https://bugzilla.redhat.com/1644848 [1]: https://git.qemu.org/?p=3Dqemu.git;a=3Dcommit;h=3Df1a2352 [2]: https://git.qemu.org/?p=3Dqemu.git;a=3Dcommit;h=3D9ccb978 [3]: https://www.mail-archive.com/qemu-devel@nongnu.org/msg561877.html Signed-off-by: Christian Ehrhardt Reviewed-by: Daniel Henrique Barboza --- src/qemu/qemu_command.c | 23 +++++++++++++++++++ .../qemuxml2argvdata/cpu-host-model-cmt.args | 2 +- tests/qemuxml2argvdata/cpu-tsc-frequency.args | 4 ++-- 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 1425d97b1e..e0c8ae50a1 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -7076,6 +7076,27 @@ qemuBuildGlobalControllerCommandLine(virCommandPtr c= md, return 0; } =20 +/** + * qemuFeatureNoEffect: + * @feature: CPU Feature + * + * Returns true, if the feature is known to have (never had) an effect on = QEMU. + * Those features might be dropped in qemu without a longer deprecation cy= cle + * and must therefore be known e.g. to no more define them on command line. + */ +static bool +qemuFeatureNoEffect(virCPUFeatureDefPtr feature) +{ + if (!feature->name) + return false; + + if (STREQ(feature->name, "osxsave")) + return true; + if (STREQ(feature->name, "ospke")) + return true; + + return false; +} =20 static int qemuBuildCpuModelArgStr(virQEMUDriverPtr driver, @@ -7144,6 +7165,8 @@ qemuBuildCpuModelArgStr(virQEMUDriverPtr driver, virBufferAsprintf(buf, ",vendor=3D%s", cpu->vendor_id); =20 for (i =3D 0; i < cpu->nfeatures; i++) { + if (qemuFeatureNoEffect(&(cpu->features[i]))) + continue; switch ((virCPUFeaturePolicy) cpu->features[i].policy) { case VIR_CPU_FEATURE_FORCE: case VIR_CPU_FEATURE_REQUIRE: diff --git a/tests/qemuxml2argvdata/cpu-host-model-cmt.args b/tests/qemuxml= 2argvdata/cpu-host-model-cmt.args index 36f706b836..42f969fd62 100644 --- a/tests/qemuxml2argvdata/cpu-host-model-cmt.args +++ b/tests/qemuxml2argvdata/cpu-host-model-cmt.args @@ -12,7 +12,7 @@ QEMU_AUDIO_DRV=3Dnone \ -S \ -machine pc,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff \ -cpu Haswell,+vme,+ds,+acpi,+ss,+ht,+tm,+pbe,+dtes64,+monitor,+ds_cpl,+vmx= ,\ -+smx,+est,+tm2,+xtpr,+pdcm,+osxsave,+f16c,+rdrand,+pdpe1gb,+abm,+lahf_lm \ ++smx,+est,+tm2,+xtpr,+pdcm,+f16c,+rdrand,+pdpe1gb,+abm,+lahf_lm \ -m 214 \ -realtime mlock=3Doff \ -smp 6,sockets=3D6,cores=3D1,threads=3D1 \ diff --git a/tests/qemuxml2argvdata/cpu-tsc-frequency.args b/tests/qemuxml2= argvdata/cpu-tsc-frequency.args index 55bcf89617..55b72b4404 100644 --- a/tests/qemuxml2argvdata/cpu-tsc-frequency.args +++ b/tests/qemuxml2argvdata/cpu-tsc-frequency.args @@ -12,8 +12,8 @@ QEMU_AUDIO_DRV=3Dnone \ -S \ -machine pc,accel=3Dkvm,usb=3Doff,dump-guest-core=3Doff \ -cpu Haswell,+vme,+ds,+acpi,+ss,+ht,+tm,+pbe,+dtes64,+monitor,+ds_cpl,+vmx= ,\ -+smx,+est,+tm2,+xtpr,+pdcm,+osxsave,+f16c,+rdrand,+pdpe1gb,+abm,+lahf_lm,\ -+invtsc,tsc-frequency=3D3504000000 \ ++smx,+est,+tm2,+xtpr,+pdcm,+f16c,+rdrand,+pdpe1gb,+abm,+lahf_lm,+invtsc,\ +tsc-frequency=3D3504000000 \ -m 214 \ -realtime mlock=3Doff \ -smp 1,sockets=3D1,cores=3D1,threads=3D1 \ --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list