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

Re: [Xen-devel] [PATCH 3/9] x86/cpuid: Extend the cpuid= command line option to support all named features



On Mon, Dec 03, 2018 at 04:18:16PM +0000, Andrew Cooper wrote:
> For gen-cpuid.py, fix a comment describing self.names, and generate the
> reverse mapping in self.values.  Write out INIT_FEATURE_NAMES which maps a
> string name to a bit position.
> 
> For parse_cpuid(), introduce a slightly fuzzy strcmp() to accept changes in
> punctuation, and perform a binary search over INIT_FEATURE_NAMES.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
> ---
> CC: Jan Beulich <JBeulich@xxxxxxxx>
> CC: Wei Liu <wei.liu2@xxxxxxxxxx>
> CC: Roger Pau Monné <roger.pau@xxxxxxxxxx>
> 
> Slightly RFC, because I'm not entirely certain if this is a good idea or not.
> ---
>  xen/arch/x86/cpuid.c   | 91 
> ++++++++++++++++++++++++++++++++++++--------------
>  xen/tools/gen-cpuid.py | 22 ++++++++++--
>  2 files changed, 86 insertions(+), 27 deletions(-)
> 
> diff --git a/xen/arch/x86/cpuid.c b/xen/arch/x86/cpuid.c
> index 0591a7d..eb86a86 100644
> --- a/xen/arch/x86/cpuid.c
> +++ b/xen/arch/x86/cpuid.c
> @@ -18,9 +18,34 @@ static const uint32_t hvm_shadow_featuremask[] = 
> INIT_HVM_SHADOW_FEATURES;
>  static const uint32_t hvm_hap_featuremask[] = INIT_HVM_HAP_FEATURES;
>  static const uint32_t deep_features[] = INIT_DEEP_FEATURES;
>  
> +/*
> + * Works like strcmp(), but customised specifically for this usecase.  'name'
> + * is a NUL terminated string.  's' is considered to match 'name' if the NUL
> + * terminator of 'name' match punctiation in 's'.

"punctuation".

Wei.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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