From: Robert Hoo <robert.hu@linux.intel.com>
To: Eduardo Habkost <ehabkost@redhat.com>
Cc: "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
"armbru@redhat.com" <armbru@redhat.com>,
"Hu, Robert" <robert.hu@intel.com>,
"pbonzini@redhat.com" <pbonzini@redhat.com>,
"rth@twiddle.net" <rth@twiddle.net>
Subject: Re: [PATCH v3 1/2] Introduce (x86) CPU model deprecation API
Date: Tue, 22 Sep 2020 13:07:21 +0800 [thread overview]
Message-ID: <d973bb935279f97b39a398e1fcdeedfb0ef6fc84.camel@linux.intel.com> (raw)
In-Reply-To: <20200921153704.GN57321@habkost.net>
On Mon, 2020-09-21 at 11:37 -0400, Eduardo Habkost wrote:
> >
...
> > Yes. Trying as less refactor as possible. I think my changes even
> > cannot be called refactor at all. :)
> > My idea is to make unversioned CPU model virtual. I did some patch,
> > doable:
> > 1) in x86_register_cpudef_types(), don't register cpu_model type
> > for
> > the unversioned 'Model'.
> > 2) in x86_cpu_class_by_name(), check passed-in cpu_model param
> > versioned or not, if the virtual unversioned 'Model', parse it to
> > some
> > concrete version by global default_cpu_version designation.
> >
> > So, user can still use '-cpu Model' as before, no interface
> > changes.
> > And no nature changes:
> > 1) in current code, even legacy 'Model', you have created a v1
> > model
> > for it. i.e., every virtual 'Model' already has at least one
> > concrete
> > versioned one.
> > 2) in current code, x86_cpu_model_resolve_version() is called when
> > x86_cpu_load_model(). x86_cpu_model_resolve_version() actually does
> > kind of work that concreting unversioned Model to its versioned
> > one, by
> > global default_cpu_version designation. Same as my aforementioned
> > above.
> >
> > Would you like me to integrate this implementation in v4? to have a
> > look.
>
> I think we might give this a try, but I wouldn't like to have
> your model deprecation series delayed because of this. Some
> obstacles I expect to see:
>
> Right now the code assumes a 1:1 mapping between CPU model and
> QOM class. We even have a `typename` field returned by
> query-cpu-definitions.
>
> It would also become an obstacle for removing the existing
> arch-specific class_by_name methods and do the model->class
> mapping based solely on a string template. See this thread for a
> glimpse on what we have been trying to do:
> https://lore.kernel.org/qemu-devel/877eb173a3.fsf@dusky.pond.sub.org/
>
> I'm not saying we shouldn't do what you suggest, but it would add
> a lot of complexity to your CPU model deprecation work (that's
> very close to be ready to be merged).
>
OK, I'm going to send v4 without this.
Then send this in a separate patch for discussion.
> > > >
> > > --
> > > Eduardo
> > >
>
>
prev parent reply other threads:[~2020-09-22 5:08 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-16 8:37 [PATCH v3 1/2] Introduce (x86) CPU model deprecation API Robert Hoo
2020-09-16 8:37 ` [PATCH v3 2/2] Mark Icelake-Client CPU models deprecated Robert Hoo
2020-09-17 18:01 ` Eduardo Habkost
2020-09-18 2:18 ` Robert Hoo
2020-09-18 4:20 ` Eduardo Habkost
2020-09-21 7:45 ` Robert Hoo
2020-09-21 15:25 ` Eduardo Habkost
2020-09-17 18:18 ` [PATCH v3 1/2] Introduce (x86) CPU model deprecation API Eduardo Habkost
2020-09-18 5:48 ` Robert Hoo
2020-09-18 16:42 ` Eduardo Habkost
2020-09-19 3:22 ` Robert Hoo
2020-09-21 15:37 ` Eduardo Habkost
2020-09-22 5:07 ` Robert Hoo [this message]
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=d973bb935279f97b39a398e1fcdeedfb0ef6fc84.camel@linux.intel.com \
--to=robert.hu@linux.intel.com \
--cc=armbru@redhat.com \
--cc=ehabkost@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=robert.hu@intel.com \
--cc=rth@twiddle.net \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).