From nobody Sun Feb 8 14:32:05 2026 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=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1729190432399208.02070978941094; Thu, 17 Oct 2024 11:40:32 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 3A49D159E; Thu, 17 Oct 2024 14:40:31 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id C91C81238; Thu, 17 Oct 2024 14:40:05 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 0E14411FF; Thu, 17 Oct 2024 14:40:03 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 87CAAE02 for ; Thu, 17 Oct 2024 14:40:02 -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-517-ljs35TQCPtSOslduivj2xQ-1; Thu, 17 Oct 2024 14:40:00 -0400 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (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 2A25219560BE for ; Thu, 17 Oct 2024 18:40:00 +0000 (UTC) Received: from orkuz (unknown [10.45.224.13]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id A6B731956086 for ; Thu, 17 Oct 2024 18:39:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: *** X-Spam-Status: No, score=3.0 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,RCVD_IN_SBL_CSS, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED, SPF_HELO_NONE autolearn=no autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1729190402; 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=3r9kgHoBtdZfqEoaBbXrlJE8gODsaPYTvixwLbgPkzY=; b=iJ0voy4WlaOTnZVhum1mO6g7vKND2C6nOWyv1VvqKhywe8plwNQCXukrlqweGMd8m4m8gd KTkiHQIZ7Um6QXfpCYw9Xz7kUWZkbb0jqyOf27gx7YD3sASBNyocx1HdVXbl5Z3YDTfxxj 5vb4lN0xMux8TqJD5cbK+b9Ho18AKTg= X-MC-Unique: ljs35TQCPtSOslduivj2xQ-1 From: Jiri Denemark To: devel@lists.libvirt.org Subject: [PATCH 1/9] cpu_x86: Introduce element for CPU models Date: Thu, 17 Oct 2024 20:39:47 +0200 Message-ID: <9ca8f50273b40dae1b86749cf26b628428feb6eb.1729190350.git.jdenemar@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: 3PZLGMU4HA4Y3JAXZ3D47QCT4HWCHJOA X-Message-ID-Hash: 3PZLGMU4HA4Y3JAXZ3D47QCT4HWCHJOA X-MailFrom: jdenemar@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1729190433280116600 Content-Type: text/plain; charset="utf-8" CPU models in the CPU map may be marked with to indicate a backward compatible partial check (comparing our definition of the model with the host CPU) should be performed. Other models will be checked using just runnability info from QEMU. Signed-off-by: Jiri Denemark --- src/cpu/cpu_x86.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c index 7cf158e25b..70893f8a62 100644 --- a/src/cpu/cpu_x86.c +++ b/src/cpu/cpu_x86.c @@ -150,6 +150,7 @@ struct _virCPUx86Model { char *name; bool decodeHost; bool decodeGuest; + bool compatCheck; virCPUx86Vendor *vendor; virCPUx86Signatures *signatures; virCPUx86Data data; @@ -1463,6 +1464,36 @@ x86ModelCompare(virCPUx86Model *model1, } =20 =20 +static int +x86ModelParseCheck(virCPUx86Model *model, + xmlXPathContextPtr ctxt) +{ + g_autofree char *check =3D NULL; + int rc; + + if ((rc =3D virXPathBoolean("boolean(./check)", ctxt)) <=3D 0) + return rc; + + check =3D virXPathString("string(./check/@partial)", ctxt); + if (!check) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Missing check/@partial in CPU model %1$s"), + model->name); + return -1; + } + + if (STRNEQ(check, "compat")) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Invalid check/@partial value '%1$s' in CPU model= %2$s"), + check, model->name); + return -1; + } + + model->compatCheck =3D true; + return 0; +} + + static int x86ModelParseDecode(virCPUx86Model *model, xmlXPathContextPtr ctxt) @@ -1693,6 +1724,9 @@ x86ModelParse(xmlXPathContextPtr ctxt, model =3D g_new0(virCPUx86Model, 1); model->name =3D g_strdup(name); =20 + if (x86ModelParseCheck(model, ctxt) < 0) + return -1; + if (x86ModelParseDecode(model, ctxt) < 0) return -1; =20 --=20 2.47.0