On 02.05.2024 13:49, Roger Pau Monne wrote: > Like it was done recently for libxl, switch to using the auto-generated > feature > names by the processing of cpufeatureset.h, this allows removing the > open-coded > feature names, and unifies the feature naming with libxl and the hypervisor. > > Introduce a newly auto-generated array that contains the feature names indexed > at featureset bit position, otherwise using the existing INIT_FEATURE_NAMES > would require iterating over the array elements until a match with the > expected > bit position is found. > > Note that leaf names need to be kept, as the current auto-generated data > doesn't contain the leaf names. > > Signed-off-by: Roger Pau Monné <roger....@citrix.com>
Reviewed-by: Jan Beulich <jbeul...@suse.com> except that ... > --- a/xen/tools/gen-cpuid.py > +++ b/xen/tools/gen-cpuid.py > @@ -475,6 +475,32 @@ def write_results(state): > state.output.write( > """} > > +""") > + > + state.output.write( > +""" > +#define INIT_FEATURE_NAME_ARRAY { \\ > +""") > + > + try: > + _tmp = state.names.iteritems() > + except AttributeError: > + _tmp = state.names.items() ... can't figure what this try/except is needed for. Hopefully someone with better Python foo than mine can take a look. Jan