On 23/03/2021 09:58, Roger Pau Monne wrote: > Such helpers is just a wrapper to the existing > x86_cpu_policies_are_compatible function. This requires building > policy.c from libx86 on user land also. > > No user of the interface introduced. > > Signed-off-by: Roger Pau Monné <roger....@citrix.com> > --- > tools/include/xenctrl.h | 4 ++++ > tools/libs/guest/Makefile | 2 +- > tools/libs/guest/xg_cpuid_x86.c | 17 +++++++++++++++++ > 3 files changed, 22 insertions(+), 1 deletion(-) > > diff --git a/tools/include/xenctrl.h b/tools/include/xenctrl.h > index 164a287b367..165beff330f 100644 > --- a/tools/include/xenctrl.h > +++ b/tools/include/xenctrl.h > @@ -2619,6 +2619,10 @@ int xc_cpu_policy_update_cpuid(xc_interface *xch, > xc_cpu_policy_t policy, > int xc_cpu_policy_update_msrs(xc_interface *xch, xc_cpu_policy_t policy, > const xen_msr_entry_t *msrs, uint32_t nr); > > +/* Compatibility calculations. */ > +bool xc_cpu_policy_is_compatible(xc_interface *xch, const xc_cpu_policy_t p1, > + const xc_cpu_policy_t p2);
Exposing this in the interface is useful and necessary. However, the operation is not commutative. p1 and p2 are not interchangeable, is why the libx86 function has specifically named parameters. This distinction needs making clear at this level as well. ~Andrew