From nobody Thu Nov 14 18:11:05 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=citrix.com); dmarc=pass(p=reject dis=none) header.from=citrix.com ARC-Seal: i=2; a=rsa-sha256; t=1690290421; cv=pass; d=zohomail.com; s=zohoarc; b=fIt9Aq/Gh7kzmQ9qmJtcbWa8be5Hn+FLrViy8fU8r1Xcvd+NUB1zbzlpWIWoAMnWK5oaFlvgJ8boAzf51REAqS6fyBrqOJYjJK9BMEKwYOJn29+bjIlO+5l/+d0+tyNVUZywp85XHXbR3dPrX0gy1SJidqSAxR4+6zH/8RKjyS0= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1690290421; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=OvAgEnMZzKsiO5gFVAUArv65sWJ/koiL8PS5eQmSiJs=; b=fknOjMQdulXIUBuUoL/2vhw2IMdGFtxgIztey1cu9p9YL5YP4nMA0227raq5KAW2W4N6sZ59pSvOp73hd5JybODIsk9AFihrutwfPjlRAaFUdxR1OBM6Ux5Zfy2sLq1JCLIoDebwKv8fQszJE7mQ3zGZR1uyzvof9Rc25CuN1/Q= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=citrix.com); dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1690290421476985.4584065553044; Tue, 25 Jul 2023 06:07:01 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.569671.890591 (Exim 4.92) (envelope-from ) id 1qOHkO-0004iH-0e; Tue, 25 Jul 2023 13:06:40 +0000 Received: by outflank-mailman (output) from mailman id 569671.890591; Tue, 25 Jul 2023 13:06:39 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qOHkN-0004i1-S8; Tue, 25 Jul 2023 13:06:39 +0000 Received: by outflank-mailman (input) for mailman id 569671; Tue, 25 Jul 2023 13:06:38 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qOHkM-0004BN-9V for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 13:06:38 +0000 Received: from esa4.hc3370-68.iphmx.com (esa4.hc3370-68.iphmx.com [216.71.155.144]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id f852f70f-2aeb-11ee-8613-37d641c3527e; Tue, 25 Jul 2023 15:05:46 +0200 (CEST) Received: from mail-co1nam11lp2169.outbound.protection.outlook.com (HELO NAM11-CO1-obe.outbound.protection.outlook.com) ([104.47.56.169]) by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 25 Jul 2023 09:06:27 -0400 Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21) by SA1PR03MB6516.namprd03.prod.outlook.com (2603:10b6:806:1c7::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.33; Tue, 25 Jul 2023 13:06:25 +0000 Received: from SJ0PR03MB6423.namprd03.prod.outlook.com ([fe80::2e0e:5665:96a7:5767]) by SJ0PR03MB6423.namprd03.prod.outlook.com ([fe80::2e0e:5665:96a7:5767%3]) with mapi id 15.20.6609.031; Tue, 25 Jul 2023 13:06:25 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: f852f70f-2aeb-11ee-8613-37d641c3527e DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1690290396; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=/DjRmCpyR41ndqdeo2ztSdCTQNy5XAVA3JYpNnatIeo=; b=NS3wq0BIDjGu6pXsjcrYtHbpSH3HbFmmLSvtLn3QFuDbZm0CtwdvhzZv 0eFkZn9UJstnwPhSM2hsGUKOo+REOZJWt7Xd3n7ndmmHt3IaugS/SEHfG sRuieQfkWwfg786XlPrYbUjYuI0AxTR/YnpOiqYmdj+TVAlYSES4SuoLn E=; X-IronPort-RemoteIP: 104.47.56.169 X-IronPort-MID: 119981299 X-IronPort-Reputation: None X-IronPort-Listener: OutboundMail X-IronPort-SenderGroup: RELAY_O365 X-IronPort-MailFlowPolicy: $RELAYED IronPort-Data: A9a23:vuFeb6MxV0vrVlDvrR2BlsFynXyQoLVcMsEvi/4bfWQNrUog0zxUy GFNCGqDaPjeajH3etwlYNmwpxkE7cfXmtJiQQto+SlhQUwRpJueD7x1DKtS0wC6dZSfER09v 63yTvGacajYm1eF/k/F3oDJ9CU6jufQAOKnUoYoAwgpLSd8UiAtlBl/rOAwh49skLCRDhiE/ Nj/uKUzAnf8s9JPGjxSs/vrRC9H5qyo42tH5AFmPJingXeF/5UrJMNHTU2OByOQrrl8RoaSW +vFxbelyWLVlz9F5gSNy+uTnuUiG9Y+DCDW4pZkc/HKbitq/0Te5p0TJvsEAXq7vh3S9zxHJ HehgrTrIeshFvWkdO3wyHC0GQkmVUFN0OevzXRSLaV/ZqAJGpfh66wGMa04AWEX0vcrL1hr9 7tCFD4cVSu8lcW76pCQZvY506zPLOGzVG8ekldJ6GiASN0BGNXESaiM4sJE1jAtgMwIBezZe 8cSdTtoalLHfgFLPVAUTpk5mY9EhFGmK2Ee9A3T+PRxujaCpOBy+OGF3N79YNuFSN8Thk+Fj mnH4374ElcRM9n3JT+tqyv917+Wx3KqMG4UPIeI+uNl2gS3/GkCJzYQFma0u9C2qkHrDrqzL GRRoELCt5Ma5EGtC9XwQRC8iHqFpQIHHcpdFfUg7wOAwbaS5ByWbkAbShZRZdpgs9U5LRQo2 UWOhMjBHiF0vfueTnf1y1uPhTa7OCxQJmhbYyYBFFIB+4O6/tB1iQ/TRNF+FqLzlsfyBTz73 zGNqm45mqkXiskIka68+Dgrng6Rm3QAdSZtji2/Y45vxloRiFKND2Bw1WXm0A== IronPort-HdrOrdr: A9a23:oNak46GK+Z9bE1jipLqEzceALOsnbusQ8zAXPiFKKSC9F/byqy nAppomPHPP+VMssRIb9uxoWpPgfZq0z/cci+R8AV7FZniehILBFvAE0WLM+UyDJ8SUzJ846U 4PSdkFNPTASXR8kMbm8E2ZPr8bsaS6GOvBv5a5854Xd3AIV0i41XYANu9MKDwMeDV7 X-Talos-CUID: 9a23:XflY6WC8e0YtksX6Ezg72ncxGId/TnPM90zvMWi1I0RCZKLAHA== X-Talos-MUID: =?us-ascii?q?9a23=3A0+U6YQ35CaWZ0zLgcyEgUrP9tDUj2ZSiFU9XyLE?= =?us-ascii?q?8vtirHiozBjiHpTuXTdpy?= X-IronPort-AV: E=Sophos;i="6.01,230,1684814400"; d="scan'208";a="119981299" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QZXMP0bomo0LK1ts5N3E3/F2ffI6CDEPtUe7CmQNJKg7hTng1w6nlnZtyeQrChqa5g/9i5Jaf0f8YqVHcOpi5q+eqeqzsYvtc26Xb4nVaAc3THpQoUiO7G6CCrANIZJHvxGKEaXgUMMQ5QneuuZZ9xc70MhRK8T6ZhFj/CvZhs5Cxs03wrV5gFzRxv342F5GNXXW5YeONpeXeOKE+VV+QXG5C8hXpyHYBMsYn1wF41C3SM4SJ/vOtZnQbjbUmt8NjH+nI/1AXn4cy35L9zs5kgDNkEAxbrzI8DzLIbgEBMAiTEUfD0Wp0rJd7oSGzLLnTog7l4SrnLzqrc7cuXn3jg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=OvAgEnMZzKsiO5gFVAUArv65sWJ/koiL8PS5eQmSiJs=; b=YrfJ5Ht7lWa/RmjXNc/nYgWNDwVQR5G1/YJNndcJ6qmq4enZU/5sFYH/B1RG5wn5D27M6YiZBizO5d9+2b/78ymNwJVpO9AK7wEDDaxASX4wnfDkSziY0scskGJ55BP05OFKXvAHBRgvvJRsZ9Wb50J2i/nV6HLQ9gxVZuohFMXhIsUAnO9Sc5MlUDJbwAkRXXPjWvSY7oQqmA+a+LKpS1BL7wR4EGetylFmrvO7pq2c5/7Xjo7na21za5FQJj7FuBAUYRJjcX9nQnxicWy0zsadx+ieiM2lSLSE0tD6/kOGpkIyMqgAjuXMxONHhfteZIhsUd0f0zERhBRTJzLefw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OvAgEnMZzKsiO5gFVAUArv65sWJ/koiL8PS5eQmSiJs=; b=TXemCq/e5A9HSugl/SdInMqG3e/h/2x854TDUcigBR82MeDdSYdN9RI2Ek5tek9o9P4pa4SfQ2ezq9kzqETltTvmZoF9/w7+sIw4JSlPLmwmENECGF57sXQjLo+HiM7i/+EK/6iT/pVpJhJ5EWD3a/4lYtNVUhiUO0J5vOAla+s= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com; From: Roger Pau Monne To: xen-devel@lists.xenproject.org Cc: Roger Pau Monne , Wei Liu , Anthony PERARD , Juergen Gross Subject: [PATCH v4 2/6] libxl: change the type of libxl_cpuid_policy_list Date: Tue, 25 Jul 2023 15:05:54 +0200 Message-ID: <20230725130558.58094-3-roger.pau@citrix.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230725130558.58094-1-roger.pau@citrix.com> References: <20230725130558.58094-1-roger.pau@citrix.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: LO4P123CA0552.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:319::14) To SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|SA1PR03MB6516:EE_ X-MS-Office365-Filtering-Correlation-Id: c810b45d-b3b5-4240-5c76-08db8d0ff361 X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: CNEA1qaeQ11vMnyI0IzvN0e12CeU8T8koj5/bq5+wFMmD9mlZrPmrq7juTKmP3n+XQZw7o9Y7vD+eNh/udBogv8n22qbKE9E3OKViZTmMY3CyETkatMYTeru/crWTNIq8xEOFYBsa0cUOAS7swGzlPS/h8MCmjbmrOe6X0RZoLVaHQ0HJ73DM1l+8GD8R7c/U2jyXfGdb2Ix2VC+Wj/fUBVq4bwSi2z24kYEah+B4uoGxaZv9giW842SUZksumd/8BeRZubcD3vxZy8ofNB0S5XBq2keG5C1V0cGKCFFvXuxJUr2OPRScksG4ec134tYWB33YMuvEPl1/bz1Y49B0BIT2yP3lYfjsXQbiRrxfJTm+pUnTvhiUk/xh3/8XdZwjrd+tz9DqUoSHBtyaEjfY1G66j9wLzfk+cG9MfbWIL/a9z883pXqlJKyO75oCmD9B2owwIoGHOzVVtOYP5OkYfW1jnnbwBjMvRjAiRXZ6FA9VQY3gHur8lZwRzhyIKa3N4R6cNd2iTvH4ms9SA1vKv7gvFICfVIzOyAEJL0+DkCB1UjJtJ5JgNNgwZHl+I0b X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(366004)(136003)(346002)(396003)(39860400002)(451199021)(6486002)(6666004)(82960400001)(478600001)(83380400001)(8936002)(1076003)(26005)(6512007)(6506007)(66946007)(38100700002)(66556008)(54906003)(6916009)(4326008)(66476007)(186003)(2616005)(5660300002)(8676002)(2906002)(316002)(41300700001)(86362001)(36756003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?dnNqcjdqc1pIazd1ZEI2R2xwamlxRDRVSWYzdW5BV0IrR1NnUHJqZzRWaUkz?= =?utf-8?B?TjdxcGZrWFZuUTVlWGF0aHRRa1pncXZSQ013SDBRR1o0SjFGQ1psamVRQ2ho?= =?utf-8?B?b0FEVlExbkl1Z0duYm4wVXg4WnFaRFFxYlFtU2dNNUVoVnFuOEdrdXFsMXhC?= =?utf-8?B?TWFhcGo5ekw0RWZnZzkzRGdIbWtiZGJsakVDRk5VOGh4WG0vYnR1K3d5VHk2?= =?utf-8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MMr3uXvAn0XRMpDUGadMVS6iW1pOhelOVih8QtPTd7Cq8Rm X-OriginatorOrg: citrix.com X-MS-Exchange-CrossTenant-Network-Message-Id: c810b45d-b3b5-4240-5c76-08db8d0ff361 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2023 13:06:25.2836 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: gklcuy1WpFY+prOgUOoBkRJmEiza7S6Tl4/gNhM1ckOVjmihXETUp5RqHnbZdeXkQ/HnKjb+qbvh/zSdnJUzcw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR03MB6516 X-ZohoMail-DKIM: pass (identity @citrix.com) X-ZM-MESSAGEID: 1690290461065100001 Currently libxl_cpuid_policy_list is an opaque type to the users of libxl, and internally it's an array of xc_xend_cpuid objects. Change the type to instead be a structure that contains one array for CPUID policies, in preparation for it also holding another array for MSR policies. Signed-off-by: Roger Pau Monn=C3=A9 Reviewed-by: Anthony PERARD --- Changes since v2: - Add braces in the inner loop. - Do not set the policy to NULL. --- tools/include/libxl.h | 8 +-- tools/libs/light/libxl_cpuid.c | 87 ++++++++++++++++++++----------- tools/libs/light/libxl_internal.h | 4 ++ 3 files changed, 63 insertions(+), 36 deletions(-) diff --git a/tools/include/libxl.h b/tools/include/libxl.h index cac641a7eba2..f3975ecc021f 100644 --- a/tools/include/libxl.h +++ b/tools/include/libxl.h @@ -1455,12 +1455,8 @@ typedef struct { void libxl_bitmap_init(libxl_bitmap *map); void libxl_bitmap_dispose(libxl_bitmap *map); =20 -/* - * libxl_cpuid_policy is opaque in the libxl ABI. Users of both libxl and - * libxc may not make assumptions about xc_xend_cpuid. - */ -typedef struct xc_xend_cpuid libxl_cpuid_policy; -typedef libxl_cpuid_policy * libxl_cpuid_policy_list; +struct libxl__cpu_policy; +typedef struct libxl__cpu_policy *libxl_cpuid_policy_list; void libxl_cpuid_dispose(libxl_cpuid_policy_list *cpuid_list); int libxl_cpuid_policy_list_length(const libxl_cpuid_policy_list *l); void libxl_cpuid_policy_list_copy(libxl_ctx *ctx, diff --git a/tools/libs/light/libxl_cpuid.c b/tools/libs/light/libxl_cpuid.c index c96aeb3bce46..3c8b2a72c0b8 100644 --- a/tools/libs/light/libxl_cpuid.c +++ b/tools/libs/light/libxl_cpuid.c @@ -19,22 +19,29 @@ int libxl__cpuid_policy_is_empty(libxl_cpuid_policy_lis= t *pl) return !libxl_cpuid_policy_list_length(pl); } =20 -void libxl_cpuid_dispose(libxl_cpuid_policy_list *p_cpuid_list) +void libxl_cpuid_dispose(libxl_cpuid_policy_list *pl) { - int i, j; - libxl_cpuid_policy_list cpuid_list =3D *p_cpuid_list; + libxl_cpuid_policy_list policy =3D *pl; =20 - if (cpuid_list =3D=3D NULL) + if (policy =3D=3D NULL) return; - for (i =3D 0; cpuid_list[i].input[0] !=3D XEN_CPUID_INPUT_UNUSED; i++)= { - for (j =3D 0; j < 4; j++) - if (cpuid_list[i].policy[j] !=3D NULL) { - free(cpuid_list[i].policy[j]); - cpuid_list[i].policy[j] =3D NULL; + + if (policy->cpuid) { + unsigned int i, j; + struct xc_xend_cpuid *cpuid_list =3D policy->cpuid; + + for (i =3D 0; cpuid_list[i].input[0] !=3D XEN_CPUID_INPUT_UNUSED; = i++) { + for (j =3D 0; j < 4; j++) { + if (cpuid_list[i].policy[j] !=3D NULL) { + free(cpuid_list[i].policy[j]); + } } + } + free(policy->cpuid); } - free(cpuid_list); - *p_cpuid_list =3D NULL; + + free(policy); + *pl =3D NULL; return; } =20 @@ -62,11 +69,17 @@ struct cpuid_flags { /* go through the dynamic array finding the entry for a specified leaf. * if no entry exists, allocate one and return that. */ -static libxl_cpuid_policy_list cpuid_find_match(libxl_cpuid_policy_list *l= ist, - uint32_t leaf, uint32_t subleaf) +static struct xc_xend_cpuid *cpuid_find_match(libxl_cpuid_policy_list *pl, + uint32_t leaf, uint32_t subl= eaf) { + libxl_cpuid_policy_list policy =3D *pl; + struct xc_xend_cpuid **list; int i =3D 0; =20 + if (policy =3D=3D NULL) + policy =3D *pl =3D calloc(1, sizeof(*policy)); + + list =3D &policy->cpuid; if (*list !=3D NULL) { for (i =3D 0; (*list)[i].input[0] !=3D XEN_CPUID_INPUT_UNUSED; i++= ) { if ((*list)[i].input[0] =3D=3D leaf && (*list)[i].input[1] =3D= =3D subleaf) @@ -86,7 +99,7 @@ static libxl_cpuid_policy_list cpuid_find_match(libxl_cpu= id_policy_list *list, * Will overwrite earlier entries and thus can be called multiple * times. */ -int libxl_cpuid_parse_config(libxl_cpuid_policy_list *cpuid, const char* s= tr) +int libxl_cpuid_parse_config(libxl_cpuid_policy_list *policy, const char* = str) { #define NA XEN_CPUID_INPUT_UNUSED static const struct cpuid_flags cpuid_flags[] =3D { @@ -345,7 +358,7 @@ int libxl_cpuid_parse_config(libxl_cpuid_policy_list *c= puid, const char* str) if (flag->name =3D=3D NULL) { return 2; } - entry =3D cpuid_find_match(cpuid, flag->leaf, flag->subleaf); + entry =3D cpuid_find_match(policy, flag->leaf, flag->subleaf); resstr =3D entry->policy[flag->reg - 1]; num =3D strtoull(val, &endptr, 0); flags[flag->length] =3D 0; @@ -400,7 +413,7 @@ int libxl_cpuid_parse_config(libxl_cpuid_policy_list *c= puid, const char* str) * the strings for each register were directly exposed to the user. * Used for maintaining compatibility with older config files */ -int libxl_cpuid_parse_config_xend(libxl_cpuid_policy_list *cpuid, +int libxl_cpuid_parse_config_xend(libxl_cpuid_policy_list *policy, const char* str) { char *endptr; @@ -427,7 +440,7 @@ int libxl_cpuid_parse_config_xend(libxl_cpuid_policy_li= st *cpuid, return 3; } str =3D endptr + 1; - entry =3D cpuid_find_match(cpuid, leaf, subleaf); + entry =3D cpuid_find_match(policy, leaf, subleaf); for (str =3D endptr + 1; *str !=3D 0;) { if (str[0] !=3D 'e' || str[2] !=3D 'x') { return 4; @@ -502,7 +515,8 @@ int libxl__cpuid_legacy(libxl_ctx *ctx, uint32_t domid,= bool restore, info->tsc_mode =3D=3D LIBXL_TSC_MODE_ALWAYS_EMULATE); =20 r =3D xc_cpuid_apply_policy(ctx->xch, domid, restore, NULL, 0, - pae, itsc, nested_virt, info->cpuid, NULL); + pae, itsc, nested_virt, + info->cpuid ? info->cpuid->cpuid : NULL, NUL= L); if (r) LOGEVD(ERROR, -r, domid, "Failed to apply CPUID policy"); =20 @@ -527,16 +541,18 @@ static const char *policy_names[4] =3D { "eax", "ebx"= , "ecx", "edx" }; */ =20 yajl_gen_status libxl_cpuid_policy_list_gen_json(yajl_gen hand, - libxl_cpuid_policy_list *pcpuid) + libxl_cpuid_policy_list *pl) { - libxl_cpuid_policy_list cpuid =3D *pcpuid; + libxl_cpuid_policy_list policy =3D *pl; + struct xc_xend_cpuid *cpuid; yajl_gen_status s; int i, j; =20 s =3D yajl_gen_array_open(hand); if (s !=3D yajl_gen_status_ok) goto out; =20 - if (cpuid =3D=3D NULL) goto empty; + if (policy =3D=3D NULL || policy->cpuid =3D=3D NULL) goto empty; + cpuid =3D policy->cpuid; =20 for (i =3D 0; cpuid[i].input[0] !=3D XEN_CPUID_INPUT_UNUSED; i++) { s =3D yajl_gen_map_open(hand); @@ -575,7 +591,7 @@ int libxl__cpuid_policy_list_parse_json(libxl__gc *gc, libxl_cpuid_policy_list *p) { int i, size; - libxl_cpuid_policy_list l; + struct xc_xend_cpuid *l; flexarray_t *array; =20 if (!libxl__json_object_is_array(o)) @@ -586,8 +602,10 @@ int libxl__cpuid_policy_list_parse_json(libxl__gc *gc, return 0; =20 size =3D array->count; + *p =3D libxl__calloc(NOGC, 1, sizeof(**p)); /* need one extra slot as sentinel */ - l =3D *p =3D libxl__calloc(NOGC, size + 1, sizeof(libxl_cpuid_policy)); + l =3D (*p)->cpuid =3D libxl__calloc(NOGC, size + 1, + sizeof(struct xc_xend_cpuid)); =20 l[size].input[0] =3D XEN_CPUID_INPUT_UNUSED; l[size].input[1] =3D XEN_CPUID_INPUT_UNUSED; @@ -630,8 +648,12 @@ int libxl__cpuid_policy_list_parse_json(libxl__gc *gc, int libxl_cpuid_policy_list_length(const libxl_cpuid_policy_list *pl) { int i =3D 0; - libxl_cpuid_policy_list l =3D *pl; + const struct xc_xend_cpuid *l; + + if (*pl =3D=3D NULL) + return 0; =20 + l =3D (*pl)->cpuid; if (l) { while (l[i].input[0] !=3D XEN_CPUID_INPUT_UNUSED) i++; @@ -641,20 +663,25 @@ int libxl_cpuid_policy_list_length(const libxl_cpuid_= policy_list *pl) } =20 void libxl_cpuid_policy_list_copy(libxl_ctx *ctx, - libxl_cpuid_policy_list *dst, - const libxl_cpuid_policy_list *src) + libxl_cpuid_policy_list *pdst, + const libxl_cpuid_policy_list *psrc) { + struct xc_xend_cpuid **dst; + struct xc_xend_cpuid *const *src; GC_INIT(ctx); int i, j, len; =20 - if (*src =3D=3D NULL) { - *dst =3D NULL; + if (*psrc =3D=3D NULL) { + *pdst =3D NULL; goto out; } =20 - len =3D libxl_cpuid_policy_list_length(src); + *pdst =3D libxl__calloc(NOGC, 1, sizeof(**pdst)); + dst =3D &(*pdst)->cpuid; + src =3D &(*psrc)->cpuid; + len =3D libxl_cpuid_policy_list_length(psrc); /* one extra slot for sentinel */ - *dst =3D libxl__calloc(NOGC, len + 1, sizeof(libxl_cpuid_policy)); + *dst =3D libxl__calloc(NOGC, len + 1, sizeof(struct xc_xend_cpuid)); (*dst)[len].input[0] =3D XEN_CPUID_INPUT_UNUSED; (*dst)[len].input[1] =3D XEN_CPUID_INPUT_UNUSED; =20 diff --git a/tools/libs/light/libxl_internal.h b/tools/libs/light/libxl_int= ernal.h index 1cf3d400bfce..ef882cff3912 100644 --- a/tools/libs/light/libxl_internal.h +++ b/tools/libs/light/libxl_internal.h @@ -4869,6 +4869,10 @@ int libxl__setresuid(uid_t ruid, uid_t euid, uid_t s= uid); _hidden int libxl__domain_set_paging_mempool_size( libxl__gc *gc, libxl_domain_config *d_config, uint32_t domid); =20 +struct libxl__cpu_policy { + struct xc_xend_cpuid *cpuid; +}; + #endif =20 /* --=20 2.41.0