On 23/03/2021 09:58, Roger Pau Monne wrote: > Older Xen versions used to expose some CPUID bits which are no longer > exposed by default. In order to keep a compatible behavior with > guests migrated from versions of Xen that don't encode the CPUID data > on the migration stream introduce a function that sets the same bits > as older Xen versions. > > This is pulled out from xc_cpuid_apply_policy which already has this > logic present. > > No functional change intended. > > Signed-off-by: Roger Pau Monné <roger....@citrix.com> > --- > tools/include/xenctrl.h | 4 ++++ > tools/libs/guest/xg_cpuid_x86.c | 39 ++++++++++++++++++++++++++++----- > 2 files changed, 37 insertions(+), 6 deletions(-) > > diff --git a/tools/include/xenctrl.h b/tools/include/xenctrl.h > index 5f3e5e17e9d..6f7158156fa 100644 > --- a/tools/include/xenctrl.h > +++ b/tools/include/xenctrl.h > @@ -2627,6 +2627,10 @@ int xc_cpu_policy_calc_compatible(xc_interface *xch, > const xc_cpu_policy_t p2, > xc_cpu_policy_t out); > > +/* Make a policy compatible with previous Xen versions. */ > +int xc_cpu_policy_make_compatible(xc_interface *xch, xc_cpu_policy_t policy, > + bool hvm);
I think this probably wants "pre-4.14(?)" somewhere obvious, because "compatible" on its own is very ambiguous. ~Andrew