[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH for-4.19 v2] tools/xen-cpuid: switch to use cpu-policy defined names
On Thu, May 02, 2024 at 03:16:54PM +0200, Jan Beulich wrote: > 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.pau@xxxxxxxxxx> > > Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx> > except that ... Thanks. > > > --- 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. If I understood this correctly (which I might have not, I know very little Python), iteritems() method was removed in Python 3, and what used to be iteritems() in Python 2 is items() on Python 3. Regards, Roger.
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |