From nobody Thu Nov 14 17:42:30 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=1690290426; cv=pass; d=zohomail.com; s=zohoarc; b=LmEVRdiqZKCJFxPi9Lk37HwuSO6m//zMlShqsO3lK68ZSX3SYBCsiN9xMh6zCU815oDVw/71jh3OZNoT2Q0ACYaFKcVSO7bYrCV7T45f1jhQunDvK2ecNFNuNhCibSOwY/H+rk1NHWNW4OxA9V0qIngR9ixOOTmPl9kiVYBfDXk= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1690290426; 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=T7eRUdhf8n5WuI46Z6Zzvuxd+0+61lrZHp1tvM3LQ/4=; b=aktscQ/uk7wm3VFCOIJFDdy6uqs0+O25AzkX0Q3nv5p0XarIlfcnidT2akov8ZV9KMEvYLChJ8HKSNQ+MRlZWnys1xMCK7/0DK0Erk5yAsTy8JFDQu0UU3Yln3YSL15UPuw32vgld4Nibbd8AM8iM69fSJ1W+7FPzEMaPuU80Fk= 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 169029042657129.850663263955994; Tue, 25 Jul 2023 06:07:06 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.569670.890581 (Exim 4.92) (envelope-from ) id 1qOHkM-0004Rj-FW; Tue, 25 Jul 2023 13:06:38 +0000 Received: by outflank-mailman (output) from mailman id 569670.890581; Tue, 25 Jul 2023 13:06:38 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qOHkM-0004RZ-Cc; Tue, 25 Jul 2023 13:06:38 +0000 Received: by outflank-mailman (input) for mailman id 569670; Tue, 25 Jul 2023 13:06:37 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qOHkL-0003uq-DN for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 13:06:37 +0000 Received: from esa2.hc3370-68.iphmx.com (esa2.hc3370-68.iphmx.com [216.71.145.153]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 14d87be6-2aec-11ee-b23f-6b7b168915f2; Tue, 25 Jul 2023 15:06:36 +0200 (CEST) Received: from mail-co1nam11lp2176.outbound.protection.outlook.com (HELO NAM11-CO1-obe.outbound.protection.outlook.com) ([104.47.56.176]) by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 25 Jul 2023 09:06:33 -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:31 +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:31 +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: 14d87be6-2aec-11ee-b23f-6b7b168915f2 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1690290395; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=JIumuHTKjeGUw+xjOuW7QgTbX2kySrmgaixI+f/zzfA=; b=DFgX/0HgS/T2QiaHb4SMOlJtyxJH8L2GgV540GOq+eYW3QtfvVhzS8Xh yKwaJuZGta+F7fq0dLloiL2P9qHRKBAGFX4HTiiRnCKSeYBwoTaxWFHys KkcbZf2C5i+3PTt8hLrnKhGWb0gMMlwTe5ky3ISRq+Dilac8o5G9KUnNI A=; X-IronPort-RemoteIP: 104.47.56.176 X-IronPort-MID: 117238716 X-IronPort-Reputation: None X-IronPort-Listener: OutboundMail X-IronPort-SenderGroup: RELAY_O365 X-IronPort-MailFlowPolicy: $RELAYED IronPort-Data: A9a23:6sNhbKl5rLf/Z6X8afdDSbno5gylJ0RdPkR7XQ2eYbSJt1+Wr1Gzt xIaDW2HM/rbMWb0fotzOY/l8h5QvpDQnIVnTwRl/n08QSMWpZLJC+rCIxarNUt+DCFhoGFPt JxCN4aafKjYaleG+39B55C49SEUOZmgH+a6U6icfHgqH2eIcQ954Tp7gek1n4V0ttawBgKJq LvartbWfVSowFaYCEpNg064gE0p5K2aVA8w5ARkPqgU5gKGzhH5MbpETU2PByqgKmVrNrbSq 9brlNmR4m7f9hExPdKp+p6TnpoiG+O60aCm0xK6aoD66vRwjnVaPpUTbZLwXXx/mTSR9+2d/ f0W3XCGpaXFCYWX8AgVe0Ew/yiTpsSq8pefSZS0mZT7I0Er7xIAahihZa07FdRwxwp5PY1B3 aURDzFdRSKsvO+VzJSlbLBjm/4/Ksa+aevzulk4pd3YJdAPZMmaBo7tvJpf1jp2gd1SF/HDY cZfcSBocBnLfxxIPBEQFY46m+CrwHL4dlW0qnrM/fZxvzeVkVI3ieezWDbWUoXiqcF9hEGXq 3iA523kKhobKMae2XyO9XfEaurnxHqkAtlCS+TmnhJsqHCoxWMOJRMrb1jluuukrxeRV/dYG kNBr0LCqoB3riRHVOLVTxC+5XKJoBMYc95RCPEhrhGAzLLO5ASUDXRCSSROAPQ5sOcmSDps0 UWG9/vrCiZoq6a9Um+G+/GfqjbaBMQOBWoLZCtBRgxc5dDm+dg3lkiWEYglF7OphNroHz222 yqNsCU1m7QUi4gMyrm/+lfExTmro/AlUzII2+keZUr9hisRWWJvT9bABYTzhRqYELukcw== IronPort-HdrOrdr: A9a23:vxqEjKyhbConwiZOzTEzKrPwCb1zdoMgy1knxilNoH1uEvBw8v rEoB1173HJYVoqKRQdcLO7V5VoI0m8yXcd2+B4V9rPYOCBghrQEGgL1/qE/9TOIVydygc379 YFT0ERMqyLMXFKyer8/QmkA5IB7bC8gd2Vbay39QYKcegQUdAC0+6hMHfiLqShfng8OaYE X-Talos-CUID: 9a23:0UXR+Gyo/PqNrxMfYWJNBgVNE+ckIlbv40zdAEOeF0AwR6CvVVmfrfY= X-Talos-MUID: =?us-ascii?q?9a23=3AZ78N0Q0b79uFS/nXitHFG4zMrjUjzp+tB10gn6g?= =?us-ascii?q?8uJefJzFVYhiRqTOGTdpy?= X-IronPort-AV: E=Sophos;i="6.01,230,1684814400"; d="scan'208";a="117238716" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kW/KYh8RNZ2GYvwGTTj0rcIpXQ4L+zCC2+QY90QTeIPAiOvzul1OOOy/zjDLaVTK4PUXuxwMNd/S73dvddsqF5P43+TJ5HolNJ9JpPrsPwXVXObWiu+ZhEXa2nzM2LR56pNzR3YzMsXeoHC01GrhrnG64Dm9c0C1C/4HkoPm6Ga+xXyZgxWduoXN9zkQh1vQNk4+zsJKvNi5XFZ+zScJ0FUVRP/fFqITPkjK6nEm+3dOO552BWAkg5OAA51rDwizfU94lxEyi2L359OBhjjJ/B7BPMU++vR4wtP2a70aAFMqkgBlRYCHY5e4xodwOHuMVQni1ZZ1+8+IinhbNhtvVg== 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=T7eRUdhf8n5WuI46Z6Zzvuxd+0+61lrZHp1tvM3LQ/4=; b=NoLe/QZvRWqstynHzS3Cp1HiTrEaeQ+wopI/xJzYgBGErrvWhG+9N9XRwRR1Ot8IH5HZv+Y1NVkEeYpgOGSRoJiFHvTx4tHt1ipGtgjBjaY3U3xVJDroyJ7X6bD4sEmJGYb4p7M5slcE6O3/Eo/Qim+5PKTA7z22RMZmiX0342ZQH95OjdBT+jFP/LLzoZ/hwoTS4Ez1nhng1cUd9sda3iyI0h+Gliswttz9pshuT391egFSwkH7ZHjdVLTYv4N3E8otNCEr+UE3kGmQWNZMS5y47Wj0lfhJx6oe+ZZW77/TghOQ6DNgOUSf3Yc8aNfLHOjUNkhgmHmTJfSjxGFknQ== 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=T7eRUdhf8n5WuI46Z6Zzvuxd+0+61lrZHp1tvM3LQ/4=; b=ElRG6uALVEPV0/HYMSz9jT7/G3ZfjqeUOJXNfgWkb4FSncpsdmyUXPLbJAvzaIVsTj2Rdl9mzZ5dijphObnFFpyc6AoVaqyCbh1BD32sXfM/ft+ZWdvoKhmiN2ziALZkWtF/1QdSyjO8b2dJvjr8R8roHE6MvhinmaXbqy3ZsrU= 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 3/6] libxl: introduce MSR data in libxl_cpuid_policy Date: Tue, 25 Jul 2023 15:05:55 +0200 Message-ID: <20230725130558.58094-4-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: LO4P123CA0238.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:1a7::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_|SA1PR03MB6516:EE_ X-MS-Office365-Filtering-Correlation-Id: c8afc498-b61d-4d10-1afe-08db8d0ff6f7 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: paeRlOQLrWbUX1W/YAGz+3GS5bvWjnMCSX5SS6B6ZkJ84LKJWT1AQz+0N34yxenXKNMFgbrXOjY+2Z9dE/G3JYPxIqsvjbWTITClOui2Yw61hi6plnGSyK0o30Dr1oEAoSAoMZFOkmddteaAKB3OScUP5Dpr+RJRW4LACGCgDm515g3ZiyqxGOX3ZuJ0OSYJKmXVJoSXlxm6eUsonUdoCD7qbjeY5J1TnSuExCTYfzK+ZDn5KLNcECvo4Jm0C798l92tV2nO7UN241O8ZmomrEyDffbwO97pgjrMtf4MCcf74gDl/4m6heKlOoStWTQZ3id4ReUzlXOIEHIBfJwNoPuvtXn6dmMrIRSDEdDJrDO9Og1Dly0g4Gadp85wrMM5deGtt98sVKaS/H3rn6QdkJt4BrNvJGzaVKOzq24V5vwxBDfGIeGS1aXK2sJc7uA/Ba5ekP3Hsc9isdbgwUnC/v4zSfexdAzzYkXzvlVO2Ew4fDKug3FcbvBU7keQrracopGmSvLADzwkHUKlrEpYg+cxD29o+ik39bIsSiAAtSvnpuZReAxwzIWiBFnClIYW 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?aW4xMDg1ZHJvaFJZRWloKzBFU3E2d0lUa3BDQVRrdUJsSGw2bTMweUNUNGxN?= =?utf-8?B?V25UcWV4ZjMyTmk0Zzl6dHVxMk9adk9rTFN6ZmNIZEYvN003WjY1bXF3c3Yx?= =?utf-8?B?WkVSMWdLYis5QjRITlRDRHo1U3FVcjR1eHVzTVcrZmJBSVBzTGs0OXlGa3dT?= =?utf-8?B?WlhqQTFGUjVIcjRqYXp5TUgrc3BKY0Z0Tzl5R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a71JPNbS+6eJN9ASU0p4+UQK4L25kSps1PENlfLvJEZirI6sHqaGBkiF7Ai6e X-OriginatorOrg: citrix.com X-MS-Exchange-CrossTenant-Network-Message-Id: c8afc498-b61d-4d10-1afe-08db8d0ff6f7 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:31.3225 (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: Ko7ipICwXvrHNhoLkkoNeKrSzrW2j6juq9m5ztZcRUM8b/SK+rLpbFtXRd/3Sh992EX0GsKQqxIwWVjxSZ/PYg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR03MB6516 X-ZohoMail-DKIM: pass (identity @citrix.com) X-ZM-MESSAGEID: 1690290473195100001 Add a new array field to libxl_cpuid_policy in order to store the MSR policies. Adding the MSR data in the libxl_cpuid_policy_list type is done so that existing users can seamlessly pass MSR features as part of the CPUID data, without requiring the introduction of a separate domain_build_info field, and a new set of handlers functions. Note that support for parsing the old JSON format is kept, as that's required in order to restore domains or received migrations from previous tool versions. Differentiation between the old and the new formats is done based on whether the contents of the 'cpuid' field is an array or a map JSON object. Signed-off-by: Roger Pau Monn=C3=A9 Reviewed-by: Anthony PERARD --- Changes since v3: - Keep support for the old json format in the parse function. Changes since v2: - Unconditionally call free(). - Implement the JSON marshaling functions. --- tools/libs/light/libxl_cpuid.c | 152 ++++++++++++++++++++++++++---- tools/libs/light/libxl_internal.h | 1 + tools/libs/light/libxl_types.idl | 2 +- 3 files changed, 138 insertions(+), 17 deletions(-) diff --git a/tools/libs/light/libxl_cpuid.c b/tools/libs/light/libxl_cpuid.c index 3c8b2a72c0b8..dd97699bbde7 100644 --- a/tools/libs/light/libxl_cpuid.c +++ b/tools/libs/light/libxl_cpuid.c @@ -16,7 +16,7 @@ =20 int libxl__cpuid_policy_is_empty(libxl_cpuid_policy_list *pl) { - return !libxl_cpuid_policy_list_length(pl); + return !*pl || (!libxl_cpuid_policy_list_length(pl) && !(*pl)->msr); } =20 void libxl_cpuid_dispose(libxl_cpuid_policy_list *pl) @@ -40,6 +40,8 @@ void libxl_cpuid_dispose(libxl_cpuid_policy_list *pl) free(policy->cpuid); } =20 + free(policy->msr); + free(policy); *pl =3D NULL; return; @@ -516,7 +518,8 @@ int libxl__cpuid_legacy(libxl_ctx *ctx, uint32_t domid,= bool restore, =20 r =3D xc_cpuid_apply_policy(ctx->xch, domid, restore, NULL, 0, pae, itsc, nested_virt, - info->cpuid ? info->cpuid->cpuid : NULL, NUL= L); + info->cpuid ? info->cpuid->cpuid : NULL, + info->cpuid ? info->cpuid->msr : NULL); if (r) LOGEVD(ERROR, -r, domid, "Failed to apply CPUID policy"); =20 @@ -528,16 +531,22 @@ static const char *input_names[2] =3D { "leaf", "subl= eaf" }; static const char *policy_names[4] =3D { "eax", "ebx", "ecx", "edx" }; /* * Aiming for: - * [ - * { 'leaf': 'val-eax', - * 'subleaf': 'val-ecx', - * 'eax': 'filter', - * 'ebx': 'filter', - * 'ecx': 'filter', - * 'edx': 'filter' }, - * { 'leaf': 'val-eax', ..., 'eax': 'filter', ... }, - * ... etc ... - * ] + * { 'cpuid': [ + * { 'leaf': 'val-eax', + * 'subleaf': 'val-ecx', + * 'eax': 'filter', + * 'ebx': 'filter', + * 'ecx': 'filter', + * 'edx': 'filter' }, + * { 'leaf': 'val-eax', ..., 'eax': 'filter', ... }, + * ... etc ... + * ], + * 'msr': [ + * { 'index': 'val-index', + * 'policy': 'filter', }, + * ... etc ... + * ], + * } */ =20 yajl_gen_status libxl_cpuid_policy_list_gen_json(yajl_gen hand, @@ -545,9 +554,16 @@ yajl_gen_status libxl_cpuid_policy_list_gen_json(yajl_= gen hand, { libxl_cpuid_policy_list policy =3D *pl; struct xc_xend_cpuid *cpuid; + const struct xc_msr *msr; yajl_gen_status s; int i, j; =20 + s =3D yajl_gen_map_open(hand); + if (s !=3D yajl_gen_status_ok) goto out; + + s =3D libxl__yajl_gen_asciiz(hand, "cpuid"); + if (s !=3D yajl_gen_status_ok) goto out; + s =3D yajl_gen_array_open(hand); if (s !=3D yajl_gen_status_ok) goto out; =20 @@ -582,6 +598,39 @@ yajl_gen_status libxl_cpuid_policy_list_gen_json(yajl_= gen hand, =20 empty: s =3D yajl_gen_array_close(hand); + if (s !=3D yajl_gen_status_ok) goto out; + + s =3D libxl__yajl_gen_asciiz(hand, "msr"); + if (s !=3D yajl_gen_status_ok) goto out; + + s =3D yajl_gen_array_open(hand); + if (s !=3D yajl_gen_status_ok) goto out; + + if (!policy || !policy->msr) goto done; + msr =3D policy->msr; + + for (i =3D 0; msr[i].index !=3D XC_MSR_INPUT_UNUSED; i++) { + s =3D yajl_gen_map_open(hand); + if (s !=3D yajl_gen_status_ok) goto out; + + s =3D libxl__yajl_gen_asciiz(hand, "index"); + if (s !=3D yajl_gen_status_ok) goto out; + s =3D yajl_gen_integer(hand, msr[i].index); + if (s !=3D yajl_gen_status_ok) goto out; + s =3D libxl__yajl_gen_asciiz(hand, "policy"); + if (s !=3D yajl_gen_status_ok) goto out; + s =3D yajl_gen_string(hand, + (const unsigned char *)msr[i].policy, 64); + if (s !=3D yajl_gen_status_ok) goto out; + + s =3D yajl_gen_map_close(hand); + if (s !=3D yajl_gen_status_ok) goto out; + } + +done: + s =3D yajl_gen_array_close(hand); + if (s !=3D yajl_gen_status_ok) goto out; + s =3D yajl_gen_map_close(hand); out: return s; } @@ -592,17 +641,32 @@ int libxl__cpuid_policy_list_parse_json(libxl__gc *gc, { int i, size; struct xc_xend_cpuid *l; + struct xc_msr *msr; + const libxl__json_object *co; flexarray_t *array; + bool cpuid_only =3D false; + + if (libxl__json_object_is_array(o)) { + co =3D o; + cpuid_only =3D true; + goto parse_cpuid; + } + + if (!libxl__json_object_is_map(o)) + return ERROR_FAIL; =20 - if (!libxl__json_object_is_array(o)) + co =3D libxl__json_map_get("cpuid", o, JSON_ARRAY); + if (!libxl__json_object_is_array(co)) return ERROR_FAIL; =20 - array =3D libxl__json_object_get_array(o); +parse_cpuid: + *p =3D libxl__calloc(NOGC, 1, sizeof(**p)); + + array =3D libxl__json_object_get_array(co); if (!array->count) - return 0; + goto cpuid_empty; =20 size =3D array->count; - *p =3D libxl__calloc(NOGC, 1, sizeof(**p)); /* need one extra slot as sentinel */ l =3D (*p)->cpuid =3D libxl__calloc(NOGC, size + 1, sizeof(struct xc_xend_cpuid)); @@ -641,6 +705,42 @@ int libxl__cpuid_policy_list_parse_json(libxl__gc *gc, libxl__strdup(NOGC, libxl__json_object_get_string(r)); } } + if (cpuid_only) + return 0; + +cpuid_empty: + co =3D libxl__json_map_get("msr", o, JSON_ARRAY); + if (!libxl__json_object_is_array(co)) + return ERROR_FAIL; + + array =3D libxl__json_object_get_array(co); + if (!array->count) + return 0; + size =3D array->count; + /* need one extra slot as sentinel */ + msr =3D (*p)->msr =3D libxl__calloc(NOGC, size + 1, sizeof(struct xc_m= sr)); + + msr[size].index =3D XC_MSR_INPUT_UNUSED; + + for (i =3D 0; i < size; i++) { + const libxl__json_object *t, *r; + + if (flexarray_get(array, i, (void**)&t) !=3D 0) + return ERROR_FAIL; + + if (!libxl__json_object_is_map(t)) + return ERROR_FAIL; + + r =3D libxl__json_map_get("index", t, JSON_INTEGER); + if (!r) return ERROR_FAIL; + msr[i].index =3D libxl__json_object_get_integer(r); + r =3D libxl__json_map_get("policy", t, JSON_STRING); + if (!r) return ERROR_FAIL; + if (strlen(libxl__json_object_get_string(r)) !=3D + ARRAY_SIZE(msr[i].policy) - 1) + return ERROR_FAIL; + strcpy(msr[i].policy, libxl__json_object_get_string(r)); + } =20 return 0; } @@ -677,6 +777,10 @@ void libxl_cpuid_policy_list_copy(libxl_ctx *ctx, } =20 *pdst =3D libxl__calloc(NOGC, 1, sizeof(**pdst)); + + if (!(*psrc)->cpuid) + goto copy_msr; + dst =3D &(*pdst)->cpuid; src =3D &(*psrc)->cpuid; len =3D libxl_cpuid_policy_list_length(psrc); @@ -696,6 +800,22 @@ void libxl_cpuid_policy_list_copy(libxl_ctx *ctx, (*dst)[i].policy[j] =3D NULL; } =20 +copy_msr: + if ((*psrc)->msr) { + const struct xc_msr *msr =3D (*psrc)->msr; + + for (i =3D 0; msr[i].index !=3D XC_MSR_INPUT_UNUSED; i++) + ; + len =3D i; + (*pdst)->msr =3D libxl__calloc(NOGC, len + 1, sizeof(struct xc_msr= )); + (*pdst)->msr[len].index =3D XC_MSR_INPUT_UNUSED; + + for (i =3D 0; i < len; i++) { + (*pdst)->msr[i].index =3D msr[i].index; + strcpy((*pdst)->msr[i].policy, msr[i].policy); + } + } + out: GC_FREE; } diff --git a/tools/libs/light/libxl_internal.h b/tools/libs/light/libxl_int= ernal.h index ef882cff3912..b1a7cd9f615b 100644 --- a/tools/libs/light/libxl_internal.h +++ b/tools/libs/light/libxl_internal.h @@ -4871,6 +4871,7 @@ _hidden int libxl__domain_set_paging_mempool_size( =20 struct libxl__cpu_policy { struct xc_xend_cpuid *cpuid; + struct xc_msr *msr; }; =20 #endif diff --git a/tools/libs/light/libxl_types.idl b/tools/libs/light/libxl_type= s.idl index 9e48bb772646..fd2f3f6e485f 100644 --- a/tools/libs/light/libxl_types.idl +++ b/tools/libs/light/libxl_types.idl @@ -19,7 +19,7 @@ libxl_mac =3D Builtin("mac", json_parse_type=3D"JSON_STRI= NG", passby=3DPASS_BY_REFEREN libxl_bitmap =3D Builtin("bitmap", json_parse_type=3D"JSON_ARRAY", dispose= _fn=3D"libxl_bitmap_dispose", passby=3DPASS_BY_REFERENCE, check_default_fn=3D"libxl_bitmap_is_empty", copy_fn= =3D"libxl_bitmap_copy_alloc") libxl_cpuid_policy_list =3D Builtin("cpuid_policy_list", dispose_fn=3D"lib= xl_cpuid_dispose", passby=3DPASS_BY_REFERENCE, - json_parse_type=3D"JSON_ARRAY", check_de= fault_fn=3D"libxl__cpuid_policy_is_empty", + json_parse_type=3D"JSON_ANY", check_defa= ult_fn=3D"libxl__cpuid_policy_is_empty", copy_fn=3D"libxl_cpuid_policy_list_copy") =20 libxl_string_list =3D Builtin("string_list", dispose_fn=3D"libxl_string_li= st_dispose", passby=3DPASS_BY_REFERENCE, --=20 2.41.0