]> xenbits.xensource.com Git - people/larsk/xen.git/commit
tools/libxc: Rework xc_cpuid_apply_policy() to use {get,set}_cpu_policy()
authorAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 9 Sep 2019 17:38:35 +0000 (18:38 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 26 Sep 2019 12:40:18 +0000 (13:40 +0100)
commit685e922d6f30f17cb6b902c25c21a5da7326738f
tree3e067a3c48984df9d950470369b4dd8a1a09bd30
parente5b02b085e61c43a6b8346b7bb9e0c0ee1f30ef4
tools/libxc: Rework xc_cpuid_apply_policy() to use {get,set}_cpu_policy()

The purpose of this change is to stop using xc_cpuid_do_domctl(), and to stop
basing decisions on a local CPUID instruction.  This is not a correct or
appropriate way to construct policy information for other domains.

The overwhelming majority of this logic is redundant with the policy logic in
Xen, but has a habit of becoming stale (e.g. c/s 97e4ebdcd76 resulting in the
CPUID.7[1].eax not being offered to guests even when Xen is happy with the
content).

There are a few subtle side effects which need to remain in place.  A
successful call to xc_cpuid_apply_policy() must result in a call to
xc_set_domain_cpu_policy() because that is currently the only way the
ITSC/VMX/SVM bits become reflected in the guests CPUID view.  Future cleanup
will remove this side effect.

The topology tweaks are local to libxc.  Extend struct cpuid_policy with
enough named fields to express the logic, but keep it identical to before.
Fixing topology representation is another future area of work.

No (expected) change in behaviour.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Wei Liu <wl@xen.org>
Release-acked-by: Juergen Gross <jgross@suse.com>
tools/libxc/xc_cpuid_x86.c
xen/include/xen/lib/x86/cpuid.h