From nobody Fri Dec 12 14:09:14 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=1761827376; cv=none; d=zohomail.com; s=zohoarc; b=j3seb/5czKUEd0GW58n/VpLw3FKS1vWTnRRF9nI9JUY5jboaPV2DEyxa5Rl8BKq9vEppbaSJ1AFHfHVywcfo1OVqh90yxgxQBNegO9f+ESfGe3QhnVwVjzW1xL+HRZ1J9pD4ZG7yDSnfnWSsPEW91SoD/dX0i+Xirt+YZNBJH/A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761827376; 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=5GzGgXvYPsbH5/AzCwLZame+PSmZe5QmWL8hO2gHziE=; b=S+Xz7l/GPMy8zw1bNtEJ3f+OX/7/iCtopk5//RFMwt4MJC+evg2b5vnS/+GOw5b+xZ5TlSRGpBX0qMHL5SJpDkSD3cM1L4WHKDS5JuLyY5+XFbk4WJrnkrzblAXgXXK4/x2fefZfTpwbLIOscZo4nQ9FMKs9GYuWdIrW6p0ZOqQ= 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 1761827376042290.8481116783772; Thu, 30 Oct 2025 05:29:36 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 993) id CA72D41B99; Thu, 30 Oct 2025 08:29:32 -0400 (EDT) Received: from [172.19.199.29] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id 8ADAE41C62; Thu, 30 Oct 2025 08:27:41 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 993) id BE14C3F308; Thu, 30 Oct 2025 08:27:22 -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 E495641A35 for ; Thu, 30 Oct 2025 08:27:21 -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-508-DNkKSC3NPl2Jd2AEAVGH4A-1; Thu, 30 Oct 2025 08:27:20 -0400 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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 586151955F11 for ; Thu, 30 Oct 2025 12:27:19 +0000 (UTC) Received: from orkuz (unknown [10.43.3.115]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id D765919560A2 for ; Thu, 30 Oct 2025 12:27:18 +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=1761827241; 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=5GzGgXvYPsbH5/AzCwLZame+PSmZe5QmWL8hO2gHziE=; b=VD48D8cE89fEW2fah+xoNd02Swi72KUKJdoDzs02XaBcUxxKNr2Nu4jLj/5uuUw/akCpVa X31W8TPTPsKjpys4zdBfcmHJDhiWwg5mrkSBcUfYS01YorqyXPtwZXO7KD7p3HsokMjcu8 9qj81t2AT/kIhDBNpEiK8yqW/fzxAF8= X-MC-Unique: DNkKSC3NPl2Jd2AEAVGH4A-1 X-Mimecast-MFC-AGG-ID: DNkKSC3NPl2Jd2AEAVGH4A_1761827239 To: devel@lists.libvirt.org Subject: [PATCH 1/6] cpu_conf: Make virCPUDefFilterFeatures return void Date: Thu, 30 Oct 2025 13:27:09 +0100 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: SbXg8pqRHEDvvhov88jcZiBgoiv9Ozf2E3f8uCBko88_1761827239 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: LVNT2BEGJ2GSTOHOEQVOY6QXSG64GUKH X-Message-ID-Hash: LVNT2BEGJ2GSTOHOEQVOY6QXSG64GUKH 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: 1761827379203154100 Content-Type: text/plain; charset="utf-8" From: Jiri Denemark The only thing that can fail inside virCPUDefFilterFeatures is VIR_DELETE_ELEMENT_INPLACE macro. The macro just calls virDeleteElementsN, which reports a warning when all elements to be removed are not within the array bounds and returns -1. The function succeeds otherwise. But since VIR_DELETE_ELEMENT_INPLACE sets the number of elements to be removed to 1 and we call it with i < cpu->nfeatures, the safety check in virDeleteElementsN will never fail. And even if we theoretically called it with wrong arguments, it just wouldn't do anything. Thus we can safely assume VIR_DELETE_ELEMENT_INPLACE always succeeds in virCPUDefFilterFeatures and avoid reporting any errors to simplify callers. Signed-off-by: Jiri Denemark Reviewed-by: J=C3=A1n Tomko --- src/conf/cpu_conf.c | 9 ++++----- src/conf/cpu_conf.h | 2 +- src/qemu/qemu_capabilities.c | 15 ++++++--------- src/qemu/qemu_domain.c | 3 +-- src/qemu/qemu_process.c | 5 ++--- 5 files changed, 14 insertions(+), 20 deletions(-) diff --git a/src/conf/cpu_conf.c b/src/conf/cpu_conf.c index 31425783ba..7aeedf64f5 100644 --- a/src/conf/cpu_conf.c +++ b/src/conf/cpu_conf.c @@ -1017,7 +1017,7 @@ virCPUDefListExplicitFeatures(const virCPUDef *def) } =20 =20 -int +void virCPUDefFilterFeatures(virCPUDef *cpu, virCPUDefFeatureFilter filter, void *opaque) @@ -1031,11 +1031,10 @@ virCPUDefFilterFeatures(virCPUDef *cpu, } =20 VIR_FREE(cpu->features[i].name); - if (VIR_DELETE_ELEMENT_INPLACE(cpu->features, i, cpu->nfeatures) <= 0) - return -1; - } =20 - return 0; + /* Safe to ignore as an error is returned only for invalid argumen= ts */ + ignore_value(VIR_DELETE_ELEMENT_INPLACE(cpu->features, i, cpu->nfe= atures)); + } } =20 =20 diff --git a/src/conf/cpu_conf.h b/src/conf/cpu_conf.h index 28e26303ef..cfb8f1a461 100644 --- a/src/conf/cpu_conf.h +++ b/src/conf/cpu_conf.h @@ -260,7 +260,7 @@ virCPUFeatureDef * virCPUDefFindFeature(const virCPUDef *def, const char *name); =20 -int +void virCPUDefFilterFeatures(virCPUDef *cpu, virCPUDefFeatureFilter filter, void *opaque); diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 83946123be..2c966e7ef0 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -4023,17 +4023,14 @@ virQEMUCapsInitHostCPUModel(virQEMUCaps *qemuCaps, =20 if (ARCH_IS_X86(qemuCaps->arch) && !virQEMUCapsGet(qemuCaps, QEMU_CAPS_CPU_UNAVAILABLE_FEATURES)) { - if (cpu && - virCPUDefFilterFeatures(cpu, virCPUx86FeatureFilterDropMSR, NU= LL) < 0) - goto error; + if (cpu) + virCPUDefFilterFeatures(cpu, virCPUx86FeatureFilterDropMSR, NU= LL); =20 - if (migCPU && - virCPUDefFilterFeatures(migCPU, virCPUx86FeatureFilterDropMSR,= NULL) < 0) - goto error; + if (migCPU) + virCPUDefFilterFeatures(migCPU, virCPUx86FeatureFilterDropMSR,= NULL); =20 - if (fullCPU && - virCPUDefFilterFeatures(fullCPU, virCPUx86FeatureFilterDropMSR= , NULL) < 0) - goto error; + if (fullCPU) + virCPUDefFilterFeatures(fullCPU, virCPUx86FeatureFilterDropMSR= , NULL); } =20 if (virQEMUCapsTypeIsAccelerated(type)) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 375e0e441a..227eee3646 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -5319,8 +5319,7 @@ qemuDomainMakeCPUMigratable(virArch arch, g_auto(GStrv) keep =3D virCPUDefListExplicitFeatures(origCPU); data.keep =3D keep; =20 - if (virCPUDefFilterFeatures(cpu, qemuDomainDropAddedCPUFeature= s, &data) < 0) - return -1; + virCPUDefFilterFeatures(cpu, qemuDomainDropAddedCPUFeatures, &= data); } } =20 diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 9926998f85..17eac5772b 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -6552,9 +6552,8 @@ qemuProcessUpdateGuestCPU(virDomainDef *def, def->cpu->fallback =3D VIR_CPU_FALLBACK_FORBID; } =20 - if (virCPUDefFilterFeatures(def->cpu, virQEMUCapsCPUFilterFeatures, - &def->os.arch) < 0) - return -1; + virCPUDefFilterFeatures(def->cpu, virQEMUCapsCPUFilterFeatures, + &def->os.arch); =20 if (def->cpu->deprecated_feats) { virCPUFeaturePolicy policy =3D VIR_CPU_FEATURE_REQUIRE; --=20 2.51.0 From nobody Fri Dec 12 14:09:14 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=1761827426; cv=none; d=zohomail.com; s=zohoarc; b=ObV9960XgVLZVYgG4RExecT7m8JfMkvZjecODBHAG6Pen2b/Tth3pvxITsfOrdNeDfBO6qrTja9ZtrGiYbjoDL6OvhpzLjD/+z8THzNNirJie0PR49GE+xEF1MefumZqiuShQ3kGiGqxGuRsdcIvzNnIMyTCDZSMTzwkGVCNY2E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761827426; 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=wjhWyVcNWA0hRF9mNmDD3YjYfaFM5jo4jPkoGKu4SeA=; b=AcC29cAqrNTbueuU7ttoN+X5wQijbU4sTfHBCnI7eACZpHvpEDfKWOJjbU3C7zhb5nb5o8dY6MFQm/HZS2pUwMKw/qe4+0F8/eQ/DMooD8eNU3TCcjAh4ab+wbqsVs/T9P6ObP8hr3gde4DzQAY9f0KxI3mk0+hWVwPSgJQ01NU= 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 1761827426372741.0868153976505; Thu, 30 Oct 2025 05:30:26 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 79D3041AE6; Thu, 30 Oct 2025 08:30:24 -0400 (EDT) Received: from [172.19.199.29] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id 40EEC43DD7; Thu, 30 Oct 2025 08:27:48 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 993) id F313A41A37; Thu, 30 Oct 2025 08:27:24 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.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 36B203F308 for ; Thu, 30 Oct 2025 08:27:24 -0400 (EDT) Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-451-zU2mbbr-PQav0RzvpjL6OQ-1; Thu, 30 Oct 2025 08:27:22 -0400 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (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-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 44F0B180A22E for ; Thu, 30 Oct 2025 12:27:21 +0000 (UTC) Received: from orkuz (unknown [10.43.3.115]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id C5B1F180057C for ; Thu, 30 Oct 2025 12:27:20 +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=1761827243; 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=wjhWyVcNWA0hRF9mNmDD3YjYfaFM5jo4jPkoGKu4SeA=; b=Hf5MUCN4/OraznqDPD/amqn4g/G3Abyw6gW5YKfYSC2OPoiKDWuA5q85MVjhIlOh3kOaLT +SGHNiYRqpDqFSate5nSZbstYt1cBAnwpFOlbmHyUIxYA7TY9zW72jQ+c0W2WYC+GYubYW ordpFVZDCfiUGNXYPtCHgmtDLDSeuSU= X-MC-Unique: zU2mbbr-PQav0RzvpjL6OQ-1 X-Mimecast-MFC-AGG-ID: zU2mbbr-PQav0RzvpjL6OQ_1761827241 To: devel@lists.libvirt.org Subject: [PATCH 2/6] qemu_domain: Simplify qemuDomainFixupCPUs Date: Thu, 30 Oct 2025 13:27:10 +0100 Message-ID: <4f05efbd95358ce316b8612e81d923c10df74499.1761827183.git.jdenemar@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: Z3FUNoNWgqZN55STrpyXFaqf-rsFzE6r8m64REdaPI8_1761827241 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: RULH7U5FUT3XCECXBJFAORXXQSXEGFWY X-Message-ID-Hash: RULH7U5FUT3XCECXBJFAORXXQSXEGFWY 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: 1761827429554154100 Content-Type: text/plain; charset="utf-8" From: Jiri Denemark Since virCPUDefFilterFeatures never fails, we can use it for in-place modifications instead of modifying a temporary virCPUDef copy. Signed-off-by: Jiri Denemark Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_domain.c | 26 ++++++-------------------- src/qemu/qemu_domain.h | 2 +- src/qemu/qemu_process.c | 4 ++-- 3 files changed, 9 insertions(+), 23 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 227eee3646..0c0ac4d82d 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -9633,7 +9633,7 @@ qemuDomainUpdateCPU(virDomainObj *vm, */ void qemuDomainFixupCPUs(virDomainObj *vm, - virCPUDef **origCPU) + virCPUDef *origCPU) { virArch arch =3D vm->def->os.arch; =20 @@ -9649,28 +9649,14 @@ qemuDomainFixupCPUs(virDomainObj *vm, * we asked for or libvirt was too old to mess up the translation from * host-model. */ - if (!*origCPU) + if (!origCPU) return; =20 - if (virCPUDefFindFeature(vm->def->cpu, "cmt")) { - g_autoptr(virCPUDef) fixedCPU =3D virCPUDefCopyWithoutModel(vm->de= f->cpu); + if (virCPUDefFindFeature(vm->def->cpu, "cmt")) + virCPUDefFilterFeatures(vm->def->cpu, virQEMUCapsCPUFilterFeatures= , &arch); =20 - virCPUDefCopyModelFilter(fixedCPU, vm->def->cpu, false, - virQEMUCapsCPUFilterFeatures, &arch); - - virCPUDefFree(vm->def->cpu); - vm->def->cpu =3D g_steal_pointer(&fixedCPU); - } - - if (virCPUDefFindFeature(*origCPU, "cmt")) { - g_autoptr(virCPUDef) fixedOrig =3D virCPUDefCopyWithoutModel(*orig= CPU); - - virCPUDefCopyModelFilter(fixedOrig, *origCPU, false, - virQEMUCapsCPUFilterFeatures, &arch); - - virCPUDefFree(*origCPU); - *origCPU =3D g_steal_pointer(&fixedOrig); - } + if (virCPUDefFindFeature(origCPU, "cmt")) + virCPUDefFilterFeatures(origCPU, virQEMUCapsCPUFilterFeatures, &ar= ch); } =20 =20 diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index fe4ba4fa15..3396f929fd 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -997,7 +997,7 @@ qemuDomainUpdateCPU(virDomainObj *vm, =20 void qemuDomainFixupCPUs(virDomainObj *vm, - virCPUDef **origCPU); + virCPUDef *origCPU); =20 char * qemuDomainGetMachineName(virDomainObj *vm); diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 17eac5772b..330519fd2e 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -8695,7 +8695,7 @@ qemuProcessStartWithMemoryState(virConnectPtr conn, * the CPU definitions. */ if (cookie) - qemuDomainFixupCPUs(vm, &cookie->cpu); + qemuDomainFixupCPUs(vm, cookie->cpu); =20 if (cookie && !cookie->slirpHelper) priv->disableSlirp =3D true; @@ -9517,7 +9517,7 @@ qemuProcessRefreshCPU(virQEMUDriver *driver, * case the host-model is known to not contain features which QEMU * doesn't know about. */ - qemuDomainFixupCPUs(vm, &priv->origCPU); + qemuDomainFixupCPUs(vm, priv->origCPU); } =20 return 0; --=20 2.51.0 From nobody Fri Dec 12 14:09:14 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 From nobody Fri Dec 12 14:09:14 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=1761827535; cv=none; d=zohomail.com; s=zohoarc; b=dWK4ZuiL0AHy7UkN2vlBHjFa52LO+3lRMRvylSjRPdkFnBLilNGKcg6hkhMtQFMw3I6G0EUQoZ00kwU7kpwQY+wDTG6yvtkc/o2asUzHbvnc4GZPBcBBYwTc6kKpu+HC/Rp0spYO7bzH7F/xInnTR8kzTESuNC/qhZ4nKS4C9/E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761827535; 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=PzaK+LB0mfouURSjWZBfcLHySrCfZ+SHPb9P9ZiPRIs=; b=eXXxTCw9lWt/J6qoDWoE0BHswiPjnGwLjFFwqR4d7LRu4465Km59TA3HtjK+7gkWh+8DeFC3vPEMy8HFuVahiOkZ0kz+h6+au1MRrOIvdFQXPWIMJHPvtSj4VigbZN0COrIC2yLBBgKJ2VHAbpQ/FXrR0lvrt1+5rR4svWc59K4= 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 1761827535731862.4738619676514; Thu, 30 Oct 2025 05:32:15 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 09B1541AEA; Thu, 30 Oct 2025 08:32:14 -0400 (EDT) Received: from [172.19.199.29] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id A005E43E97; Thu, 30 Oct 2025 08:28:00 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 8418841AFC; Thu, 30 Oct 2025 08:27:40 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.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 0C9AF41B17 for ; Thu, 30 Oct 2025 08:27:29 -0400 (EDT) Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-15-QPE0S53NMfWJM9fdujG4rw-1; Thu, 30 Oct 2025 08:27:25 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 1B366180A23C for ; Thu, 30 Oct 2025 12:27:25 +0000 (UTC) Received: from orkuz (unknown [10.43.3.115]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 9CE4D30001A1 for ; Thu, 30 Oct 2025 12:27:24 +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=1761827248; 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=PzaK+LB0mfouURSjWZBfcLHySrCfZ+SHPb9P9ZiPRIs=; b=gEOHjCdm3U1QShThzt6fmbDd05ToAjUYj5nTK/aGnNmx6wJzng2OkoanWMOHWPgC/ge+0Y +WfRsQ15VcIP7Hu0/5tdDaickzfnmoQxOUTA1cKJfkA4oXCalk6zG+H2p++SnguQrEOl8V TGXLoXA9hR/qf4Ql7De/Ohx5/c9ID90= X-MC-Unique: QPE0S53NMfWJM9fdujG4rw-1 X-Mimecast-MFC-AGG-ID: QPE0S53NMfWJM9fdujG4rw_1761827245 To: devel@lists.libvirt.org Subject: [PATCH 4/6] qemu_process: Always fix CPUs on reconnect Date: Thu, 30 Oct 2025 13:27:12 +0100 Message-ID: <34c79635361f53db6aaecf51825c9f7a172011c4.1761827183.git.jdenemar@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: IlFCklPFvUeMxWCBr2fdMwkeMsCa_eQroCqz7Wzfavk_1761827245 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: JZ7JQZ43F6OBCZEDWCKOAE3GRZ5VCSJJ X-Message-ID-Hash: JZ7JQZ43F6OBCZEDWCKOAE3GRZ5VCSJJ 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: 1761827538702154101 Content-Type: text/plain; charset="utf-8" From: Jiri Denemark We fix CPUs (i.e., remove ignored CPU features) only when libvirt/QEMU combo used to start the domain is very old and doesn't support query-cpu-model-expansion, in which case the CPU definition may contain features that are unknown to QEMU. But even if both libvirt and QEMU are new enough, we still want to remove features that do nothing to minimize confusion or to avoid false migration issues. Signed-off-by: Jiri Denemark Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_process.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 330519fd2e..d93ea4058d 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -9511,12 +9511,7 @@ qemuProcessRefreshCPU(virQEMUDriver *driver, =20 if (qemuProcessUpdateCPU(vm, VIR_ASYNC_JOB_NONE) < 0) return -1; - } else if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_QUERY_CPU_MODEL_E= XPANSION)) { - /* We only try to fix CPUs when the libvirt/QEMU combo used to sta= rt - * the domain did not know about query-cpu-model-expansion in which - * case the host-model is known to not contain features which QEMU - * doesn't know about. - */ + } else { qemuDomainFixupCPUs(vm, priv->origCPU); } =20 --=20 2.51.0 From nobody Fri Dec 12 14:09:14 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=1761827617; cv=none; d=zohomail.com; s=zohoarc; b=BtfZntpFamnQPi+RMboRoHWLbbWnoo/x2LjZB3PC/flBuSXYWpdzbSKuZdrhaNBhrmfkKeHqEEGza0kUFrpVQTnKGpDMLxZuMekDPFloklSkwvSiCsp+2qDBO2WEUoGenKevtATxNdstPwfgGm1+U+oA1QrU07ecgROfNPTOO/4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761827617; 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=mhyaPDXs8PvQNjxdWWXL3e9tl2ZoC8MpzDWyUc4mNHk=; b=XoHtiZCiDd/u0IOmjYNK7TYF+BqpYo+u5csaJDW9n33/JKZ+aJYJzdG++gJf3QHB0+oHnNQ2OJ5iApC472YiCnsGLGjfmggm/s4VOIGLBp18m6OkrfuZvjt286NYEkzGznGs4nCOmWRYqOdEHQel/sTtBjl2+jYZKT/qyYTkYag= 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 1761827617390464.4963266935199; Thu, 30 Oct 2025 05:33:37 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 993) id BF58841ABB; Thu, 30 Oct 2025 08:33:36 -0400 (EDT) Received: from [172.19.199.29] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id 3784643ED1; Thu, 30 Oct 2025 08:28:04 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 8D54241C75; Thu, 30 Oct 2025 08:27:41 -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 467E641B28 for ; Thu, 30 Oct 2025 08:27:29 -0400 (EDT) Received: from mx-prod-mc-01.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-518-0bGR7_q7P6qwXf8D5AyreQ-1; Thu, 30 Oct 2025 08:27:27 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (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-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id DFB4219560A5 for ; Thu, 30 Oct 2025 12:27:26 +0000 (UTC) Received: from orkuz (unknown [10.43.3.115]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 6C5CE1954128 for ; Thu, 30 Oct 2025 12:27:26 +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=1761827248; 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=mhyaPDXs8PvQNjxdWWXL3e9tl2ZoC8MpzDWyUc4mNHk=; b=K5cHMzUyQQHZzVTVO0Q1lhhA+Gdj5eAWAUQ/GBTAgak+F0UoqY/nCRYOmkjhLeT1tWGZr8 NKu/6YJCvOWdqN2RL8OYucKXbAH5mS9OKiNAL4PCRHiyVkgnbgzePF3tIMbtwJIHcxbn1p 6KZesj+/pfFp5CYidbNGOQ69nhlo8DY= X-MC-Unique: 0bGR7_q7P6qwXf8D5AyreQ-1 X-Mimecast-MFC-AGG-ID: 0bGR7_q7P6qwXf8D5AyreQ_1761827247 To: devel@lists.libvirt.org Subject: [PATCH 5/6] qemu_monitor: Filter CPU features reported by QEMU Date: Thu, 30 Oct 2025 13:27:13 +0100 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: o2y3ckCRzfcJ1fmdz2zSQf6rrYhJm158t13RLICbWU4_1761827247 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: 7ZBGZHFXVTZH233VBGG67AAHS22ZSTXR X-Message-ID-Hash: 7ZBGZHFXVTZH233VBGG67AAHS22ZSTXR 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: 1761827619624154100 Content-Type: text/plain; charset="utf-8" From: Jiri Denemark Some features may be on our ignore list because they do nothing even though QEMU still supports them and reports their state. But as the features do nothing, the state reported by QEMU may not correspond to what the guest sees. To avoid possible confusion we may just pretend QEMU did not report any of the features on our ignore list. Signed-off-by: Jiri Denemark Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_monitor.c | 6 ++++-- src/qemu/qemu_monitor.h | 1 + src/qemu/qemu_monitor_json.c | 16 ++++++++++++---- src/qemu/qemu_monitor_json.h | 1 + src/qemu/qemu_process.c | 1 + tests/qemumonitorjsontest.c | 1 + 6 files changed, 20 insertions(+), 6 deletions(-) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index f9b320f765..3dbaaf9c59 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -3686,7 +3686,8 @@ qemuMonitorSetDomainLog(qemuMonitor *mon, * a single qom-list-get QMP command * @cpuQOMPath: QOM path of a CPU to probe * @translate: callback for translating CPU feature names from QEMU to lib= virt - * @opaque: data for @translate callback + * @filter: callback for filtering ignored features, a pointer to @arch is + * passed as opaque pointer to the callback * @enabled: returns the CPU data for all enabled features * @disabled: returns the CPU data for features which we asked for * (either explicitly or via a named CPU model) but QEMU disabled them @@ -3701,6 +3702,7 @@ qemuMonitorGetGuestCPU(qemuMonitor *mon, bool qomListGet, const char *cpuQOMPath, qemuMonitorCPUFeatureTranslationCallback translate, + virCPUDefFeatureFilter filter, virCPUData **enabled, virCPUData **disabled) { @@ -3715,7 +3717,7 @@ qemuMonitorGetGuestCPU(qemuMonitor *mon, *disabled =3D NULL; =20 return qemuMonitorJSONGetGuestCPU(mon, arch, qomListGet, cpuQOMPath, - translate, enabled, disabled); + translate, filter, enabled, disabled= ); } =20 =20 diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h index f611ebfa24..d950d548b4 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -1495,6 +1495,7 @@ qemuMonitorGetGuestCPU(qemuMonitor *mon, bool qomListGet, const char *cpuQOMPath, qemuMonitorCPUFeatureTranslationCallback translate, + virCPUDefFeatureFilter filter, virCPUData **enabled, virCPUData **disabled); =20 diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index c121c05ffd..9b9a005771 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -6795,7 +6795,8 @@ qemuMonitorJSONGetCPUProperties(qemuMonitor *mon, static int qemuMonitorJSONCPUDataAddFeatures(virCPUData *data, GStrv props, - qemuMonitorCPUFeatureTranslationCallback= translate) + qemuMonitorCPUFeatureTranslationCallback= translate, + virCPUDefFeatureFilter filter) { char **p; =20 @@ -6805,6 +6806,9 @@ qemuMonitorJSONCPUDataAddFeatures(virCPUData *data, if (translate) name =3D translate(data->arch, name); =20 + if (filter && !filter(name, VIR_CPU_FEATURE_REQUIRE, &data->arch)) + continue; + if (virCPUDataAddFeature(data, name) < 0) return -1; } @@ -6821,7 +6825,8 @@ qemuMonitorJSONCPUDataAddFeatures(virCPUData *data, * a single qom-list-get QMP command * @cpuQOMPath: QOM path of a CPU to probe * @translate: callback for translating CPU feature names from QEMU to lib= virt - * @opaque: data for @translate callback + * @filter: callback for filtering ignored features, a pointer to @arch is + * passed as opaque pointer to the callback * @enabled: returns the CPU data for all enabled features * @disabled: returns the CPU data for features which we asked for * (either explicitly or via a named CPU model) but QEMU disabled them @@ -6836,6 +6841,7 @@ qemuMonitorJSONGetGuestCPU(qemuMonitor *mon, bool qomListGet, const char *cpuQOMPath, qemuMonitorCPUFeatureTranslationCallback transl= ate, + virCPUDefFeatureFilter filter, virCPUData **enabled, virCPUData **disabled) { @@ -6852,8 +6858,10 @@ qemuMonitorJSONGetGuestCPU(qemuMonitor *mon, &propsEnabled, &propsDisabled) < 0) return -1; =20 - if (qemuMonitorJSONCPUDataAddFeatures(cpuEnabled, propsEnabled, transl= ate) < 0 || - qemuMonitorJSONCPUDataAddFeatures(cpuDisabled, propsDisabled, tran= slate) < 0) + if (qemuMonitorJSONCPUDataAddFeatures(cpuEnabled, propsEnabled, + translate, filter) < 0 || + qemuMonitorJSONCPUDataAddFeatures(cpuDisabled, propsDisabled, + translate, filter) < 0) return -1; =20 *enabled =3D g_steal_pointer(&cpuEnabled); diff --git a/src/qemu/qemu_monitor_json.h b/src/qemu/qemu_monitor_json.h index 8b06b7599e..f20830532d 100644 --- a/src/qemu/qemu_monitor_json.h +++ b/src/qemu/qemu_monitor_json.h @@ -558,6 +558,7 @@ qemuMonitorJSONGetGuestCPU(qemuMonitor *mon, bool qomListGet, const char *cpuQOMPath, qemuMonitorCPUFeatureTranslationCallback transl= ate, + virCPUDefFeatureFilter filter, virCPUData **enabled, virCPUData **disabled); =20 diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index d93ea4058d..45fc32a663 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -4595,6 +4595,7 @@ qemuProcessFetchGuestCPU(virDomainObj *vm, virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_Q= OM_LIST_GET), cpuQOMPath, virQEMUCapsCPUFeatureFromQEMU, + virQEMUCapsCPUFilterFeatures, &dataEnabled, &dataDisabled); =20 qemuDomainObjExitMonitor(vm); diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index 6129dde449..bfe81739a7 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -2809,6 +2809,7 @@ testQemuMonitorJSONGetGuestCPU(const void *opaque) data->qomListGet, "/machine/unattached/device[0]", virQEMUCapsCPUFeatureFromQEMU, + virQEMUCapsCPUFilterFeatures, &dataEnabled, &dataDisabled) < 0) return -1; =20 --=20 2.51.0 From nobody Fri Dec 12 14:09:14 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=1761827792; cv=none; d=zohomail.com; s=zohoarc; b=nkoIzoQIKZEOtIORVcau65uxlWLbaJy0/2h+b992h/08O+DQW/a1KVHYG21v9+gd/NnEJlFyBgmjqwWoIC+V7yAbGZ+KW5aYvjNnUz5NZz+Vb4Hn/OxX0DKF5SEx3UUUvFrPgd9ke2BgKUYqMUxtTXzb19MMZZNmCzc9kKRulIY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761827792; 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=R9RHWj98WizESBUGvYE49MGaTq/5jrDhPAkHe3RU33U=; b=naRJK6NZBbACVz2z/Hq88DC4TVAUog9sqQwwh/xNkAPnMb9s61Lwvyja5HqlzOtkl1tSSfM1HCIcpSkRqItzxKZbBcCpRL22EknVlBOaXK9hcfk6mRX4sbAh0uAiwK+eLn2AdWz3kQJBDRbkC8AfAW8ZHY+dcKKcxm8ROvzC5rU= 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 1761827792274689.9272252307793; Thu, 30 Oct 2025 05:36:32 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 8C2F541ACF; Thu, 30 Oct 2025 08:36:31 -0400 (EDT) Received: from [172.19.199.29] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id 46DA643F25; Thu, 30 Oct 2025 08:28:07 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 993) id DBEC641BA2; Thu, 30 Oct 2025 08:27:51 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.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 80F9B41A38 for ; Thu, 30 Oct 2025 08:27:31 -0400 (EDT) Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-607-BYCKLLq5Odq-Quz4Zx_t0w-1; Thu, 30 Oct 2025 08:27:29 -0400 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id CEF0B180AE03 for ; Thu, 30 Oct 2025 12:27:28 +0000 (UTC) Received: from orkuz (unknown [10.43.3.115]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 5B59E19560A2 for ; Thu, 30 Oct 2025 12:27:28 +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=1761827251; 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=R9RHWj98WizESBUGvYE49MGaTq/5jrDhPAkHe3RU33U=; b=M060C5bZK5yYxOJvo+YHv2RbCpEtQj1SNOFH6Q3L03S0vutYC178cotQdF1yfRlLbnS4B6 ZTeJr1ODdjws0EdCYAeiEAkJhJVq4m3CgIMxZTEBPitV0ukqgTi0Y3x3VsNy0+MV12V5Ty xLIiegL5jHM/+riTcj5EcMP5/5OPY00= X-MC-Unique: BYCKLLq5Odq-Quz4Zx_t0w-1 X-Mimecast-MFC-AGG-ID: BYCKLLq5Odq-Quz4Zx_t0w_1761827248 To: devel@lists.libvirt.org Subject: [PATCH 6/6] qemu: Ignore "ht" CPU feature Date: Thu, 30 Oct 2025 13:27:14 +0100 Message-ID: <6058ce15d05ef5890dee5b198ac3425ac7e259f2.1761827183.git.jdenemar@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: ppiqNpLzet4QTgCpEGMZxuwlzAkJcHZQG1tURlXn6aI_1761827248 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: 7TGPQFQDEXWQL63TOEMVEAZWXUSI5VZM X-Message-ID-Hash: 7TGPQFQDEXWQL63TOEMVEAZWXUSI5VZM 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: 1761827793979154101 Content-Type: text/plain; charset="utf-8" From: Jiri Denemark The feature does not do anything, QEMU will always set it according to the CPU topology completely ignoring what we asked for. Unfortunately, the way the state of "ht" is reported changed in QEMU 10.0.0 (commit c6bd2dd634208). QEMU older than 10.0.0 would just report whatever was specified on the command line totally ignoring the actual state of the feature visible to a guest. But after the change QEMU reports ht=3Don in case it enabled "ht" based on the CPU topology. In all other cases QEMU still reports the state requested on the command line. As a result of this change a domain with multiple CPU threads started on QEMU < 10.0.0 could not be migrated to QEMU >=3D 10.0.0 unless "ht" was explicitly enabled in the domain XML because libvirt would see "ht" enabled on the destination, but disabled on the source (the guest would see "ht" enabled in both cases anyway). Outgoing migration of domains started on QEMU >=3D 10.0.0 is not affected. To fix this issue we can completely ignore "ht" both in the domain XML and in the CPU properties reported by QEMU. With this fix incoming migration to QEMU >=3D 10.0.0 works again. https://issues.redhat.com/browse/RHEL-104216 Signed-off-by: Jiri Denemark Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_capabilities.c | 1 + tests/qemuxmlconfdata/cpu-cache-disable3.x86_64-latest.args | 2 +- .../cpu-check-default-partial.x86_64-latest.args | 2 +- tests/qemuxmlconfdata/cpu-exact2-nofallback.x86_64-latest.args | 2 +- tests/qemuxmlconfdata/cpu-exact2-nofallback.x86_64-latest.xml | 1 - tests/qemuxmlconfdata/cpu-exact2-nofallback.xml | 1 - tests/qemuxmlconfdata/cpu-exact2.x86_64-latest.args | 2 +- tests/qemuxmlconfdata/cpu-exact2.x86_64-latest.xml | 1 - tests/qemuxmlconfdata/cpu-exact2.xml | 1 - tests/qemuxmlconfdata/cpu-host-model-cmt.x86_64-latest.args | 2 +- tests/qemuxmlconfdata/cpu-host-model-vendor.x86_64-latest.args | 2 +- tests/qemuxmlconfdata/cpu-minimum1.x86_64-latest.args | 2 +- tests/qemuxmlconfdata/cpu-minimum2.x86_64-latest.args | 2 +- tests/qemuxmlconfdata/cpu-phys-bits-emulate2.x86_64-latest.args | 2 +- tests/qemuxmlconfdata/cpu-strict1.x86_64-latest.args | 2 +- tests/qemuxmlconfdata/cpu-strict1.x86_64-latest.xml | 1 - tests/qemuxmlconfdata/cpu-strict1.xml | 1 - tests/qemuxmlconfdata/cpu-tsc-frequency.x86_64-latest.args | 2 +- 18 files changed, 12 insertions(+), 17 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 2c966e7ef0..bd1dc26363 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -3663,6 +3663,7 @@ const char *ignoredFeatures[] =3D { "osxsave", "ospke", /* dropped from QEMU */ "vmx-ept-uc", "vmx-ept-wb", /* never supported by QEMU */ "vmx-invvpid-single-context", /* never supported by QEMU */ + "ht", /* ignored by QEMU, set according to = topology */ }; =20 bool diff --git a/tests/qemuxmlconfdata/cpu-cache-disable3.x86_64-latest.args b/= tests/qemuxmlconfdata/cpu-cache-disable3.x86_64-latest.args index 4adf20b55a..1e962589c9 100644 --- a/tests/qemuxmlconfdata/cpu-cache-disable3.x86_64-latest.args +++ b/tests/qemuxmlconfdata/cpu-cache-disable3.x86_64-latest.args @@ -12,7 +12,7 @@ XDG_CONFIG_HOME=3D/var/lib/libvirt/qemu/domain--1-foo/.co= nfig \ -object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/va= r/lib/libvirt/qemu/domain--1-foo/master-key.aes"}' \ -machine pc,usb=3Doff,dump-guest-core=3Doff,memory-backend=3Dpc.ram,acpi= =3Doff \ -accel kvm \ --cpu Haswell,vme=3Don,ds=3Don,acpi=3Don,ss=3Don,ht=3Don,tm=3Don,pbe=3Don,d= tes64=3Don,monitor=3Don,ds-cpl=3Don,vmx=3Don,smx=3Don,est=3Don,tm2=3Don,xtp= r=3Don,pdcm=3Don,f16c=3Don,rdrand=3Don,pdpe1gb=3Don,abm=3Don,lahf-lm=3Don,l= 3-cache=3Doff \ +-cpu Haswell,vme=3Don,ds=3Don,acpi=3Don,ss=3Don,tm=3Don,pbe=3Don,dtes64=3D= on,monitor=3Don,ds-cpl=3Don,vmx=3Don,smx=3Don,est=3Don,tm2=3Don,xtpr=3Don,p= dcm=3Don,f16c=3Don,rdrand=3Don,pdpe1gb=3Don,abm=3Don,lahf-lm=3Don,l3-cache= =3Doff \ -m size=3D219136k \ -object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}'= \ -overcommit mem-lock=3Doff \ diff --git a/tests/qemuxmlconfdata/cpu-check-default-partial.x86_64-latest.= args b/tests/qemuxmlconfdata/cpu-check-default-partial.x86_64-latest.args index a92da44bd8..fe553fd31b 100644 --- a/tests/qemuxmlconfdata/cpu-check-default-partial.x86_64-latest.args +++ b/tests/qemuxmlconfdata/cpu-check-default-partial.x86_64-latest.args @@ -12,7 +12,7 @@ XDG_CONFIG_HOME=3D/var/lib/libvirt/qemu/domain--1-QEMUGue= st1/.config \ -object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/va= r/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes"}' \ -machine pc,usb=3Doff,dump-guest-core=3Doff,memory-backend=3Dpc.ram,acpi= =3Doff \ -accel kvm \ --cpu Haswell,vme=3Don,ds=3Don,acpi=3Don,ss=3Don,ht=3Don,tm=3Don,pbe=3Don,d= tes64=3Don,monitor=3Don,ds-cpl=3Don,vmx=3Don,smx=3Don,est=3Don,tm2=3Don,xtp= r=3Don,pdcm=3Don,f16c=3Don,rdrand=3Don,pdpe1gb=3Don,abm=3Don,lahf-lm=3Don \ +-cpu Haswell,vme=3Don,ds=3Don,acpi=3Don,ss=3Don,tm=3Don,pbe=3Don,dtes64=3D= on,monitor=3Don,ds-cpl=3Don,vmx=3Don,smx=3Don,est=3Don,tm2=3Don,xtpr=3Don,p= dcm=3Don,f16c=3Don,rdrand=3Don,pdpe1gb=3Don,abm=3Don,lahf-lm=3Don \ -m size=3D219136k \ -object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}'= \ -overcommit mem-lock=3Doff \ diff --git a/tests/qemuxmlconfdata/cpu-exact2-nofallback.x86_64-latest.args= b/tests/qemuxmlconfdata/cpu-exact2-nofallback.x86_64-latest.args index 20b0306268..7464609aba 100644 --- a/tests/qemuxmlconfdata/cpu-exact2-nofallback.x86_64-latest.args +++ b/tests/qemuxmlconfdata/cpu-exact2-nofallback.x86_64-latest.args @@ -12,7 +12,7 @@ XDG_CONFIG_HOME=3D/var/lib/libvirt/qemu/domain--1-QEMUGue= st1/.config \ -object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/va= r/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes"}' \ -machine pc,usb=3Doff,dump-guest-core=3Doff,memory-backend=3Dpc.ram,acpi= =3Doff \ -accel kvm \ --cpu core2duo,ds=3Don,ht=3Don,tm=3Don,ds-cpl=3Don,xtpr=3Don,3dnowext=3Don,= lahf-lm=3Don,nx=3Doff,cx16=3Doff,tm2=3Doff,pbe=3Doff,ss=3Doff,sse4a=3Doff,w= dt=3Doff \ +-cpu core2duo,ds=3Don,tm=3Don,ds-cpl=3Don,xtpr=3Don,3dnowext=3Don,lahf-lm= =3Don,nx=3Doff,cx16=3Doff,tm2=3Doff,pbe=3Doff,ss=3Doff,sse4a=3Doff,wdt=3Dof= f \ -m size=3D219136k \ -object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}'= \ -overcommit mem-lock=3Doff \ diff --git a/tests/qemuxmlconfdata/cpu-exact2-nofallback.x86_64-latest.xml = b/tests/qemuxmlconfdata/cpu-exact2-nofallback.x86_64-latest.xml index d66d0a182b..05c78334ab 100644 --- a/tests/qemuxmlconfdata/cpu-exact2-nofallback.x86_64-latest.xml +++ b/tests/qemuxmlconfdata/cpu-exact2-nofallback.x86_64-latest.xml @@ -11,7 +11,6 @@ core2duo - diff --git a/tests/qemuxmlconfdata/cpu-exact2-nofallback.xml b/tests/qemuxm= lconfdata/cpu-exact2-nofallback.xml index 4cd1d18216..d7c3e4f40f 100644 --- a/tests/qemuxmlconfdata/cpu-exact2-nofallback.xml +++ b/tests/qemuxmlconfdata/cpu-exact2-nofallback.xml @@ -11,7 +11,6 @@ core2duo - diff --git a/tests/qemuxmlconfdata/cpu-exact2.x86_64-latest.args b/tests/qe= muxmlconfdata/cpu-exact2.x86_64-latest.args index 20b0306268..7464609aba 100644 --- a/tests/qemuxmlconfdata/cpu-exact2.x86_64-latest.args +++ b/tests/qemuxmlconfdata/cpu-exact2.x86_64-latest.args @@ -12,7 +12,7 @@ XDG_CONFIG_HOME=3D/var/lib/libvirt/qemu/domain--1-QEMUGue= st1/.config \ -object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/va= r/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes"}' \ -machine pc,usb=3Doff,dump-guest-core=3Doff,memory-backend=3Dpc.ram,acpi= =3Doff \ -accel kvm \ --cpu core2duo,ds=3Don,ht=3Don,tm=3Don,ds-cpl=3Don,xtpr=3Don,3dnowext=3Don,= lahf-lm=3Don,nx=3Doff,cx16=3Doff,tm2=3Doff,pbe=3Doff,ss=3Doff,sse4a=3Doff,w= dt=3Doff \ +-cpu core2duo,ds=3Don,tm=3Don,ds-cpl=3Don,xtpr=3Don,3dnowext=3Don,lahf-lm= =3Don,nx=3Doff,cx16=3Doff,tm2=3Doff,pbe=3Doff,ss=3Doff,sse4a=3Doff,wdt=3Dof= f \ -m size=3D219136k \ -object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}'= \ -overcommit mem-lock=3Doff \ diff --git a/tests/qemuxmlconfdata/cpu-exact2.x86_64-latest.xml b/tests/qem= uxmlconfdata/cpu-exact2.x86_64-latest.xml index 7dccf6902c..cf9d241372 100644 --- a/tests/qemuxmlconfdata/cpu-exact2.x86_64-latest.xml +++ b/tests/qemuxmlconfdata/cpu-exact2.x86_64-latest.xml @@ -11,7 +11,6 @@ core2duo - diff --git a/tests/qemuxmlconfdata/cpu-exact2.xml b/tests/qemuxmlconfdata/c= pu-exact2.xml index 4239796f31..b4800262f6 100644 --- a/tests/qemuxmlconfdata/cpu-exact2.xml +++ b/tests/qemuxmlconfdata/cpu-exact2.xml @@ -11,7 +11,6 @@ core2duo - diff --git a/tests/qemuxmlconfdata/cpu-host-model-cmt.x86_64-latest.args b/= tests/qemuxmlconfdata/cpu-host-model-cmt.x86_64-latest.args index 510e19bba6..d6b57d40a3 100644 --- a/tests/qemuxmlconfdata/cpu-host-model-cmt.x86_64-latest.args +++ b/tests/qemuxmlconfdata/cpu-host-model-cmt.x86_64-latest.args @@ -12,7 +12,7 @@ XDG_CONFIG_HOME=3D/var/lib/libvirt/qemu/domain--1-QEMUGue= st1/.config \ -object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/va= r/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes"}' \ -machine pc,usb=3Doff,dump-guest-core=3Doff,memory-backend=3Dpc.ram,acpi= =3Doff \ -accel tcg \ --cpu Haswell,vme=3Don,ds=3Don,acpi=3Don,ss=3Don,ht=3Don,tm=3Don,pbe=3Don,d= tes64=3Don,monitor=3Don,ds-cpl=3Don,vmx=3Don,smx=3Don,est=3Don,tm2=3Don,xtp= r=3Don,pdcm=3Don,f16c=3Don,rdrand=3Don,pdpe1gb=3Don,abm=3Don,lahf-lm=3Don \ +-cpu Haswell,vme=3Don,ds=3Don,acpi=3Don,ss=3Don,tm=3Don,pbe=3Don,dtes64=3D= on,monitor=3Don,ds-cpl=3Don,vmx=3Don,smx=3Don,est=3Don,tm2=3Don,xtpr=3Don,p= dcm=3Don,f16c=3Don,rdrand=3Don,pdpe1gb=3Don,abm=3Don,lahf-lm=3Don \ -m size=3D219136k \ -object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}'= \ -overcommit mem-lock=3Doff \ diff --git a/tests/qemuxmlconfdata/cpu-host-model-vendor.x86_64-latest.args= b/tests/qemuxmlconfdata/cpu-host-model-vendor.x86_64-latest.args index c258a1ab36..ef7d442d5b 100644 --- a/tests/qemuxmlconfdata/cpu-host-model-vendor.x86_64-latest.args +++ b/tests/qemuxmlconfdata/cpu-host-model-vendor.x86_64-latest.args @@ -12,7 +12,7 @@ XDG_CONFIG_HOME=3D/var/lib/libvirt/qemu/domain--1-QEMUGue= st1/.config \ -object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/va= r/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes"}' \ -machine pc,usb=3Doff,dump-guest-core=3Doff,memory-backend=3Dpc.ram,acpi= =3Doff \ -accel tcg \ --cpu 'Haswell,vendor=3DLibvirt QEMU,vme=3Don,ds=3Don,acpi=3Don,ss=3Don,ht= =3Don,tm=3Don,pbe=3Don,dtes64=3Don,monitor=3Don,ds-cpl=3Don,vmx=3Don,smx=3D= on,est=3Don,tm2=3Don,xtpr=3Don,pdcm=3Don,f16c=3Don,rdrand=3Don,pdpe1gb=3Don= ,abm=3Don,lahf-lm=3Don' \ +-cpu 'Haswell,vendor=3DLibvirt QEMU,vme=3Don,ds=3Don,acpi=3Don,ss=3Don,tm= =3Don,pbe=3Don,dtes64=3Don,monitor=3Don,ds-cpl=3Don,vmx=3Don,smx=3Don,est= =3Don,tm2=3Don,xtpr=3Don,pdcm=3Don,f16c=3Don,rdrand=3Don,pdpe1gb=3Don,abm= =3Don,lahf-lm=3Don' \ -m size=3D219136k \ -object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}'= \ -overcommit mem-lock=3Doff \ diff --git a/tests/qemuxmlconfdata/cpu-minimum1.x86_64-latest.args b/tests/= qemuxmlconfdata/cpu-minimum1.x86_64-latest.args index a92da44bd8..fe553fd31b 100644 --- a/tests/qemuxmlconfdata/cpu-minimum1.x86_64-latest.args +++ b/tests/qemuxmlconfdata/cpu-minimum1.x86_64-latest.args @@ -12,7 +12,7 @@ XDG_CONFIG_HOME=3D/var/lib/libvirt/qemu/domain--1-QEMUGue= st1/.config \ -object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/va= r/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes"}' \ -machine pc,usb=3Doff,dump-guest-core=3Doff,memory-backend=3Dpc.ram,acpi= =3Doff \ -accel kvm \ --cpu Haswell,vme=3Don,ds=3Don,acpi=3Don,ss=3Don,ht=3Don,tm=3Don,pbe=3Don,d= tes64=3Don,monitor=3Don,ds-cpl=3Don,vmx=3Don,smx=3Don,est=3Don,tm2=3Don,xtp= r=3Don,pdcm=3Don,f16c=3Don,rdrand=3Don,pdpe1gb=3Don,abm=3Don,lahf-lm=3Don \ +-cpu Haswell,vme=3Don,ds=3Don,acpi=3Don,ss=3Don,tm=3Don,pbe=3Don,dtes64=3D= on,monitor=3Don,ds-cpl=3Don,vmx=3Don,smx=3Don,est=3Don,tm2=3Don,xtpr=3Don,p= dcm=3Don,f16c=3Don,rdrand=3Don,pdpe1gb=3Don,abm=3Don,lahf-lm=3Don \ -m size=3D219136k \ -object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}'= \ -overcommit mem-lock=3Doff \ diff --git a/tests/qemuxmlconfdata/cpu-minimum2.x86_64-latest.args b/tests/= qemuxmlconfdata/cpu-minimum2.x86_64-latest.args index 62e0101568..ddd0c64080 100644 --- a/tests/qemuxmlconfdata/cpu-minimum2.x86_64-latest.args +++ b/tests/qemuxmlconfdata/cpu-minimum2.x86_64-latest.args @@ -12,7 +12,7 @@ XDG_CONFIG_HOME=3D/var/lib/libvirt/qemu/domain--1-QEMUGue= st1/.config \ -object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/va= r/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes"}' \ -machine pc,usb=3Doff,dump-guest-core=3Doff,memory-backend=3Dpc.ram,acpi= =3Doff \ -accel kvm \ --cpu Haswell,vme=3Don,ds=3Don,acpi=3Don,ss=3Don,ht=3Don,tm=3Don,pbe=3Don,d= tes64=3Don,monitor=3Don,ds-cpl=3Don,vmx=3Don,smx=3Don,est=3Don,tm2=3Don,xtp= r=3Don,pdcm=3Don,f16c=3Don,rdrand=3Don,pdpe1gb=3Don,abm=3Don,lahf-lm=3Don,s= yscall=3Doff,nx=3Doff,lm=3Doff,svm=3Doff \ +-cpu Haswell,vme=3Don,ds=3Don,acpi=3Don,ss=3Don,tm=3Don,pbe=3Don,dtes64=3D= on,monitor=3Don,ds-cpl=3Don,vmx=3Don,smx=3Don,est=3Don,tm2=3Don,xtpr=3Don,p= dcm=3Don,f16c=3Don,rdrand=3Don,pdpe1gb=3Don,abm=3Don,lahf-lm=3Don,syscall= =3Doff,nx=3Doff,lm=3Doff,svm=3Doff \ -m size=3D219136k \ -object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}'= \ -overcommit mem-lock=3Doff \ diff --git a/tests/qemuxmlconfdata/cpu-phys-bits-emulate2.x86_64-latest.arg= s b/tests/qemuxmlconfdata/cpu-phys-bits-emulate2.x86_64-latest.args index 92c719b553..3808af7399 100644 --- a/tests/qemuxmlconfdata/cpu-phys-bits-emulate2.x86_64-latest.args +++ b/tests/qemuxmlconfdata/cpu-phys-bits-emulate2.x86_64-latest.args @@ -12,7 +12,7 @@ XDG_CONFIG_HOME=3D/var/lib/libvirt/qemu/domain--1-foo/.co= nfig \ -object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/va= r/lib/libvirt/qemu/domain--1-foo/master-key.aes"}' \ -machine pc,usb=3Doff,dump-guest-core=3Doff,memory-backend=3Dpc.ram,acpi= =3Doff \ -accel kvm \ --cpu Haswell,vme=3Don,ds=3Don,acpi=3Don,ss=3Don,ht=3Don,tm=3Don,pbe=3Don,d= tes64=3Don,monitor=3Don,ds-cpl=3Don,vmx=3Don,smx=3Don,est=3Don,tm2=3Don,xtp= r=3Don,pdcm=3Don,f16c=3Don,rdrand=3Don,pdpe1gb=3Don,abm=3Don,lahf-lm=3Don,p= hys-bits=3D42 \ +-cpu Haswell,vme=3Don,ds=3Don,acpi=3Don,ss=3Don,tm=3Don,pbe=3Don,dtes64=3D= on,monitor=3Don,ds-cpl=3Don,vmx=3Don,smx=3Don,est=3Don,tm2=3Don,xtpr=3Don,p= dcm=3Don,f16c=3Don,rdrand=3Don,pdpe1gb=3Don,abm=3Don,lahf-lm=3Don,phys-bits= =3D42 \ -m size=3D219136k \ -object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}'= \ -overcommit mem-lock=3Doff \ diff --git a/tests/qemuxmlconfdata/cpu-strict1.x86_64-latest.args b/tests/q= emuxmlconfdata/cpu-strict1.x86_64-latest.args index 3f9c3516bb..7e870db393 100644 --- a/tests/qemuxmlconfdata/cpu-strict1.x86_64-latest.args +++ b/tests/qemuxmlconfdata/cpu-strict1.x86_64-latest.args @@ -12,7 +12,7 @@ XDG_CONFIG_HOME=3D/var/lib/libvirt/qemu/domain--1-QEMUGue= st1/.config \ -object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/va= r/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes"}' \ -machine pc,usb=3Doff,dump-guest-core=3Doff,memory-backend=3Dpc.ram,acpi= =3Doff \ -accel kvm \ --cpu Haswell,ds=3Don,acpi=3Don,ht=3Don,tm=3Don,ds-cpl=3Don,vmx=3Don,est=3D= on,xtpr=3Don,3dnowext=3Don,lahf-lm=3Don,nx=3Doff,cx16=3Doff,tm2=3Doff,pbe= =3Doff,ss=3Doff,sse4a=3Doff,wdt=3Doff,vme=3Doff,invtsc=3Doff,abm=3Doff,pdpe= 1gb=3Doff,rdrand=3Doff,f16c=3Doff,pdcm=3Doff,smx=3Doff,monitor=3Doff,dtes64= =3Doff \ +-cpu Haswell,ds=3Don,acpi=3Don,tm=3Don,ds-cpl=3Don,vmx=3Don,est=3Don,xtpr= =3Don,3dnowext=3Don,lahf-lm=3Don,nx=3Doff,cx16=3Doff,tm2=3Doff,pbe=3Doff,ss= =3Doff,sse4a=3Doff,wdt=3Doff,vme=3Doff,invtsc=3Doff,abm=3Doff,pdpe1gb=3Doff= ,rdrand=3Doff,f16c=3Doff,pdcm=3Doff,smx=3Doff,monitor=3Doff,dtes64=3Doff \ -m size=3D219136k \ -object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}'= \ -overcommit mem-lock=3Doff \ diff --git a/tests/qemuxmlconfdata/cpu-strict1.x86_64-latest.xml b/tests/qe= muxmlconfdata/cpu-strict1.x86_64-latest.xml index beeaf5c682..9c5e083aee 100644 --- a/tests/qemuxmlconfdata/cpu-strict1.x86_64-latest.xml +++ b/tests/qemuxmlconfdata/cpu-strict1.x86_64-latest.xml @@ -12,7 +12,6 @@ Haswell - diff --git a/tests/qemuxmlconfdata/cpu-strict1.xml b/tests/qemuxmlconfdata/= cpu-strict1.xml index 63db54ecad..c0548b3dca 100644 --- a/tests/qemuxmlconfdata/cpu-strict1.xml +++ b/tests/qemuxmlconfdata/cpu-strict1.xml @@ -12,7 +12,6 @@ Haswell - diff --git a/tests/qemuxmlconfdata/cpu-tsc-frequency.x86_64-latest.args b/t= ests/qemuxmlconfdata/cpu-tsc-frequency.x86_64-latest.args index 4353d65ac2..e926d309f5 100644 --- a/tests/qemuxmlconfdata/cpu-tsc-frequency.x86_64-latest.args +++ b/tests/qemuxmlconfdata/cpu-tsc-frequency.x86_64-latest.args @@ -12,7 +12,7 @@ XDG_CONFIG_HOME=3D/var/lib/libvirt/qemu/domain--1-QEMUGue= st1/.config \ -object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/va= r/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes"}' \ -machine pc,usb=3Doff,dump-guest-core=3Doff,memory-backend=3Dpc.ram,acpi= =3Doff \ -accel kvm \ --cpu Haswell,vme=3Don,ds=3Don,acpi=3Don,ss=3Don,ht=3Don,tm=3Don,pbe=3Don,d= tes64=3Don,monitor=3Don,ds-cpl=3Don,vmx=3Don,smx=3Don,est=3Don,tm2=3Don,xtp= r=3Don,pdcm=3Don,f16c=3Don,rdrand=3Don,pdpe1gb=3Don,abm=3Don,lahf-lm=3Don,i= nvtsc=3Don,tsc-frequency=3D4567890000 \ +-cpu Haswell,vme=3Don,ds=3Don,acpi=3Don,ss=3Don,tm=3Don,pbe=3Don,dtes64=3D= on,monitor=3Don,ds-cpl=3Don,vmx=3Don,smx=3Don,est=3Don,tm2=3Don,xtpr=3Don,p= dcm=3Don,f16c=3Don,rdrand=3Don,pdpe1gb=3Don,abm=3Don,lahf-lm=3Don,invtsc=3D= on,tsc-frequency=3D4567890000 \ -m size=3D219136k \ -object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}'= \ -overcommit mem-lock=3Doff \ --=20 2.51.0