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

[PATCH v3 00/13] libs/guest: new CPUID/MSR interface


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Roger Pau Monne <roger.pau@xxxxxxxxxx>
  • Date: Fri, 30 Apr 2021 17:51:58 +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-SenderADCheck; bh=EY6MmV3Lly/+H2Zssd+ZQFW2+lQksSIYRPGLPmNTCOw=; b=NB5cZBCdeTR4wIjPtbHvycjugIYyMDGRhwENXeCADQpWe5UzSXkAGQkGH0Q7S5LUwJfWVHP+f+zKBEDvjkNYCSlJLJYoJOtUU3BSl0SVI3pbtyek+7KNZ+HJejY8H5X2j/XgftaPP724tCVBqun5xAN3OI3A7N4Lgm0k7VU6u4gtCTCXcGUVRkeBtA1GofLxGsYIlrVknWLSIjntCr5clPWthMCzWgXtAdw+RbiJeLLd1yXww6746rzTvN1t+rk+Xgiw8wzrCgjJQT5G6DUTFENr/gL6UToig7hZWYu2KC2XxjV5hdJqF55l8i/QB7BAY7vtKVhucEVGw+gQILiCvA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KE/O9yJgxjPbnTGY+viRy7X+iFw1HLrjUHLuevCOZMvOtycfVwWZxCMPPqJH/qjquIzTvDkWP75i6sKm08dyU1lo0VMtnHd0omRAxfyvWQW2z+ZZYHJmTEs22gBrkqUZY9WgBjyprsuFEHNz4wBWO3cgjAPNGPUx39NrT0smamt2Yv+0ECv5bG085TDgTkhEPGwkhERrCqedAR24I9tr5T9C0qJOnHfq6lDFiIe52ZlpN4EDcAApTqSfyfY2oc1Lt2xiMjEqEdkHI6SqMpFLV8UXVWzMC1weU0wz4pakppwXoNi+9R047NftOLY5ineBfte8H/GrgwFRz8ZhqbDn6Q==
  • Authentication-results: esa3.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monne <roger.pau@xxxxxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • Delivery-date: Fri, 30 Apr 2021 15:53:54 +0000
  • Ironport-hdrordr: A9a23:8P77LahSVFrcUOYBrPgZDcSER3BQXk8ji2hD6mlwRA09T+Wzkc eykPMHkSLugDEKV3063fyGMq+MQXTTnKQFhLU5F7GkQQXgpS+UPJhvhLGSoQHINg/f0qpz1a J8f7MWMrfNJHVZreK/2gm3FN483MKKmZrEuc7yx2pgJDsaD51IwBx+Dm+gfnFeYCljKd4HGI GH5sxBzgDQGkg/SsigHHEKU6ziirTw9a7OWhINCx455ATmt1rB1JfAHwGczlMiVVp0rosKy3 TPkADy+8yY082T9xm07QHuxqUTvOHBo+EpOPCx
  • Ironport-sdr: VpQ7Su9F3sZBWN8ydXp0kJutSVCOs5pFf7hWUSsSHULjWRqS1yzWqNuf04QYb/id9uqoNXOtBU ty+2iuJ7f0+68I4v1Vfi24oSJxpjU4tZEjZZVNvZNvoTlCGu1BTeLdrsSNnJ8MKWn8JqQW0gjO p8Uq5LXQGPQn0WrPmIlI9Wwy/SOa32eIZhBRZ5X6WjA3A1wpnfjaS6rRs8wtwFZ072EucOq80P yg/6rhgRwv5PTwedHbHheHebU0Vp28OqGhWxBCk7rKaEwWTuSw6c91sthZ0cVEXJFx+XR0CQc6 xVQ=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Hello,

The following series introduces a new CPUID/MSR interface for the
xenguest library. Such interface handles both CPUID and MSRs using the
same opaque object, and provides some helpers for the user to peek or
modify such data without exposing the backing type. This is useful for
future development as CPUID and MSRs are closely related, so it makes
handling those much easier if they are inside the same object (ie: a
change to a CPUID bit might expose or hide an MSR).

In this patch series libxl and other in tree users have been switched to
use the new interface, so it shouldn't result in any functional change
from a user point of view.

Note there are still some missing pieces likely. The way to modify CPUID
data is not ideal, as it requires fetching a leaf and modifying it
directly. We might want some kind of interface in order to set specific
CPUID features more easily, but that's to be discussed, and would be
done as a follow up series.

Thanks, Roger.

Roger Pau Monne (13):
  libxl: don't ignore the return value from xc_cpuid_apply_policy
  libs/guest: allow fetching a specific CPUID leaf from a cpu policy
  libs/guest: allow fetching a specific MSR entry from a cpu policy
  libs/guest: allow updating a cpu policy CPUID data
  libs/guest: allow updating a cpu policy MSR data
  libs/guest: introduce helper to check cpu policy compatibility
  libs/guest: obtain a compatible cpu policy from two input ones
  libs/guest: make a cpu policy compatible with older Xen versions
  libs/guest: introduce helper set cpu topology in cpu policy
  libs/guest: rework xc_cpuid_xend_policy
  libs/guest: apply a featureset into a cpu policy
  libs/{light,guest}: implement xc_cpuid_apply_policy in libxl
  libs/guest: (re)move xc_cpu_policy_apply_cpuid

 tools/include/libxl.h             |   6 +-
 tools/include/xen-tools/libs.h    |   5 +
 tools/include/xenctrl.h           |  75 ++-
 tools/libs/guest/Makefile         |   2 +-
 tools/libs/guest/xg_cpuid_x86.c   | 832 ++++++++++++++++--------------
 tools/libs/light/libxl_cpuid.c    | 231 ++++++++-
 tools/libs/light/libxl_create.c   |   5 +-
 tools/libs/light/libxl_dom.c      |   2 +-
 tools/libs/light/libxl_internal.h |  32 +-
 tools/libs/light/libxl_nocpuid.c  |   5 +-
 10 files changed, 744 insertions(+), 451 deletions(-)

-- 
2.31.1




 


Rackspace

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