[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] x86/CPUID: fill all fields in x86_cpuid_policy_fill_native()


  • To: Jan Beulich <jbeulich@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Mon, 22 Jun 2020 13:39:23 +0100
  • Authentication-results: esa2.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: Paul Durrant <paul@xxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Mon, 22 Jun 2020 12:39:32 +0000
  • Ironport-sdr: OVk8geFmR6xtVi3u5EUW/YEMvHM4My/nqALXbeX7+H+Ue9g98FP3POgm3gds5sjABmMjp4iDoB hMIaWM3whag9L+/MKtfiHjF+5xIxf3+7NbnZwLSO5rxDUCNBmKVNQLp6ouexCpJsQ3ezcv3CAG 8Zeurgx1Fr7nCzSDpf8gUzMCCG7OrlrDfdf1Ht/F73Hi/PAnnoLxqLRM/dBpUODVls4aAhDw4X FxeVgb4UO+rPjwxAFn/FoWiYLYQRSCQZ+F6KckE5uLuongOFVzpFoZKp0/ORenImiBSx3qdW7H jaU=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 22/06/2020 13:09, Jan Beulich wrote:
> 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 <jbeulich@xxxxxxxx>
>
> --- a/xen/lib/x86/cpuid.c
> +++ b/xen/lib/x86/cpuid.c
> @@ -176,6 +176,10 @@ void x86_cpuid_policy_fill_native(struct
>                            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."

This will change in the future.

With this, Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>

> +    p->hv_limit = 0;
> +    p->hv2_limit = 0;
> +
>      x86_cpuid_policy_recalc_synth(p);
>  }
>  




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.