From nobody Mon Feb 9 16:19:06 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1636043569; cv=none; d=zohomail.com; s=zohoarc; b=nYOjUDJzvlg6aG9XPtpVWLUWP4MPKBkN6Y0G9+XNIB+GhBFTcsyRWzXOnvP7bgsoWJvgbHUvANRDvGDxBNXwNZP5LsqDAh4JW8WHeOxgrnpbEhwDqYcnHN7c3mOxv5zQZWOgfgf5Z4oTRsE9NTTI4/x+9fbbGgIj/oodY4pA16I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1636043569; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=x7DtqHaKi5SqaqJIKEmI+SZdxqzVZY83/PrZQUZ7JcA=; b=dBdtHaPQnjEiiWF0OJI3RWGCjcbZ3Kq/SOeLv/auBV8aZwat1cVm4U+THdYEe4NfZ+GlJhWptk4OmgHV9ibUOgUzc+XW6K+V1l4eSKr2w64t1TUOVaVxlx1yPjsppW/JsoHSwrQHah0BM9SIKODkMG/B9diji3voLknJkxKHtRo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1636043569029939.7069037320618; Thu, 4 Nov 2021 09:32:49 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-494-hnIqqwUfNFakswm0Sz_EEw-1; Thu, 04 Nov 2021 12:32:46 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D0E9280669D; Thu, 4 Nov 2021 16:32:37 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AC2805F4ED; Thu, 4 Nov 2021 16:32:37 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 777D84EA38; Thu, 4 Nov 2021 16:32:37 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1A4GRVjC026413 for ; Thu, 4 Nov 2021 12:27:31 -0400 Received: by smtp.corp.redhat.com (Postfix) id 103EC19D9F; Thu, 4 Nov 2021 16:27:31 +0000 (UTC) Received: from work.speedport.ip (unknown [10.39.193.164]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5C55B19C79; Thu, 4 Nov 2021 16:27:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1636043568; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=x7DtqHaKi5SqaqJIKEmI+SZdxqzVZY83/PrZQUZ7JcA=; b=GYQ9xLwssA10QUxtJoOY6n8ykRbQpQtYVvpp2PlWQnS98APHM/TokgnKRwdcKenbkixzJe z/7xkC9mTzmEmquZMvKnszgJAqDgXu4a/qhqmMdyFdku370qec6HPwjS8MS2J4fvNoxw9I WDuLLosjTVvQ89sTl6NJHp87vtQ3uLk= X-MC-Unique: hnIqqwUfNFakswm0Sz_EEw-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH v2 09/20] cpu_arm: Implement virCPUDataIsIdentical for arm Date: Thu, 4 Nov 2021 17:27:09 +0100 Message-Id: <20211104162720.108973-10-twiederh@redhat.com> In-Reply-To: <20211104162720.108973-1-twiederh@redhat.com> References: <20211104162720.108973-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Cc: Tim Wiederhake X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1636043569276100003 Content-Type: text/plain; charset="utf-8" Signed-off-by: Tim Wiederhake --- src/cpu/cpu_arm.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/cpu/cpu_arm.c b/src/cpu/cpu_arm.c index ac174891b7..c9114d53bf 100644 --- a/src/cpu/cpu_arm.c +++ b/src/cpu/cpu_arm.c @@ -124,6 +124,32 @@ virCPUarmDataClear(virCPUarmData *data) g_strfreev(data->features); } =20 +static virCPUCompareResult +virCPUarmDataIsIdentical(const virCPUData *a, + const virCPUData *b) +{ + size_t i; + + if (!a || !b) + return VIR_CPU_COMPARE_ERROR; + + if (a->arch !=3D b->arch) + return VIR_CPU_COMPARE_INCOMPATIBLE; + + if (a->data.arm.pvr !=3D b->data.arm.pvr) + return VIR_CPU_COMPARE_INCOMPATIBLE; + + if (a->data.arm.vendor_id !=3D b->data.arm.vendor_id) + return VIR_CPU_COMPARE_INCOMPATIBLE; + + for (i =3D 0; i < MAX_CPU_FLAGS; ++i) { + if (STRNEQ(a->data.arm.features[i], b->data.arm.features[i])) + return VIR_CPU_COMPARE_INCOMPATIBLE; + } + + return VIR_CPU_COMPARE_IDENTICAL; +} + static void virCPUarmDataFree(virCPUData *cpuData) { @@ -674,4 +700,5 @@ struct cpuArchDriver cpuDriverArm =3D { .baseline =3D virCPUarmBaseline, .update =3D virCPUarmUpdate, .validateFeatures =3D virCPUarmValidateFeatures, + .dataIsIdentical =3D virCPUarmDataIsIdentical, }; --=20 2.31.1