From nobody Wed Nov 27 04:48:04 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 Tested-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 From nobody Wed Nov 27 04:48:04 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=1556196661; cv=none; d=zoho.com; s=zohoarc; b=mKe1hbQqsCIw8dvpSbfuMW0f5ptrcvRBNG4q3yrQ/udBMKNHqQciH5XrHp4OfxPzlkOhH6kPyKN1s7K48pS+0tRc2QZOwN5qRkBTYtWz2hJdPNQ7TjRaNdUy7qq8jojJtYq14EgXVdTk8pmfKp904hqCiuv/3Gd7UaPV7Wpi82Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1556196661; 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=i6e9VRyg3rWO50BIjQZTRumEp47IHpA1CD68JFxApZ0=; b=fTPd7heYsVWj9OzwBBF54U21GlKiq9P2NjDZKGn3AxtAE6cL3PAqkazn8ulZUe40P8RERF5kaF8Vu2vWmdln3mc+p7NcFu0dJQo9NAuiaE9/NLYZWhZZnvMRaXe065pyDzHOun1lLEetVh6zNB70R4b0TZMuDtTo3qemdXNDF7A= 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 1556196661532486.75832265351914; Thu, 25 Apr 2019 05:51:01 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C152C81227; Thu, 25 Apr 2019 12:50:59 +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 9912661D1A; Thu, 25 Apr 2019 12:50:59 +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 4F80C181B9E2; Thu, 25 Apr 2019 12:50:59 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x3PCopEb003881 for ; Thu, 25 Apr 2019 08:50:51 -0400 Received: by smtp.corp.redhat.com (Postfix) id B4DD51001E6C; Thu, 25 Apr 2019 12:50:51 +0000 (UTC) Received: from mx1.redhat.com (ext-mx17.extmail.prod.ext.phx2.redhat.com [10.5.110.46]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 849D41001DDE; 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 678F53003B45; 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 1hJdpv-0000Xu-5f; Thu, 25 Apr 2019 12:50:47 +0000 From: Christian Ehrhardt To: libvir-list@redhat.com Date: Thu, 25 Apr 2019 14:50:44 +0200 Message-Id: <20190425125044.2981-3-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.46]); Thu, 25 Apr 2019 12:50:48 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); 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.46 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Cc: jdenemar@redhat.com, ehabkost@redhat.com, Christian Ehrhardt Subject: [libvirt] [PATCH 2/2] qemuxml2argvtest: add test for remove cpu 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Thu, 25 Apr 2019 12:51:00 +0000 (UTC) Content-Type: text/plain; charset="utf-8" CPU features that always were a no-op in qemu got removed there. We no more specify them as that would trigger errors and fail to start qemu. This test ensures that those features really are not rendered into qemu command line. Without the related fix this test will trigger and fail like: In 'tests/qemuxml2argvdata/cpu-no-removed-features.args': Offset 371 Expect [ ] Actual [,-osxsave,-ospke ] Signed-off-by: Christian Ehrhardt Reviewed-by: Daniel Henrique Barboza Tested-by: Daniel Henrique Barboza --- .../cpu-no-removed-features.args | 29 +++++++++++++++++++ .../cpu-no-removed-features.xml | 23 +++++++++++++++ tests/qemuxml2argvtest.c | 1 + 3 files changed, 53 insertions(+) create mode 100644 tests/qemuxml2argvdata/cpu-no-removed-features.args create mode 100644 tests/qemuxml2argvdata/cpu-no-removed-features.xml diff --git a/tests/qemuxml2argvdata/cpu-no-removed-features.args b/tests/qe= muxml2argvdata/cpu-no-removed-features.args new file mode 100644 index 0000000000..1e4af63dc3 --- /dev/null +++ b/tests/qemuxml2argvdata/cpu-no-removed-features.args @@ -0,0 +1,29 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/tmp/lib/domain--1-QEMUGuest1 \ +USER=3Dtest \ +LOGNAME=3Dtest \ +XDG_DATA_HOME=3D/tmp/lib/domain--1-QEMUGuest1/.local/share \ +XDG_CACHE_HOME=3D/tmp/lib/domain--1-QEMUGuest1/.cache \ +XDG_CONFIG_HOME=3D/tmp/lib/domain--1-QEMUGuest1/.config \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-x86_64 \ +-name QEMUGuest1 \ +-S \ +-machine pc,accel=3Dkvm,usb=3Doff,dump-guest-core=3Doff \ +-cpu core2duo \ +-m 214 \ +-realtime mlock=3Doff \ +-smp 6,sockets=3D6,cores=3D1,threads=3D1 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=3Dcharmonitor,path=3D/tmp/lib/domain--1-QEMUGuest1/moni= tor.sock,\ +server,nowait \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ +-rtc base=3Dutc \ +-no-shutdown \ +-no-acpi \ +-usb \ +-device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x3 diff --git a/tests/qemuxml2argvdata/cpu-no-removed-features.xml b/tests/qem= uxml2argvdata/cpu-no-removed-features.xml new file mode 100644 index 0000000000..dc5a681901 --- /dev/null +++ b/tests/qemuxml2argvdata/cpu-no-removed-features.xml @@ -0,0 +1,23 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219100 + 219100 + 6 + + hvm + + + + core2duo + + + + + destroy + restart + destroy + + /usr/bin/qemu-system-x86_64 + + diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index d5c6dc4c0c..edc19ace6f 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1649,6 +1649,7 @@ mymain(void) DO_TEST("cpu-fallback", QEMU_CAPS_KVM); DO_TEST_FAILURE("cpu-nofallback", QEMU_CAPS_KVM); DO_TEST("cpu-strict1", QEMU_CAPS_KVM); + DO_TEST("cpu-no-removed-features", QEMU_CAPS_KVM); DO_TEST("cpu-numa1", NONE); DO_TEST("cpu-numa2", NONE); DO_TEST("cpu-numa-no-memory-element", NONE); --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list