libx86/CPUID: fix (not just) leaf 7 processing
authorJan Beulich <jbeulich@suse.com>
Fri, 27 Mar 2020 10:40:59 +0000 (11:40 +0100)
committerJan Beulich <jbeulich@suse.com>
Fri, 27 Mar 2020 10:40:59 +0000 (11:40 +0100)
commiteb0bad81fceb3e81df5f73441771b49b732edf56
treef8141c85429aa559cf49b50ff40365024bdcdb12
parent88a1a11daeb93c0f16d9c4d5cb30f1f563c1817c
libx86/CPUID: fix (not just) leaf 7 processing

For one, subleaves within the respective union shouldn't live in
separate sub-structures. And then x86_cpuid_policy_fill_native() should,
as it did originally, iterate over all subleaves here as well as over
all main leaves. Switch to using a "<= MIN()"-based approach similar to
that used in x86_cpuid_copy_to_buffer(). Also follow this for the
extended main leaves then.

Fixes: 1bd2b750537b ("libx86: Fix 32bit stubdom build of x86_cpuid_policy_fill_native()")
Fixes: 97e4ebdcd765 ("x86/CPUID: support leaf 7 subleaf 1 / AVX512_BF16")
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/include/xen/lib/x86/cpuid.h
xen/lib/x86/cpuid.c