[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v5 00/12] libs/guest: new CPUID/MSR interface
- To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Roger Pau Monne <roger.pau@xxxxxxxxxx>
- Date: Mon, 29 Nov 2021 16:33:43 +0100
- 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=lMwa/hlzZAME7SQ0GcDB5HStU4UmiwLvkHIs62+a9zo=; b=GXsZtmowNOcrl0sBaFEGJcVfUFBRDaZJqdhS6z28Oh922/mh+ug9x80wvBEJDEUZObG0d4cOXQSUsSLCQaf30ROO936y76Yx9odjKguZ8zuN5pf+ALO76QNrVhunWKrl3CdmdlosG7oKGzE0/oNtfw5vTglNOL0KE8H3lFzJUiemeqhnKtApRxXL0BzSZLuUE3KuhsXXR0SIG7yPTng8t46dlzQVylKKKgL6VniELgZ3cm1ivh/+8B5e3sXfMw8vIaj4XYlr3w2w9p6T5Xh7cobjxNMeHDYZ0ucrNyPbnmzbHmGFm0Gg6efCsw1pJuarW9zkVCG8Zk7Ox1V24Z1YPw==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=STCVnaxOqb8vQHREv14jZn6KxLFRjqQNEhCa3/S4zBbLULucoXh9eedpUVtjDp38yGnPNkcc924q512xXfR3q6OfLsVhgKv1+mfrwF0HIqcuGpT+g8+MXs5IkITCDas6xaZ1kQFiCPAZCRy4oCvRFjxdotf9dAQNh0bF2lgVm9F/QxtDJ3e3wH485i9iNZdd8iHlaZUp9C8REoEeE8nTzJRRVHQZxVoB7EQArscXAE/uYqVq7bIMW4bG8COa0NNHoaekSaZzHIMBHCbGAswfa0eJgJeJYpuaQ57HOT9t85hG181n6vXE6H9KpcDGUtxdBkY1Lu28PFJOiUhgEAa4Xg==
- Authentication-results: esa3.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
- Cc: Roger Pau Monne <roger.pau@xxxxxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, "Anthony PERARD" <anthony.perard@xxxxxxxxxx>
- Delivery-date: Mon, 29 Nov 2021 15:35:32 +0000
- Ironport-data: A9a23:uRo+vatkESM3VTXjFq0QxIxATOfnVKpZMUV32f8akzHdYApBsoF/q tZmKTyFMq3eZWP0eotxPY6w9EoAvMCDyYJiSVRv+C08RiIQ+JbJXdiXEBz9bniYRiHhoOOLz Cm8hv3odp1coqr0/0/1WlTZQP0VOZigHtIQMsadUsxKbVIiGHhJZS5LwbZj29cx24nhWmthh PupyyHhEA79s9JLGjp8B5Kr8HuDa9yr5Vv0FnRnDRx6lAe2e0s9VfrzFonoR5fMeaFGH/bSe gr25OrRElU1XfsaIojNfr7TKiXmS1NJVOSEoiI+t6OK2nCuqsGuu0qS2TV1hUp/0l20c95NJ Npli4SsdQopBu7wyccnYiNVSy5VLZ1r5+qSSZS/mZT7I0zudnLtx7NlDV0sPJ1e8eFyaY1M3 aVGcnZXNEnF3r/ohuLgIgVvrp1LwM3DJoQQt2sm1TjEJf0nXYrCU+PB4towMDIY25AeRquCP JRxhTxHNh7iREdiKA4rEYsdneb4r16kK35+kQfAzUYwyzeKl1EguFT3C/LXdcaNXt59hVuDq yTN+GGRKhMQOcGbyDGF2mmxneKJliT+MKoNEJWo+/gsh0ecrkQDBRtTWValrP2Rjk+lR8kZO 0ES4jApr6U56A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qNE3I+erhBEGBKUmskqKdhrNhQItKPTOWwldASbsC0WKM+UyYJ8STzJ856U 4CSdkBNDSTNykDsS+S2mDReLxMsbr3ktHYuQ639QYTcegAUdAH0+4WMHf+LqUgLzM2eabRWa DsrfZvln6FQzA6f867Dn4KU6zqoMDKrovvZVojCwQ84AeDoDu04PqieiLokys2Yndq+/MP4G LFmwv26uGKtOy68AbV0yv2445NkNXs59NfDIini9QTKB/rlgG0Db4REYGqjXQQmqWC+VwqmN 7Dr1MJONly0WrYeiWPrR7ky2DboUATwk6n7WXdrWrooMT/Sj5/IdFGn5hlfhzQ7FdllM1g0Y pQtljp+aZ/PFflpmDQ9tLIXxZlmg6funw5i9MeiHRZTM83dKJRl4oC50lYea1wUx4S0LpXUN WGMfusp8q/KTihHjLkVyhUsZCRt00Ib1a7qhNogL3R79BU9EoJuHfwivZv2kvoz6hNOKWs0d 60RpiApIs+PvP+UpgNdtvpOfHHcVAlYSi8eV56cm6XXJ3uBRr22uvKCfMOlaaXRKA=
- Ironport-sdr: qHF0YV8jF/lJWbO1W9ewwl3cBp78TyFoI3s6AOyGCbruYhKkqR9oy6zvsWl3glEJRipqZunJsS r4jJZsiC2pizdm6ydvadIafzBijpFNvbBJhpYhxd1luF+7T8Wtmx2a/KQjP00JwnP5M+UbrT1w WAibnsm5RTVXmbHbOfqL8XK3vaOGqHubETQqLowZMUdd8xm0+SsjEb1UDCqo6w6rSoFHwGsxZb gzjgEnnQvygOqAJ4ESQ4/E7ejIt0huXLKQxPMPTowRP/SOGtKEgto7l7x/PyakAQlKBtaBFuIr KrF8cCF3rXH8JLUZAB7wvmvz
- 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.
The addition of a helper to generate compatible policies given two
inputs has been removed from this iteration, sine Andrew Cooper has
posted a patch to set the foundation for that, and further work should
be done against that baseline.
Thanks, Roger.
Jan Beulich (1):
x86/CPUID: shrink max_{,sub}leaf fields according to actual leaf
contents
Roger Pau Monne (11):
libs/guest: move cpu policy related prototypes to xenguest.h
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: 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/xenctrl.h | 99 ----
tools/include/xenguest.h | 77 +++
tools/libs/ctrl/xc_bitops.h | 6 +-
tools/libs/guest/xg_cpuid_x86.c | 647 ++++++++---------------
tools/libs/guest/xg_private.h | 1 +
tools/libs/light/libxl_cpuid.c | 233 +++++++-
tools/libs/light/libxl_internal.h | 26 +
tools/misc/xen-cpuid.c | 1 +
tools/tests/cpu-policy/test-cpu-policy.c | 224 +++++++-
xen/arch/x86/cpuid.c | 55 +-
xen/include/xen/lib/x86/cpuid.h | 26 +
xen/include/xen/lib/x86/msr.h | 20 +-
xen/lib/x86/cpuid.c | 91 ++++
xen/lib/x86/msr.c | 41 +-
15 files changed, 948 insertions(+), 605 deletions(-)
--
2.33.0
|