From nobody Wed Nov 13 07:09:10 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=1689841651; cv=pass; d=zohomail.com; s=zohoarc; b=Bu8pYK/tjjEnY/RflHCbzrB0npiXjHymr9KpH5G+0MVhNpJi2oeM9afYH2mFw1C/IFPJs9ReGgk9QdtnlTrWLNA21B7TBiditYXwmBegzRaxlkfvqdUPmQv+4B+zviZq6rB9h5Uxy6cJ4BuIh68L6BVhFhOulsMn2cg/VjC2Ews= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1689841651; 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=hChKsZCZHDVRrUqeVcps98JsH8PAoO3L382+Gr3m+i7qrFXeVxFwjeppIxa7M24BKp1NvWzknM90cZ16HtGqSoXb2qbn530RSS0236xAcsaBfmpHa6HA8kZIvPqOJLqOzCdHLwp4mS0Tprj9cSirC6XOIp8WR554vEjpQbJlGag= 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 1689841651021613.2736885713114; Thu, 20 Jul 2023 01:27:31 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.566464.885301 (Exim 4.92) (envelope-from ) id 1qMP02-0001x6-24; Thu, 20 Jul 2023 08:27:02 +0000 Received: by outflank-mailman (output) from mailman id 566464.885301; Thu, 20 Jul 2023 08:27:02 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qMP01-0001wx-Ua; Thu, 20 Jul 2023 08:27:01 +0000 Received: by outflank-mailman (input) for mailman id 566464; Thu, 20 Jul 2023 08:27:01 +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 1qMP01-0001wC-9g for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 08:27:01 +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 30b1478a-26d7-11ee-8611-37d641c3527e; Thu, 20 Jul 2023 10:26:58 +0200 (CEST) Received: from mail-co1nam11lp2172.outbound.protection.outlook.com (HELO NAM11-CO1-obe.outbound.protection.outlook.com) ([104.47.56.172]) by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 20 Jul 2023 04:26:56 -0400 Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21) by SJ0PR03MB5760.namprd03.prod.outlook.com (2603:10b6:a03:2d3::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.24; Thu, 20 Jul 2023 08:26:54 +0000 Received: from SJ0PR03MB6423.namprd03.prod.outlook.com ([fe80::38aa:4814:3c7b:78ea]) by SJ0PR03MB6423.namprd03.prod.outlook.com ([fe80::38aa:4814:3c7b:78ea%5]) with mapi id 15.20.6588.031; Thu, 20 Jul 2023 08:26:54 +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: 30b1478a-26d7-11ee-8611-37d641c3527e DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1689841618; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=/DjRmCpyR41ndqdeo2ztSdCTQNy5XAVA3JYpNnatIeo=; b=ftnWY6hL7VgwqLsQWHpW9uHkZ1sj7j0WYvsNlDgAy4Fj4ycm/wRRfZvW 31Ib4tDGKldjlw+MFBvQOG7RNHG/EkNH7Ha3PBHee9QaeBgb2ZH6uTeri SAoPqskD1Tl7skas/R1Be1y2gwvGudeIBSPTZAmbGFFhnCHiKvNLM9/ra w=; X-IronPort-RemoteIP: 104.47.56.172 X-IronPort-MID: 119438774 X-IronPort-Reputation: None X-IronPort-Listener: OutboundMail X-IronPort-SenderGroup: RELAY_O365 X-IronPort-MailFlowPolicy: $RELAYED IronPort-Data: A9a23:Ch9616kpu7fNlT+VY510n3To5gylJ0RdPkR7XQ2eYbSJt1+Wr1Gzt xIeWW/UbKuLZDDweNtwbY3l80IA6pCGydY3G1Nt+30yESMWpZLJC+rCIxarNUt+DCFhoGFPt JxCN4aafKjYaleG+39B55C49SEUOZmgH+a6U6icfHgqH2eIcQ954Tp7gek1n4V0ttawBgKJq LvartbWfVSowFaYCEpNg064gE0p5K2aVA8w5ARkPqgU5geGzhH5MbpETU2PByqgKmVrNrbSq 9brlNmR4m7f9hExPdKp+p6TnpoiG+O60aCm0xK6aoD66vRwjnVaPpUTbZLwXXx/mTSR9+2d/ f0W3XCGpaXFCYWX8AgVe0Ew/yiTpsSq8pefSZS0mZT7I0Er7xIAahihZa07FdRwxwp5PY1B3 eU3ITEtYwq+vbKd6bLjeswxhpsyHOC+aevzulk4pd3YJdAPZMmaBo7tvJpf1jp2gd1SF/HDY cZfcSBocBnLfxxIPBEQFY46m+CrwHL4dlW0qnrM/fZxvzeVkVI3iee3WDbWUoXiqcF9hEGXq 3iA523kKhobKMae2XyO9XfEaurnxHqqBNlCS+LknhJsqGS612cPLRtOb1vhovK0r0GQeYlwO WVBr0LCqoB3riRHVOLVTxC+5XKJoBMYc95RCPEhrhGAzLLO5ASUDXRCSSROAPQ5sOcmSDps0 UWG9/vrCiZoq6a9Um+G+/GfqjbaBMQOBWoLZCtBRgxc5dDm+dg3lkiWEYwlF7OphNroHz222 yqNsCU1m7QUi4gMyrm/+lfExTmro/AlUzII2+keZUr9hisRWWJvT9XABYTzhRqYELukcw== IronPort-HdrOrdr: A9a23:aCMXEahTclZrniC8DD8mkUFGdXBQXtkji2hC6mlwRA09TyVXrb HIoB17726TtN91YhsdcL+7Scq9qB/nlaKdgrNxAV7BZniFhILAFugLhrcKqAeQfhEWmNQtsZ uIsJITNDQzNzVHZArBjzVQ2uxP/OW6 X-Talos-CUID: 9a23:vKxboG/3ppn1GcCXT8+Vv1c7E8EFf2fg9if7Ck/gOUM0SOKEeXbFrQ== X-Talos-MUID: =?us-ascii?q?9a23=3ArYQT+QwAMvpmTn1BATxJuho5TmmaqJ2HGUsRtJN?= =?us-ascii?q?egcneNid9Hjizrm+YUKZyfw=3D=3D?= X-IronPort-AV: E=Sophos;i="6.01,218,1684814400"; d="scan'208";a="119438774" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mj6B5YE8huTW1l3U6Wii6rXCReMMG04xbfwLrRwDRGscaB9W2/Rxq5vUgVCcPOpBYYj7n+O9Twi+wjl3bxRPY1hbp/rZyUphN5fm7H0o4oYaEu/rkKps37hdLClNO0NCVUT9A5BdnQO/wyRU0emVVkj9pIrgXUrM4tHJIfRUpFtc5aQ3GLbEX7RXDGdlNR8wjrA9UWOwwKvxh//LQCHoK+DOqoj+LV+6aY0GLDTPMUtXKCMWVyctC8srJNBOd+nbfHbQ2X7udOOgWBmLEQm+66OZ9NKWSoTIvvKJIefqJmkzXc3BjBDnCn/QzgfwACLoRyCMJjdm6LPuvytSUotWbg== 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=e2oEeOkYJgPmgfgEC1MHxqbS/+82LlQl2tus4SyYDXdEhEsjNAaei33ZgUh54UrKOTPBikTSvNHj9wiPC/kSE17+xKm86BXWI0ScpYj/sPhoYnrNlG3qI0tggCUHYCD9fN5lSXN5QDQZILEBVv35a4YXE+lTPFT+DwhB9uIxY1A8v20aw69hv5VZ2OqLcc2EZfPlXK19HC9B+O3fZfhFxoPtwKkB7b6lPLPBSroOQvW/IwVhnWHDJInp544I8p5W6/Zq2kaOU1ebjQCmBfOfr93QV6Cr13d2pqBq71rODh4UJlX1EIHVJQtXUPHW5fFc0z/ZL4+SwGKcGvkI47Pkuw== 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=QLrMQufRGVVfKDTMPYv+omkwjP5+eIV3lXbpZK07AgvBjBQa7QlWKGJCoe+uhyk10kKPjYo1EOnsLG03Hyg4aLxr6oCegOwI/LA/srngkrg3WU/pURlNxwpz4SfqXoqSywE7v7wGzzcwfFOmKyFz0dFAOSG9XYHvcdR28IL+WP8= 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 v3 2/6] libxl: change the type of libxl_cpuid_policy_list Date: Thu, 20 Jul 2023 10:25:36 +0200 Message-ID: <20230720082540.69444-3-roger.pau@citrix.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230720082540.69444-1-roger.pau@citrix.com> References: <20230720082540.69444-1-roger.pau@citrix.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: LO4P265CA0159.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:2c7::9) To SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|SJ0PR03MB5760:EE_ X-MS-Office365-Filtering-Correlation-Id: d2e00534-d6a8-4e32-58ad-08db88fb12fa 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: B4uE0kWJPx/DzfZ/csNp1qO8g2z23vKPFWCQCkxOozLbu8qB/BjIjie3ImPL8UgzvwM1dJ3VMiqzY0l2eWAs5sKe0hr4E9lstcp4XvdG/50gGUM3xorZmciJbeQgqI4U8R5rkLz/6P7crEO2cRG8KJ7c7uiQMK3WXF+7koh5aS2T607xXTxjvXRqfx1gGvhC+VVWZ62kvXkV4z8chNDOg9rYfOazhZXHRB0TXoKXdHcNxZsbdXGUFppW2KkDe1UIz1V3a1I1dbl+yKJvS30AXu0T1ATj1Ms1JXfaKT2FSVZYaTATIHubAzHsQf4wvFvR+Kq9qtBQc/2ImRs+nbEAe2McQLWibeFgkWpjptUJw1O3YTbFT5BttD3fzpd25NqrYTf7fgRPaCFQ7/zJIrW7JQ6TjU+f4wqT0jTFomG6Iy1sIbz59XT3npkHZevn5uMPgr3uq3TIwj1WCtNUE0hMS90XfC6yrNKxxi5TnghrV/DdVJBZ2BeuGvB8BIszXFQqpqZynq11LxKeqVAU0a0gVAMEXAFMAEbgkiq++D6MyUERihyqqopnBkYK4B1JF+Iv 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)(396003)(39860400002)(346002)(136003)(376002)(366004)(451199021)(86362001)(478600001)(83380400001)(1076003)(186003)(38100700002)(41300700001)(26005)(54906003)(6916009)(8676002)(8936002)(316002)(2906002)(4326008)(6512007)(66556008)(66946007)(6666004)(66476007)(6486002)(6506007)(82960400001)(2616005)(36756003)(5660300002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?TTEzOTE1V2oxb3ZVeUV2NVZ0OUx0R2VqNiszMFBaRzMwams2aXlYVnQ0QWpB?= =?utf-8?B?b29mek9kdUJGK2Q2Ynl4ZEVlOTE3Q2pGVy9XdG5pYVNnM1J3YWM2czFZcm5q?= =?utf-8?B?NTFPS1NSbjl5Kzg3UThuTkt6Vjk4MFo4N0VjNTA3UThTY1Z3QnByaFBmcWR5?= =?utf-8?B?M01FbURySzBaUCs0bE51bTlmazU0WnM4Sm83RjhrUmpncytmN1FFTUpSNFFq?= =?utf-8?B?cHlOWnMzQlk2Vi9kNTkzeGVGNEdwMDVRMlVTTytPc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: citrix.com X-MS-Exchange-CrossTenant-Network-Message-Id: d2e00534-d6a8-4e32-58ad-08db88fb12fa X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jul 2023 08:26:54.2132 (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: ztLEp0jOqdlrkrEQMauEoJ6IlX78pwBVEt0tQtsYZds5goEJchQuxSd5zSr5vpUY6aPEbhcXHJXxIQFPrSmsIg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR03MB5760 X-ZohoMail-DKIM: pass (identity @citrix.com) X-ZM-MESSAGEID: 1689841651659100002 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