tests/cpu-policy: Confirm that CPUID serialisation is sorted
authorAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 12 Jun 2020 15:48:02 +0000 (16:48 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 17 Jun 2020 12:54:12 +0000 (13:54 +0100)
commitc22ced93e167f56104111fcc414298c0cd2db3e9
tree841b9f4547ddf5cc1b912f9df3625f4593a0deab
parent700738bf6a7a89a1b41cc783ae58f7c8ec1e9cfa
tests/cpu-policy: Confirm that CPUID serialisation is sorted

The existing x86_cpuid_copy_to_buffer() does produce sorted results, and we're
about to start relying on this.  Extend the unit tests.

As test_cpuid_serialise_success() is a fairly limited set of synthetic
examples right now, introduce test_cpuid_current() to operate on the full
policy for the current CPU.

Tweak the fail() macro to allow for simplified control flow.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Release-acked-by: Paul Durrant <paul@xen.org>
tools/tests/cpu-policy/test-cpu-policy.c