From nobody Mon Feb 9 12:09:24 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.74 as permitted sender) client-ip=63.128.21.74; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-74.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.74 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=foxmail.com ARC-Seal: i=1; a=rsa-sha256; t=1585304560; cv=none; d=zohomail.com; s=zohoarc; b=cFR1Klz8c21P7FwHGw2uHGjdOqh/3MhC54kddSraTPRMxSWbUYYJxl43Nvh26ncDo7/I5Vvmd9i9eO84yxkQcY5sYzMR4PU1Gw2WlMEi0lXfKw0S/BUWzm9qeSEMoyFkZVekvhh1krIhxd5OVTgLpTOgzxuHfIPxOEhNN5JJupc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1585304560; 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=6UIFgtRySaj304OR0HrgOXoImpvgyMaUr8QaE88WgDs=; b=HXRk8Nq1wFyx/2afPlqGpm9ZLMNjYVcu5hGWQvSH8/YZhlIK+hxznwWzipcZnjmU0oPbV7QPD8/s5Q7U/2w5QswuWrGaKqx/iWhdEfHOWwF2f291skXCaTSd7oAp3sZ3iZenJU4+ZmEsp0xZAKbBRsjU2eRqCztmjVpafk0Z37w= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.74 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-74.mimecast.com (us-smtp-delivery-74.mimecast.com [63.128.21.74]) by mx.zohomail.com with SMTPS id 1585304560256185.63248580712423; Fri, 27 Mar 2020 03:22:40 -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-348-77RSeWpJNE27RbYBr_jzFw-1; Fri, 27 Mar 2020 06:22:28 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 89B161B2C98C; Fri, 27 Mar 2020 10:22:22 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5A6DB19756; Fri, 27 Mar 2020 10:22:22 +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 D223E18089D0; Fri, 27 Mar 2020 10:22:21 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 02R8tFjA030053 for ; Fri, 27 Mar 2020 04:55:16 -0400 Received: by smtp.corp.redhat.com (Postfix) id 33F2D120EC6; Fri, 27 Mar 2020 08:55:15 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast05.extmail.prod.ext.rdu2.redhat.com [10.11.55.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EB64712115D for ; Fri, 27 Mar 2020 08:55:12 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 42CA0800299 for ; Fri, 27 Mar 2020 08:55:12 +0000 (UTC) Received: from qq.com (out203-205-221-250.mail.qq.com [203.205.221.250]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-115--C_fLjtcOyiEegq-mq5fuQ-1; Fri, 27 Mar 2020 04:55:09 -0400 Received: from localhost.localdomain ([111.21.171.11]) by newxmesmtplogicsvrsza3.qq.com (NewEsmtp) with SMTP id D1E3CE25; Fri, 27 Mar 2020 16:52:30 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1585304559; 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=6UIFgtRySaj304OR0HrgOXoImpvgyMaUr8QaE88WgDs=; b=Mq5ag4ph4BXYTH737qBZST+8uGuMdUMcGMYYJP5gY0rNv3po82rKbcqY4or6+/GdlbNEBt CwvuDepQb4S5SSpDr1sH+ZbTG6DPhcpX+aAWlgXDvxVZykITAPGP5u8hmCkXH9OoF102O6 PqQjAwPVlvbGM4RnAaAvLjm+NkF/7WI= X-MC-Unique: 77RSeWpJNE27RbYBr_jzFw-1 X-MC-Unique: -C_fLjtcOyiEegq-mq5fuQ-1 X-QQ-mid: xmsmtpt1585299208tiao16zjh X-QQ-XMAILINFO: NmQXtrk+Kov6qNMfh67RbqKRePpq6kNPNicXsbE7a22u1cunRfiZInRYAfWM+h WojEuj+3acgwLwlCaSSgQmQs3dPIpGGDgqoFbcy6QrqdbrzMxfKDSeW7yhUboRG56Z9/q0ntWzii ozBE8PiDGAbUV4wnbVn+sm1gPlUQX4OrDGZOyAWs6yWYq27awbVvGWRjmliU0SMNtwa9eVKMUyJP nRA0642dHoy1mmj3mYAufUpyNdBwXmVu40JiuV1scF3llfJcPQMcFPjEBB2dELp4rq/VGwFRDMNX yqNRFo+ckxYEUqQUpkDmvkaN0wAP5KW4fwQ7cvVSu28+AGzGkwQ1wISxk0NTfwM0OwxQ+xyrVMWK 3Q89M21LWr1l83e52S+NNMr9wTEgY6oDcqaEU8sqg4bIcWO48YrFPp+EdqToSta8/0AXj4LHgxTW 3MQXTGcrLV44+Mf98CpEHg/Zvy2x3a1NMFnH+QRc6okhQTPCD42m/3IKzkq8FRiNmbeHlHLHtpBL I0W9llYtczRbNUMRyImRu8U1kOOtxnrsIZnXpWUyJ1Zh3oahVopXzs5n4BOGoW7CrFiX6eFl4unu m/tBds3GaxNp78JnfrFnoWAqTVj4MKLFIXiLIEIcPpAt+hTS2QlbGsF5KN From: Zhenyu Zheng To: libvir-list@redhat.com Subject: [PATCH 3/5] cpu: Introduce arm related structs Date: Fri, 27 Mar 2020 16:52:21 +0800 Message-Id: <20200327085220.1811-4-zheng.zhenyu@foxmail.com> In-Reply-To: <20200327085220.1811-1-zheng.zhenyu@foxmail.com> References: <20200327085220.1811-1-zheng.zhenyu@foxmail.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 02R8tFjA030053 X-loop: libvir-list@redhat.com X-Mailman-Approved-At: Fri, 27 Mar 2020 06:21:59 -0400 Cc: Zhenyu Zheng 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.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Introduce arm related structs cpu_arm.c --- src/cpu/cpu_arm.c | 71 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) diff --git a/src/cpu/cpu_arm.c b/src/cpu/cpu_arm.c index ee5802198f..2a05f43118 100644 --- a/src/cpu/cpu_arm.c +++ b/src/cpu/cpu_arm.c @@ -26,6 +26,8 @@ #include "cpu_map.h" #include "virstring.h" #include "virxml.h" +#include "cpu_map.h" +#include "cpu_arm.h" =20 #define VIR_FROM_THIS VIR_FROM_CPU =20 @@ -36,6 +38,21 @@ static const virArch archs[] =3D { VIR_ARCH_AARCH64, }; =20 +typedef struct _virCPUarmVendor virCPUarmVendor; +typedef virCPUarmVendor *virCPUarmVendorPtr; +struct _virCPUarmVendor { + char *name; + unsigned long value; +}; + +typedef struct _virCPUarmModel virCPUarmModel; +typedef virCPUarmModel *virCPUarmModelPtr; +struct _virCPUarmModel { + char *name; + virCPUarmVendorPtr vendor; + virCPUarmData data; +}; + typedef struct _virCPUarmFeature virCPUarmFeature; typedef virCPUarmFeature *virCPUarmFeaturePtr; struct _virCPUarmFeature { @@ -64,9 +81,53 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(virCPUarmFeature, virCPUar= mFeatureFree); typedef struct _virCPUarmMap virCPUarmMap; typedef virCPUarmMap *virCPUarmMapPtr; struct _virCPUarmMap { + size_t nvendors; + virCPUarmVendorPtr *vendors; + size_t nmodels; + virCPUarmModelPtr *models; GPtrArray *features; }; =20 +static void +virCPUarmDataClear(virCPUarmData *data) +{ + if (!data) + return; + + VIR_FREE(data->features); +} + +static void +virCPUarmDataFree(virCPUDataPtr cpuData) +{ + if (!cpuData) + return; + + virCPUarmDataClear(&cpuData->data.arm); + VIR_FREE(cpuData); +} + +static void +armModelFree(virCPUarmModelPtr model) +{ + if (!model) + return; + + virCPUarmDataClear(&model->data); + g_free(model->name); + g_free(model); +} + +static void +armVendorFree(virCPUarmVendorPtr vendor) +{ + if (!vendor) + return; + + g_free(vendor->name); + g_free(vendor); +} + static virCPUarmMapPtr virCPUarmMapNew(void) { @@ -86,6 +147,16 @@ virCPUarmMapFree(virCPUarmMapPtr map) { if (!map) return; + =20 + size_t i; + + for (i =3D 0; i < map->nmodels; i++) + armModelFree(map->models[i]); + g_free(map->models); + + for (i =3D 0; i < map->nvendors; i++) + armVendorFree(map->vendors[i]); + g_free(map->vendors); =20 g_ptr_array_free(map->features, TRUE); =20 --=20 2.26.0.windows.1