From: Jan Beulich Date: Thu, 25 Jun 2020 07:12:21 +0000 (+0200) Subject: x86/CPUID: fill all fields in x86_cpuid_policy_fill_native() X-Git-Tag: archive/raspbian/4.14.0+80-gd101b417b7-1+rpi1^2~63^2~54 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=e4d2207165b379ec13c8b512936f63982af62d13;p=xen.git x86/CPUID: fill all fields in x86_cpuid_policy_fill_native() Coverity validly complains that the new call from tools/tests/cpu-policy/test-cpu-policy.c:test_cpuid_current() leaves two fields uninitialized, yet they get then consumed by x86_cpuid_copy_to_buffer(). (All other present callers of the function pass a pointer to a static - and hence initialized - buffer.) Coverity-ID: 1464809 Fixes: c22ced93e167 ("tests/cpu-policy: Confirm that CPUID serialisation is sorted") Signed-off-by: Jan Beulich Reviewed-by: Andrew Cooper Release-acked-by: Paul Durrant --- diff --git a/xen/lib/x86/cpuid.c b/xen/lib/x86/cpuid.c index c111d43b00..c7a0508148 100644 --- a/xen/lib/x86/cpuid.c +++ b/xen/lib/x86/cpuid.c @@ -176,6 +176,10 @@ void x86_cpuid_policy_fill_native(struct cpuid_policy *p) ARRAY_SIZE(p->extd.raw) - 1); ++i ) cpuid_leaf(0x80000000 + i, &p->extd.raw[i]); + /* Don't report leaves from possible lower level hypervisor, for now. */ + p->hv_limit = 0; + p->hv2_limit = 0; + x86_cpuid_policy_recalc_synth(p); }