From nobody Fri Nov 21 10:08:31 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=pass; 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=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1763678381; cv=none; d=zohomail.com; s=zohoarc; b=lpaszMW1DLMl1Q46drwP/oyqWYr+0+sU9nQ0VV8A6ryO3s5FtaqsNK5wV7f7pMAn3E+fNbV6nkuvaaO8UKlKnXywbonuUHkKXJJ9IvM6ymWjPFCYiqzONNY9z1wXdmGtvppMOvnWD7RPF9rNPQVmZ0wJrNTv9h+yykIbW1TXRcQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1763678381; h=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:References:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=ckN4aSLYgUBs4zC4oMsZH4I1uX2VWUqDhsZB22b69cs=; b=ZubZbr3bVSsu/SPA6AjGpK4li1JwEzfiA/vGmUNY1xxfGZGF/23hKfP7QDP1uP0yRd34iwv3ahgztzQEux318dRniFr7FsTR33gXXjtn5Ow4LbbTF3bOoM7Gp3AVH/vAVE6FTgJnl/yUJHuEYIHr0AvC2RbGhLrwO0PZ3x3RK6M= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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 1763678381602568.8998199640573; Thu, 20 Nov 2025 14:39:41 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 993) id E257244240; Thu, 20 Nov 2025 17:39:40 -0500 (EST) Received: from [172.19.199.53] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id D09F244264; Thu, 20 Nov 2025 17:37:09 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 993) id D269C44121; Thu, 20 Nov 2025 17:35:06 -0500 (EST) Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id A57304412D for ; Thu, 20 Nov 2025 17:35:00 -0500 (EST) Received: from pps.filterd (m0353725.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 5AKD24Gk003670 for ; Thu, 20 Nov 2025 22:35:00 GMT Received: from ppma13.dal12v.mail.ibm.com (dd.9e.1632.ip4.static.sl-reverse.com [50.22.158.221]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4aejju7ehq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 20 Nov 2025 22:35:00 +0000 (GMT) Received: from pps.filterd (ppma13.dal12v.mail.ibm.com [127.0.0.1]) by ppma13.dal12v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 5AKL3lSX006954 for ; Thu, 20 Nov 2025 22:34:59 GMT Received: from smtprelay03.dal12v.mail.ibm.com ([172.16.1.5]) by ppma13.dal12v.mail.ibm.com (PPS) with ESMTPS id 4af62jrskk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 20 Nov 2025 22:34:59 +0000 Received: from smtpav01.dal12v.mail.ibm.com (smtpav01.dal12v.mail.ibm.com [10.241.53.100]) by smtprelay03.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 5AKMYwcs5964402 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 20 Nov 2025 22:34:59 GMT Received: from smtpav01.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D69B25806D for ; Thu, 20 Nov 2025 22:34:58 +0000 (GMT) Received: from smtpav01.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9E3115806B for ; Thu, 20 Nov 2025 22:34:58 +0000 (GMT) Received: from li-d664314c-3171-11b2-a85c-fa8047ef35bd.pok.ibm.com (unknown [9.12.68.85]) by smtpav01.dal12v.mail.ibm.com (Postfix) with ESMTP for ; Thu, 20 Nov 2025 22:34:58 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,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=ibm.com; h= content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=pp1; bh=ckN4aSLYgUBs4zC4o MsZH4I1uX2VWUqDhsZB22b69cs=; b=mXicoZBkZ04bx/p52oJxuws4kbMXEEaxi qzkoMGETrpCA3Hd6SaP+0deCXEeQHEpoSqOzZ+MIxUfi394lDMb7TsWA5Rzq5wh0 V3mke5LvaqRyCt3LpmAxKbzHSUtB6TAD8nBXXW1lo8QEYOUdHi+zBVm/rqfI3pG1 geJE0stBtbUEor5vTKH4l7P8uSqPbCxc/zZiK+8ouH6tJ4vnMZhSZVM5I9qFSYcb fVVuIapF9fJmkzTRFK+kL/8e2oFP4RJylBGikU9HzIiE7fB98ifr4Snp3blGO+sG 00y59a3/7npRtbEd79z16ILXdwtdOtdjQG3nKpbQEKUrHstpVjLuw== From: Collin Walling To: devel@lists.libvirt.org Subject: [PATCH v1 3/4] qemu: query and cache static/host deprecated features Date: Thu, 20 Nov 2025 17:34:42 -0500 Message-ID: <20251120223443.45446-4-walling@linux.ibm.com> X-Mailer: git-send-email 2.51.1 In-Reply-To: <20251120223443.45446-1-walling@linux.ibm.com> References: <20251120223443.45446-1-walling@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-GUID: -TJeVgRRhJYY44AnFR72WvY3E4LQt3g5 X-Proofpoint-ORIG-GUID: -TJeVgRRhJYY44AnFR72WvY3E4LQt3g5 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMTE1MDAzMiBTYWx0ZWRfX4vb0nNkapZGd Q/XXnVT2YmUqbLwNiRrXOzca6EWKca8ARpq4y2x77TyTqgbjTWXr7v+zgrzn6wiL0sta3bj5W0V 0TyQ5CrVlM0RxU6M6odVdf5MCivr2Dx7Jjk4Nf6+YiX/CpXgydsmmved+boxKAcPxHAjXiVETWm x4r7fJicTbAgoCRVqZ8x3xlExTRE/1PSGrbCX7qHz6h0xTbnFUvbkymyZIcaW5E2SIq1CbeAsXb 8Dk7GXUNvhXQkDep7I4ctY05PELtYelKub3cYzGDKTyJ5spFEnK3iHqMkXKzK4jpQnVHmc7i7PX t3RKzkOJVABZO2ZEQU56y7YZKNbrDz/gDsPVTNV+BWth9GV2vQJZAvUCHjT3gyTlRpXCdco8h9G cssF+Xptfra9gtiJ7cMEP/P6hi4E5A== X-Authority-Analysis: v=2.4 cv=SvOdKfO0 c=1 sm=1 tr=0 ts=691f9794 cx=c_pps a=AfN7/Ok6k8XGzOShvHwTGQ==:117 a=AfN7/Ok6k8XGzOShvHwTGQ==:17 a=6UeiqGixMTsA:10 a=VkNPw1HP01LnGYTKEx00:22 a=VnNF1IyMAAAA:8 a=N2pE1BlU1f8Gxc6xX18A:9 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.100.49 definitions=2025-11-20_09,2025-11-20_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 lowpriorityscore=0 spamscore=0 clxscore=1015 suspectscore=0 phishscore=0 adultscore=0 bulkscore=0 impostorscore=0 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2510240000 definitions=main-2511150032 Message-ID-Hash: ZWPQWIYZD3Q4ECUISW2ZURE3DEJVEAX2 X-Message-ID-Hash: ZWPQWIYZD3Q4ECUISW2ZURE3DEJVEAX2 X-MailFrom: walling@linux.ibm.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: X-ZohoMail-DKIM: pass (identity @ibm.com) X-ZM-MESSAGEID: 1763678382305018900 Content-Type: text/plain; charset="utf-8" When performing a static CPU model expansion, the reported list of deprecated features will reflect the features which are currently enabled on the CPU model. Retrieve this subset and store them as static deprecated properties for the model info, and as host deprecated features in the cache. Note that this list may exclude items that are shown in the list, as some feature support has been dropped by hardware (e.g. csske). Signed-off-by: Collin Walling --- src/qemu/qemu_capabilities.c | 6 +++++- src/qemu/qemu_monitor.c | 2 ++ src/qemu/qemu_monitor.h | 1 + src/qemu/qemu_monitor_json.c | 17 +++++++++++++++-- .../qemucapabilitiesdata/caps_10.0.0_s390x.xml | 6 ++++++ tests/qemucapabilitiesdata/caps_9.1.0_s390x.xml | 6 ++++++ tests/qemucapabilitiesdata/caps_9.2.0_s390x.xml | 6 ++++++ 7 files changed, 41 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 3243ba8ad3..2dfdedfa1a 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -4234,7 +4234,9 @@ virQEMUCapsLoadHostCPUModelInfo(virQEMUCapsAccel *cap= s, =20 ctxt->node =3D hostCPUNode; if (virQEMUCapsParseHostCPUModelInfoDepFeats(ctxt, &hostCPU->full_dep_= props, - "./deprecatedFeatures") < = 0) { + "./deprecatedFeatures") < = 0 || + virQEMUCapsParseHostCPUModelInfoDepFeats(ctxt, &hostCPU->static_de= p_props, + "./hostDeprecatedFeatures"= ) < 0) { return -1; } =20 @@ -5017,6 +5019,8 @@ virQEMUCapsFormatHostCPUModelInfo(virQEMUCapsAccel *c= aps, =20 virQEMUCapsFormatHostCPUModelInfoDepFeats(buf, model->full_dep_props, "deprecatedFeatures"); + virQEMUCapsFormatHostCPUModelInfoDepFeats(buf, model->static_dep_props, + "hostDeprecatedFeatures"); =20 virBufferAdjustIndent(buf, -2); virBufferAddLit(buf, "\n"); diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index bcedd96f4e..504500c864 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -3375,6 +3375,7 @@ qemuMonitorCPUModelInfoFree(qemuMonitorCPUModelInfo *= model_info) } =20 g_strfreev(model_info->full_dep_props); + g_strfreev(model_info->static_dep_props); g_free(model_info->props); g_free(model_info->name); g_free(model_info); @@ -3420,6 +3421,7 @@ qemuMonitorCPUModelInfoCopy(const qemuMonitorCPUModel= Info *orig) } =20 copy->full_dep_props =3D g_strdupv(orig->full_dep_props); + copy->static_dep_props =3D g_strdupv(orig->static_dep_props); =20 return copy; } diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h index 6cd9329787..d096f474c1 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -1431,6 +1431,7 @@ struct _qemuMonitorCPUModelInfo { size_t nprops; qemuMonitorCPUProperty *props; GStrv full_dep_props; /* deprecated properties resulting from a full= model expansion */ + GStrv static_dep_props; /* deprecated properties resulting from a stat= ic model expansion */ bool migratability; }; =20 diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index e911c1929c..494d7ef515 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -5392,19 +5392,32 @@ static int qemuMonitorJSONParseCPUModelExpansion(const char *cpu_name, virJSONValue *cpu_props, virJSONValue *cpu_deprecated_props, + qemuMonitorCPUModelExpansionType typ= e, qemuMonitorCPUModelInfo **model_info) { g_autoptr(qemuMonitorCPUModelInfo) expanded_model =3D NULL; + GStrv dep_props =3D NULL; =20 if (qemuMonitorJSONParseCPUModel(cpu_name, cpu_props, &expanded_model)= < 0) return -1; =20 if (cpu_deprecated_props && virJSONValueArraySize(cpu_deprecated_props) && - (!(expanded_model->full_dep_props =3D virJSONValueArrayToStringLis= t(cpu_deprecated_props)))) { + (!(dep_props =3D virJSONValueArrayToStringList(cpu_deprecated_prop= s)))) { return -1; } =20 + switch (type) { + case QEMU_MONITOR_CPU_MODEL_EXPANSION_STATIC: + expanded_model->static_dep_props =3D dep_props; + break; + + case QEMU_MONITOR_CPU_MODEL_EXPANSION_STATIC_FULL: + case QEMU_MONITOR_CPU_MODEL_EXPANSION_FULL: + expanded_model->full_dep_props =3D dep_props; + break; + } + *model_info =3D g_steal_pointer(&expanded_model); return 0; } @@ -5509,7 +5522,7 @@ qemuMonitorJSONGetCPUModelExpansion(qemuMonitor *mon, =20 return qemuMonitorJSONParseCPUModelExpansion(cpu_name, cpu_props, cpu_deprecated_props, - model_info); + type, model_info); } =20 =20 diff --git a/tests/qemucapabilitiesdata/caps_10.0.0_s390x.xml b/tests/qemuc= apabilitiesdata/caps_10.0.0_s390x.xml index 0e834544af..82a66a6524 100644 --- a/tests/qemucapabilitiesdata/caps_10.0.0_s390x.xml +++ b/tests/qemucapabilitiesdata/caps_10.0.0_s390x.xml @@ -202,6 +202,12 @@ + + + + + + diff --git a/tests/qemucapabilitiesdata/caps_9.1.0_s390x.xml b/tests/qemuca= pabilitiesdata/caps_9.1.0_s390x.xml index bdbb60a097..b961f79808 100644 --- a/tests/qemucapabilitiesdata/caps_9.1.0_s390x.xml +++ b/tests/qemucapabilitiesdata/caps_9.1.0_s390x.xml @@ -192,6 +192,12 @@ + + + + + + diff --git a/tests/qemucapabilitiesdata/caps_9.2.0_s390x.xml b/tests/qemuca= pabilitiesdata/caps_9.2.0_s390x.xml index 8da55b1c4e..e9f79261f7 100644 --- a/tests/qemucapabilitiesdata/caps_9.2.0_s390x.xml +++ b/tests/qemucapabilitiesdata/caps_9.2.0_s390x.xml @@ -195,6 +195,12 @@ + + + + + + --=20 2.51.1