From nobody Fri Dec 12 15:14:54 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1761827489; cv=none; d=zohomail.com; s=zohoarc; b=mzI4jFJnH1Ud5w6qJHTK4o82wRv3er2pXmHCH3G0ZQJ3hxcncqNtIKuZGI5BmasEXiXR02un2VSxE4VPSRhULN1X7OIZXT5PN43HWfX1JcrQI8vCm60rM31LewGhkyNMa45HH/yY+JOASeWnpWmV1HgZRxqiHkZW/L/o6Oe4tLY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761827489; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id:Cc; bh=aTHbzeFJp5piJxX/CtT13kttMeTt2L5KOZ8lvaIfEKU=; b=GznDX/UxOGBEFtP6kO7OtjFYGVV8SkLKkTMLtldZS5FjSWg9r/hDeHaorJMH9K4Bm3BUvWVj3u2uR/Wh/Xfk9qi43ey6rdoCJxlV13WM/CeDM6yoO3IYa9EBeOX6ndpJNDEFwSdprZHGIhhdrOhSC7BGvI+USsR6cX10Hu8XGp0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1761827489319592.1147073349046; Thu, 30 Oct 2025 05:31:29 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 993) id BB86B41B4D; Thu, 30 Oct 2025 08:31:28 -0400 (EDT) Received: from [172.19.199.29] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id 788F741ABB; Thu, 30 Oct 2025 08:27:55 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 993) id B0C6441AA2; Thu, 30 Oct 2025 08:27:26 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (3072 bits) server-digest SHA256) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id B081241A35 for ; Thu, 30 Oct 2025 08:27:25 -0400 (EDT) Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-204-OVJe27WwO2aT9KtKqDLaYA-1; Thu, 30 Oct 2025 08:27:24 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 377F61956076 for ; Thu, 30 Oct 2025 12:27:23 +0000 (UTC) Received: from orkuz (unknown [10.43.3.115]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id B24A91800583 for ; Thu, 30 Oct 2025 12:27:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_PASS autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1761827245; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=aTHbzeFJp5piJxX/CtT13kttMeTt2L5KOZ8lvaIfEKU=; b=EbvmwA15zL6oRPiZnUV9QZ03QLrkqmSw7QHw7UXnLB1Y/+3gwi0iCzLA6vQ+mxbY2qv62v ZOuQSpcg3zbO9QyaAlA6uWVrC9E1fGOP1VxQQSQwzazAt0SvBbrwKwJjTurMLsBHfmTJJV hZ8DSakf83P1TZKOtDpLEr0Rr7fC6ok= X-MC-Unique: OVJe27WwO2aT9KtKqDLaYA-1 X-Mimecast-MFC-AGG-ID: OVJe27WwO2aT9KtKqDLaYA_1761827243 To: devel@lists.libvirt.org Subject: [PATCH 3/6] qemu_domain: Fix qemuDomainFixupCPUs Date: Thu, 30 Oct 2025 13:27:11 +0100 Message-ID: <467fec562c00a6f9d6d04cd4a9beeccdee008ad4.1761827183.git.jdenemar@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 3OiniWKRowW1DwyHcvIh7oD4dVxc3b4beRQA-nTgUDE_1761827243 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: JKPIMBABJ5IRTWPPZQD6JK7NZ52E6UCA X-Message-ID-Hash: JKPIMBABJ5IRTWPPZQD6JK7NZ52E6UCA X-MailFrom: jdenemar@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Jiri Denemark via Devel Reply-To: Jiri Denemark X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1761827492307154100 Content-Type: text/plain; charset="utf-8" From: Jiri Denemark The function was apparently created when the list of ignored CPU features contained just cmt and related features. The list grew quite a bit since then and this function stopped making sense as it would remove all ignored features from CPU definitions but only if cmt was present. The issue with cmt is long gone and this function was not really doing anything. Surprisingly this didn't cause any real issues as we don't update CPU definitions with features unknown to QEMU. But we may still want to remove ignored features even though QEMU knows about them for compatibility reasons. Signed-off-by: Jiri Denemark Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_domain.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 0c0ac4d82d..a42721efad 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -9614,15 +9614,20 @@ qemuDomainUpdateCPU(virDomainObj *vm, =20 =20 /** - * qemuDomainFixupCPUS: + * qemuDomainFixupCPUs: * @vm: domain object * @origCPU: original CPU used when the domain was started * * Libvirt older than 3.9.0 could have messed up the expansion of host-mod= el * CPU when reconnecting to a running domain by adding features QEMU does = not - * support (such as cmt). This API fixes both the actual CPU provided by Q= EMU - * (stored in the domain object) and the @origCPU used when starting the - * domain. + * support (such as cmt). + * + * Newer libvirt would not include feature unknown to QEMU, but the CPU + * definitions could contain features that were removed from QEMU and adde= d to + * our list of ignored features as they were not actually doing anything. + * + * This API fixes both the actual CPU provided by QEMU (stored in the doma= in + * object) and the @origCPU used when starting the domain. * * This is safe even if the original CPU definition used mode=3D'custom' (= rather * than host-model) since we know QEMU was able to start the domain and th= us @@ -9652,11 +9657,8 @@ qemuDomainFixupCPUs(virDomainObj *vm, if (!origCPU) return; =20 - if (virCPUDefFindFeature(vm->def->cpu, "cmt")) - virCPUDefFilterFeatures(vm->def->cpu, virQEMUCapsCPUFilterFeatures= , &arch); - - if (virCPUDefFindFeature(origCPU, "cmt")) - virCPUDefFilterFeatures(origCPU, virQEMUCapsCPUFilterFeatures, &ar= ch); + virCPUDefFilterFeatures(vm->def->cpu, virQEMUCapsCPUFilterFeatures, &a= rch); + virCPUDefFilterFeatures(origCPU, virQEMUCapsCPUFilterFeatures, &arch); } =20 =20 --=20 2.51.0