All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Anthony PERARD <anthony@xenproject.org>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH for-4.19 v2] tools/xen-cpuid: switch to use cpu-policy defined names
Date: Thu, 2 May 2024 16:34:44 +0200	[thread overview]
Message-ID: <ZjOkhMGzHWEEdsQf@macbook> (raw)
In-Reply-To: <2ddc6307-c9a6-4ee8-9689-c9c2c5a37142@suse.com>

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@citrix.com>
> 
> Reviewed-by: Jan Beulich <jbeulich@suse.com>
> 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.


  reply	other threads:[~2024-05-02 14:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-02 11:49 [PATCH for-4.19 v2] tools/xen-cpuid: switch to use cpu-policy defined names Roger Pau Monne
2024-05-02 13:16 ` Jan Beulich
2024-05-02 14:34   ` Roger Pau Monné [this message]
2024-05-09 12:13   ` Roger Pau Monné
2024-05-14  9:15     ` Oleksii K.
2024-05-10 18:08 ` Andrew Cooper

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZjOkhMGzHWEEdsQf@macbook \
    --to=roger.pau@citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=anthony@xenproject.org \
    --cc=jbeulich@suse.com \
    --cc=oleksii.kurochko@gmail.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.