Re: [Xen-devel] [PATCH 1/2] libx86: Helper for clearing out-of-range CPUID leaves

2019-06-05 Thread Jan Beulich
>>> On 05.06.19 at 13:26, wrote: > On 05/06/2019 10:45, Jan Beulich wrote: > On 04.06.19 at 21:51, wrote: >>> @@ -163,6 +170,58 @@ void x86_cpuid_policy_fill_native(struct cpuid_policy > *p) >>> recalculate_synth(p); >>> } >>> >>> +void x86_cpuid_policy_clear_out_of_range_leaves(stru

Re: [Xen-devel] [PATCH 1/2] libx86: Helper for clearing out-of-range CPUID leaves

2019-06-05 Thread Andrew Cooper
On 05/06/2019 10:45, Jan Beulich wrote: On 04.06.19 at 21:51, wrote: >> @@ -163,6 +170,58 @@ void x86_cpuid_policy_fill_native(struct cpuid_policy >> *p) >> recalculate_synth(p); >> } >> >> +void x86_cpuid_policy_clear_out_of_range_leaves(struct cpuid_policy *p) >> +{ >> +unsigne

Re: [Xen-devel] [PATCH 1/2] libx86: Helper for clearing out-of-range CPUID leaves

2019-06-05 Thread Jan Beulich
>>> On 04.06.19 at 21:51, wrote: > @@ -163,6 +170,58 @@ void x86_cpuid_policy_fill_native(struct cpuid_policy *p) > recalculate_synth(p); > } > > +void x86_cpuid_policy_clear_out_of_range_leaves(struct cpuid_policy *p) > +{ > +unsigned int i; > + > +zero_leaves(p->basic.raw, p->bas

[Xen-devel] [PATCH 1/2] libx86: Helper for clearing out-of-range CPUID leaves

2019-06-04 Thread Andrew Cooper
When merging a levelled policy, stale out-of-range leaves may remain. Introduce a helper to clear them, and test a number of the subtle corner cases. Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Wei Liu CC: Roger Pau Monné CC: Sergey Dyasli --- tools/tests/cpu-policy/test-cpu-policy.