[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 00/13] lib{xc,xl}: support for guest MSR features


  • To: xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Roger Pau Monne <roger.pau@xxxxxxxxxx>
  • Date: Fri, 16 Jun 2023 15:10:06 +0200
  • 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
  • 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=JNqSx622qdR/rT04RVhtSMuEjyQxLCiBxalL8rrQoxE=; b=IHKP7YLKCUhgQ8WTmt6NOL/NUpA+RpT9jBFMXUUoCW8WGMaYlF/bpH7QSM2LVJVaqgKNCMX3AY9h0BOhe483x+7cSHrgteWC3TAyu+XOLwhNjrrOHCZqTqFRa/ZymJ9kC1qU3VjCko12pEwBYhoL1kc8sSCPwRQAqctHjx1jX6jGSiIRO/VxUEmoDOtFOTT6SlNvdskPYvTzmqYCqZm6mpxIJrJaW5CQ2nzzwc3+Pl+iLB4HNsG/2PWMJc+op/c2zegl3TNMzZVqnubXRLC9X52ESppOL8u2PyRk5Z0BgD+tLkMkgYuhRzVzEmtaX7i7zuLm8NQqeZGTWbJlZTS/4Q==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=n6cZnlhA7TmtBDSwuzPqgjNylFz0An3j543m2ynIMvtsVvvQzzXBl1mrXrdK36Vo6eG6vIR6lYf4oWIwiZdRh62jtdyWYqoPSTehg8RLxF1idW6ezjMZrQpqxdsePwW7Lv0IJBLR+SDzJYJasEu8BbG4ECqrwDYF829QOTu7ucAVPDhiJpEyeFbD5rGtRFbX80MK4vINfZxaomCN+WWRbCGj7qfx5lfCSjAMIP9DxgI+q5dVohvX8vXuUu75FoZeYAz3W2Yx26H8Ult5sVNvacqjPsZkIq95+6iKKtnDapqdslwoX4kzLpCGrlHLgyPDjyhqNouttwIrDph+1CPrBA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: Roger Pau Monne <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Delivery-date: Fri, 16 Jun 2023 13:11:15 +0000
  • Ironport-data: A9a23:brers6wI3+KGv1AB1O56t+cBxyrEfRIJ4+MujC+fZmUNrF6WrkUEm mRJUWuDbPeOMDHwKdpyaI+09kkPucPTyNBiQQdr+yAxQypGp/SeCIXCJC8cHc8wwu7rFxs7s ppEOrEsCOhuExcwcz/0auCJQUFUjP3OHfykTrafYEidfCc8IA85kxVvhuUltYBhhNm9Emult Mj75sbSIzdJ4RYtWo4vw/zF8EsHUMja4mtC5QRgPK4T5jcyqlFOZH4hDfDpR5fHatE88t6SH 47r0Ly/92XFyBYhYvvNfmHTKxBirhb6ZGBiu1IOM0SQqkEqSh8ai87XAME0e0ZP4whlqvgqo Dl7WT5cfi9yVkHEsLx1vxC1iEiSN4UekFPMCSDXXcB+UyQq2pYjqhljJBheAGEWxgp4KWNg+ eYyNjJUVU2siu6UzoucTcQ2p9t2eaEHPKtH0p1h5RfwKK98BLX8GeDN79Ie2yosjMdTG/qYf 9AedTdkcBXHZVtIJ0sTD5U92uyvgxETcRUB8A7T+fVxvTaVkFYZPLvFabI5fvSQQspYhACAr 3/u9GXlGBAKcteYzFJp91r137SXzX6rBdh6+LuQ2eN4umLJ3FYqCww5UXGqrNib03+OVIcKQ 6AT0m90xUQoz2S7Q9+4UxCmrXqsuh8HR8EWA+A88BuKyKff/0CeHGdsZiFFQMwrsokxXzNC/ l2GhdTyHhR0raaYD3ma89+8rzm/JCwUJm8qfjIfQE0O5NyLnW0ophfGT9ImFbHviNTwQGv02 2rS8HJ4gKgPh8kW0an95UrAnz+nupnOSEgy+xnTWWWmqAh+YeZJerCV1LQS1t4YRK7xc7VLl CFsdxS2hAzWMaywqQ==
  • Ironport-hdrordr: A9a23:Nhxm/anP4wJJl3+oViMwOzwOb/bpDfLh3DAbv31ZSRFFG/Fw9/ rFoB19726QtN9xYgBDpTnuAsW9qB/nmqKdgrNhXotKPjOGhILAFugLgLcKqweKJ8SUzI5gPM lbHZSXCLfLfCJHZcSR2njELz4iquP3jJxBnY3lvhNQpZkBUdAZ0+9+YDzrdXFedU19KrcSMo GT3cZDryrIQwVtUizqbkN1OdQqvrfw5evbXSI=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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.

In order for such support to be as transparent as possible for existing
users of libxl, both libxl_cpuid_policy_list and libxl_cpuid_policy are
modified, so that the libxl_cpuid_policy_list type is no longer an array
anymore, and libxl_cpuid_policy is converted into a structure with
two fields to hold both a CPUID and MSR arrays.  It's my thinking that
current users of libxl had no business in poking at
libxl_cpuid_policy_list, since the underlying type (struct
xc_xend_cpuid) is opaque in that context.  Also the format of the array
(with a terminating empty element) is not documented in the public
headers.

Some of the patches had been salvaged from a previous series of mine to
introduce better cpu_policy management support in libxc and libxl, and
hence contain some version notes about changes, or are already reviewed.

Thanks, Roger.

Roger Pau Monne (13):
  libs/guest: simplify xc_cpuid_apply_policy()
  libx86: introduce helper to fetch cpuid leaf
  libs/guest: allow fetching a specific CPUID leaf from a cpu policy
  libx86: introduce helper to fetch msr entry
  libs/guest: allow fetching a specific MSR entry from a cpu policy
  libs/guest: replace usage of host featureset in
    xc_cpuid_apply_policy()
  libs/guest: rework xc_cpuid_xend_policy
  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                    |   7 +-
 tools/include/xenctrl.h                  |  21 +-
 tools/include/xenguest.h                 |  13 +
 tools/libs/guest/xg_cpuid_x86.c          | 383 +++++++++--------
 tools/libs/light/gentest.py              |   2 +-
 tools/libs/light/libxl_cpuid.c           | 504 +++++++++++------------
 tools/tests/cpu-policy/test-cpu-policy.c | 220 +++++++++-
 tools/xl/xl_parse.c                      |   3 +
 xen/arch/x86/cpuid.c                     |  55 +--
 xen/include/xen/lib/x86/cpu-policy.h     |  37 +-
 xen/lib/x86/cpuid.c                      |  52 +++
 xen/lib/x86/msr.c                        |  41 +-
 13 files changed, 821 insertions(+), 541 deletions(-)

-- 
2.40.0




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.