From patchwork Tue Jul 25 13:05:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Roger_Pau_Monn=C3=A9?= X-Patchwork-Id: 13326425 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2F624C001DF for ; Tue, 25 Jul 2023 13:06:48 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.569669.890571 (Exim 4.92) (envelope-from ) id 1qOHkL-0004CB-8l; Tue, 25 Jul 2023 13:06:37 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 569669.890571; Tue, 25 Jul 2023 13:06:37 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qOHkL-0004C1-65; Tue, 25 Jul 2023 13:06:37 +0000 Received: by outflank-mailman (input) for mailman id 569669; Tue, 25 Jul 2023 13:06:36 +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 1qOHkK-0004BN-5j for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 13:06:36 +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 f6341ec4-2aeb-11ee-8613-37d641c3527e; Tue, 25 Jul 2023 15:05:44 +0200 (CEST) Received: from mail-co1nam11lp2171.outbound.protection.outlook.com (HELO NAM11-CO1-obe.outbound.protection.outlook.com) ([104.47.56.171]) by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 25 Jul 2023 09:06:17 -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:13 +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:13 +0000 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: f6341ec4-2aeb-11ee-8613-37d641c3527e DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1690290393; h=from:to:cc:subject:date:message-id: content-transfer-encoding:mime-version; bh=rfePr69IWK0mWEXIQo+D3kzuJGWGZb68XMqpUFQEXd8=; b=bCY0oXftMsuNmhXoWyIL5kulJcEQomBlq881dmHei6ie2E/SaCVJZHEl sLEB14NndzYqAGswRkWHiwb3aM3H1hhEmPUOErndzzzXp2k/UfnqBGxAr 1BE1JF7QMzgYnNh87vhdEGb4v3uCGm2zgAR16Xt2zHGuLYtzghFr7f1Tp k=; X-IronPort-RemoteIP: 104.47.56.171 X-IronPort-MID: 119981262 X-IronPort-Reputation: None X-IronPort-Listener: OutboundMail X-IronPort-SenderGroup: RELAY_O365 X-IronPort-MailFlowPolicy: $RELAYED IronPort-Data: A9a23:MTlLTazq1CXm3jXC2m56t+cQxyrEfRIJ4+MujC+fZmUNrF6WrkVWy WsbDW6PbveCYmH0Koh0PY/no0pV7JPWzt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ftXp1lR7qB+AoUjYiUmS4Xue iJmQ4kI8Nwr0ncZX64ujzk3wWI6kdU11bSjWWAhGflo4jHSCkhC8xH7LgpCCfk1w== X-Talos-CUID: 9a23:ZsTcjm9S/GSACTTnZXWVv2Q6N+YEWH/b9njRPGmRCExUC/qWSXbFrQ== X-Talos-MUID: 9a23:aSYqCAsyW7EcHtLaZs2n3gAhPuRV8+eUKEVRz5E8ve+WLiohEmLI X-IronPort-AV: E=Sophos;i="6.01,230,1684814400"; d="scan'208";a="119981262" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=e0deDAX7/86042r7eURrgTu9cN3kwmGMaSNe1pi0YDhQSE2Os1VvuHpiHD/++7dQ2jklmNst0Fi3nRFo4le+VTaHkYs+fy64VIY9ah5uGISwHOJyCVqBx5hgpjLYBYjRBQF53obM/zV+6fW4CAgAYzudTVgtDPHpvoZWoV7KmYZ3fGra4Gy/LUNjBniJBH3rZ9mahEr89lAMiNp72GsEeNZN1n6uxabGQvJ78oq3sAYrYD8lAp6q7mwMQ9w3Q2ip88mk0tpD3XApDPMbb9BsVVKNTCR99COBgdh4N4C70UaYjCwbxORv09N/siOL/tQ7Am+HTtJdVsiKXjRiR6I8Xg== 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=e3D+sCBu93lJN8h/uBwTlirz+UK81IB9FCSryAPCYQ8=; b=EAqbgicPNbA03HPFPskRIKf8T/8csDo1dwyx8SjzAVP5zPxevF/sbJvHdNk+QqIIOIvYFnuKwypsX6ZhpIyZ4KFewfZ/ypjR1/t2QgaE8PKldv9UBw2KHFJY8WVyYA6bnKui8QBIoB2OwfK1oo2kUO1dbFb280FsH+FM1EzdZzuTa7+vckPFgwt4pW+XJvuneiF6PcnK5s+QqFdFA/R5KMKkbvXzhlGxtI5GEwSzqDsJIjIeUrABR62orHdUAc0Hv1r+3Pnm73gdNbHSQ2PdVteCpJENNrUkWIXPYM09rNqV9Zu6dm/RI8l8nxk7odFVF59yGFq6eqptUX4YDqVA7g== 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=e3D+sCBu93lJN8h/uBwTlirz+UK81IB9FCSryAPCYQ8=; b=WGGFj4mt6PuSahHWZEr8dluYx/0luO2L0OBnkxEBYqmjfcbG7/z0d0MemcS5E8kfH5oeQ4EfgHdN6pjSYYuH6WXwZ7Z8/adRJnPI92J56xNR6Rz9UQ3Ejb3uyjZKUYvaVbA1kwQbAJX0DSCd7m29vn0LjwbRsB3aFqW/i2xFceM= 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 0/6] lib{xc,xl}: support for guest MSR features Date: Tue, 25 Jul 2023 15:05:52 +0200 Message-ID: <20230725130558.58094-1-roger.pau@citrix.com> X-Mailer: git-send-email 2.41.0 X-ClientProxiedBy: LNXP265CA0038.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:5c::26) 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: 159917cb-0db4-42a2-41ae-08db8d0fec38 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: dS0uPNeTcqWTODkM9tq8AytH1SLWqqsmKThGGnvhqLp6cHfnfpsGcbVfTLaelcVDzq0s2On43WkkXppZ8KX7oqzIm4OSvDdcvq8c4rZGkPKEZmeb7wmSVDVEH3DphJooKaagSmo0zTbN0ViaeefTpb82fGoqGeg1vSbPLECR9KPWQ73d0zQTSAoXXLnmqw2wdigEKhS/Xkt2WTcIb7SVMd/7TGOEYhi1d52skmuh9KHVxblkOpTAVAQbZpCTd0PyOR61yvuzB2qd65EWcJNc73N+i/yvY6RErGjA1Dj4DoPWRWVj7Zi/uJoGKywCYeaHptBlBv42I8BUjAx/+EeMeuSQp8oGIqqBcXPdk6u8FywzQYXjgIOv2baow01jRw0CoAPEbo9OBI3oDo3kVB+sjRIyoUod6odgm/htkBBu2k9ExjGfQclUYPrwimLjHoGeGZKyZqO0/eCkvnVnSmYPUw2WEeAZb9J/rq+JqSX2EvB/CFD6qv5y1yYBHhFMGFJ4nQDHlM0kZWofXTLSiYlDQJwEuh7nrdsZOKW1vJz9l6gMN9gdCOVL6J2cIjz0acLO 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-Mess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HmgvVW+ev7jXyhBar4mNWDA8yfYsvuF?= =?utf-8?q?EClL48ulRtE00qzb6QeYnSUTvDqHSUwq5H3SEYPMxzpM+fCZQudAYMIbvGg5hZSP3?= =?utf-8?q?M71nYZYeAHbiW74E0INzgPxQN1Ea28pr7f7OuQ5g7XGx0eugDuX+3LtZZyAvWgzbM?= =?utf-8?q?GauemUyBfdvOZq3xNGkezAOwS0b0E08SsSIhEweKFixfLx4DVsFqDgs0q53Ahxwm+?= =?utf-8?q?EMT6DvtgkXO19wIQmRQuS0n7r5S+oWP21GcbapR749kBVCy6jphV9j9ifm/l9T5Ty?= =?utf-8?q?G4up/vz1F+uR71AqcotlhC492icL+TWlYKVXkeDRB5P0faLFHPZEyfh63SCg5njNI?= =?utf-8?q?1bQDl3NF6Lwb8gdwpfjFDxmjRu76afBRXoCxJ2PPABdCyQcUL5cnQ6scO/SGPSZLz?= =?utf-8?q?SOTgJ1EgiBjFmJfcgZDoe6nCiiZofUHOd5tDjT+WOZ2VP7QbHWjsr8pwUI49vZnbI?= =?utf-8?q?dintnEPV/XoEYhorH+OW4s2DBDB19wTw9Lna4SqFQziNgGhgDP3kHX8VPnrxNNbfG?= =?utf-8?q?gUZgNmegKGtopWNehTHlMhjRdXj/WJQSazHGEs32CAYWd/zs7E+XqEPSHfWgPChxX?= =?utf-8?q?vsyGnJQ9zZNnz/mUDlmx2CFiOljXiH5bL3AB4PRO+qHSwsK/r1X6VjJEW+vSeshFT?= =?utf-8?q?zY+LMqxQeDVwcqj0BeGk/EcPTAH522faig=3D=3D?= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: iORoeMOCo6kf+aIlRX1LgyaaKyK6NyFM6gSHhDST5v6q2h2102ZS3v6qv89uYUH0exzxbmJKnxJF2y/IHB14HmtlmIP7xWv41ZlNnh0/Mm6BHzIQtD174TXZjF6kFeLQU/DgUEeJcLkYi8gJYhL75Ym3jW7fk6Sp7QsJ7bvF0Sz795gsZvdovkwKrfhD7HBELQdJ9qmSAFsxdvHXQIVJUx1pnVT+dsONuzd1Hsmv7QSkArIBnOwZz4SBdgvAVdd6AGh67LJY95bbtiPdG9Gb3agTuwkM+vykdCHE0qhhQJTUglJU87V1lZrNSpgkRjMwqRqeUkP3XQMccbOvOG1sNk7vdhD0+BvJILZJCwcz2bEpN8rx5GLw2ishcPq0F+Yzh0+0j47PNH0GUYwZdeGpRtN4ldQD5FC/hkaWO4/TAAVc9RPJU4XWOlzIWFbQ/Ht97NRuIZFmRdT2GOP3yajKnIFtwzvx64hKfIIajqwxhy4nQ4/GbbrXXZJHWleUDFmf61Wo8e+nxNqjTbucetvlL6WLpKzWqgWVTHD9mZ08+uOn+JUgfC0avZhA/Iqqesfq0dXpptmZ/5UD5mAVm8cwfaNnsm19Q9YZKAsQUcVkbhqgpP9i+cs0fYy1OmbFTm1I4dYHyLe7436FWPzN90rSHK5R/RUIBGSIdm5OSyBtGxQ4ZcSn+hb/fhfavwsrylG8Ey3n3OxIRh504YJwWJnRZzxZREa0VwwZ1FZ6E0t8bqX1zstSZUCgJmWGVNfJsOTWvjgTvkewt6k4GdLjD7mn1WakxUTei4qrJeQOTvwYGw+A4NMh9DrYvHm/KKjEibXN X-OriginatorOrg: citrix.com X-MS-Exchange-CrossTenant-Network-Message-Id: 159917cb-0db4-42a2-41ae-08db8d0fec38 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:13.1809 (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: Q+HehgDM9az9wyqiwWlr50e/ViaujC2MtwwXgdUx06WB6YwQCtlWevxasGXOCZVfFn6pHtjOdbxm9SL68FPNTQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR03MB6516 Hello, The following series adds support for handling guest MSR features as defined in arch-x86/cpufeatureset.h. The end result is the user being able to use such features with the xl.cfg(5) cpuid option. This also involves adding support to all the underlying layers, so both libxl and libxc also get new functionality in order to properly parse those. Thanks, Roger. Roger Pau Monne (6): libs/guest: introduce support for setting guest MSRs libxl: change the type of libxl_cpuid_policy_list libxl: introduce MSR data in libxl_cpuid_policy libxl: split logic to parse user provided CPUID features libxl: use the cpuid feature names from cpufeatureset.h libxl: add support for parsing MSR features docs/man/xl.cfg.5.pod.in | 24 +- tools/include/libxl.h | 8 +- tools/include/xenctrl.h | 21 +- tools/libs/guest/xg_cpuid_x86.c | 169 +++++++- tools/libs/light/libxl_cpuid.c | 672 ++++++++++++++++++------------ tools/libs/light/libxl_internal.h | 5 + tools/libs/light/libxl_types.idl | 2 +- tools/xl/xl_parse.c | 3 + 8 files changed, 612 insertions(+), 292 deletions(-)