On 23/03/2021 09:58, Roger Pau Monne wrote: > Introduce a helper to obtain a compatible cpu policy based on two > input cpu policies. Currently this is done by and'ing all CPUID leaves > and MSR entries, except for MSR_ARCH_CAPABILITIES which has the RSBA > bit or'ed. > > The _AC macro is pulled from libxl_internal.h into xen-tools/libs.h > since it's required in order to use the msr-index.h header. > > Note there's no need to place this helper in libx86, since the > calculation of a compatible policy shouldn't be done from the > hypervisor. > > No callers of the interface introduced. > > Signed-off-by: Roger Pau Monné <roger....@citrix.com>
I think this wants to be in libx86, because we'll want it to replace the opencoded derivation logic in init_cpuid() Also, we absolutely want to unit test it. (I could have sworn I already started some work there - maybe its hidden in one of my WIP branches). ~Andrew