[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v6 00/12] libs/guest: new CPUID/MSR interface
- To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Roger Pau Monne <roger.pau@xxxxxxxxxx>
- Date: Mon, 17 Jan 2022 10:48:15 +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=9jPFzw4t+/chj9LsEJJtqma0zil4BQfocNH78tOpUow=; b=Z+WKQts4cAT8qI9qDK8b8SOqPVHCP4k9P/kea1MdShHiDlyugsZN2bxpt+UXzmH7iKwcDuOWrlpPNEwQpIknKA0EfFpxMyppRYDRtKxCtQCCxRux3PlNQzqFo8cK1WvaEYf4mnn0E0BWhRXBSms2Nad1mr9vb2rUK8C+oNAhdkCugExPaqT3CsZsjqFqCByXISkxApGYC8/kxhNN6EjIR3ldaNc3Po4rQchgdvpUXDuqrflHY/OxopDhQj3gkykTcycKAly7I7ke2FV8EvdBvxDbPvaanoXCKNMjmv+PGR6kOT2f6OXkIRBJX78hbv1UdqY0v9VPF1lskICBNuH2Cg==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cIvv/bwwvTP9kCe+5dKlLHmeRDPvIGPd2acuWjZxKsPPXVMVzwzPk/iM5Kd/FiPxulQKKXMrZXZcTY8BGitdDyby6qGrgwAr47ciTRgU/bSoNs1lpbGY7CLo/Z5MqXIn0/NI2RGAQD5p7mluDN097hEjGi8pDQ39hWmrz7pfLwVootnHZ0Xms+zWccPHc22LtaWensuvHVoptdONROy2ay4THlUcAmWc0qKf1qAcElqM1yxhbZocE4phJdBvQkBYcjRJ+bQYBslqbPUPlDwy7Cs377DCgv8UYS86qTlAXUY3IvBrsRfDxoBvxhaZXZ9fTNXr8HLShqUi1Na5bktRWg==
- Authentication-results: esa5.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.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: Mon, 17 Jan 2022 09:49:36 +0000
- Ironport-data: A9a23:P2f5Uaw4OJzmPhmW5Ht6t+fHwSrEfRIJ4+MujC+fZmUNrF6WrkUPy msaWjjQP/eIMzfzctB1YNy+8E8O7ZPdn9ZqTQE4+CAxQypGp/SeCIXCJC8cHc8zwu4v7q5Dx 59DAjUVBJlsFhcwnvopW1TYhSEUOZugH9IQM8aZfHAhLeNYYH1500g7wrdm2tcAbeWRWGthh /uj+6UzB3f9s9JEGjp8B3Wr8U4HUFza4Vv0j3RmDRx5lAa2e0o9VfrzEZqZPXrgKrS4K8bhL wr1IBNVyUuCl/slIovNfr8W6STmSJaKVeSFoiI+t6RPHnGuD8H9u0o2HKN0VKtZt9mGt9NLz dFhm76pchUkb/PTwbQeQyZWCD4raMWq+JefSZS+mcmazkmAeHrw2fR+SkoxOOX0+M4uXzsIr 6ZBbmlQMFbT3Ipaw5riIgVort4kI8TxepsWp1lrzC3DDOZgSpfGK0nPzYEBgm5u1pAUdRrYT 5o1YDhLPCTJWR5eYFIeM7lnlua2r3aqJlW0r3rK/PFqsgA/1jdZ0rf3N8HOUseXXsgTlUGdz krE9WnkBhARNPSE1CGItHmrg4fnjS79HY4fCrC83vprm0GIgHweDgUMUlm2quX/jVSxM/pAL 2QE9yxoqrI9nHFHVfGkAUf++iTd+EdBBZwAS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B/9SCIVyAygc+79 YYT0EWMrSZZjIb/KXHCWGDYqodKbK8gceVbInlvhJQpVYAUdAc0+41MHfTLmRGAC19QbYpHp uV4cRK4xKmZHQsd8y+Ql0IRfLKqdHnnI/vJUduPW9t1CC+yReTrJLqGRmR2RkTFxtJ3LcZ6G DA1yj0/L+qvf2XwgLVk0XT85NVst38zcYrPr3FtuElbhHXziq4boVoXLOP+BgzveGU8V4v1O LBph8xVv4Dn0/5TyWQm1/AygPg2DEh5zvJ0lmDm0bupsT/WXYTF9dBrZgxSGqU12MQ+PVHlI 5b1WOQsJRaSTnamj7m2tTOXxZ20mKpvHsZl/IJhXA3a/pSVFZol/1QwKppKuZAIMqjg7pXUN WGTfusrsq+SGnqIEww5QJUsZ+RtndaJGbyfqFNgL3W79FspgEJ86Iv/r1sop4xzuNCd3B63Z W1Dk0RrsA3ciY3V9MLOA5Te7rANoTyKSi8Q156Z26XUZ06Bw==
- Ironport-sdr: nhLzeuLLWpwfSw+IzBuaRByy6tJDO1wCO7HXnnyN5Ml5MxYiTghhsICYX3l95+Xb/PfqKHbNhx bsGuHIIsSnspnMjlUdx+ESUcikY47Pfet3hhimGEz8V3HU5jcx2IAPCUdXhC/I0VeuWuL5dTxX xCyCia8JQWxsaeEoDb+miBVfGi8th8QRk2fHF+LYAeS7FrMB3HDTMqEFchtJfnzato5t/sk6+E qLB/oi87Ep8MTaui+YOUNQK22fukF7COdm8pz6ORjXEtGeG+Y0uNzvYej+CkbXK3w3123XwEPt p/ZUZmHY0VwG3eA3L9xD32FK
- 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 | 645 ++++++++---------------
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, 946 insertions(+), 605 deletions(-)
--
2.34.1
|