tools/libxc: Improve efficiency of xc_cpuid_apply_policy()
authorAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 5 Oct 2015 13:12:17 +0000 (14:12 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Wed, 7 Oct 2015 11:26:25 +0000 (12:26 +0100)
commitbf87f3a24f25eb3628dfb62a2d0ce3802a09783b
treead8fa0ff4ac74d41601c722906c157a109240cba
parent7f25baba1c0942e50757f4ecb233202dbbc057b9
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>
tools/libxc/xc_cpuid_x86.c