tools/libxc: Improve efficiency of xc_cpuid_apply_policy()
Having the internals of xc_cpuid_policy() make hypercalls to collect domain
information causes xc_cpuid_apply_policy() to be very inefficient.
Re-order operations to collect all information at once at the outermost layer,
and pass a structure in to all cpuid policy generation functions.
This removes several hypercalls (4 from HVM, 3 from PV) for each of the
up-to 108 leaves processed.
No change in the eventual policy provided, although all the information
gathering how has (or has correct) error checking.
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>