From: Igor Mammedov <imammedo@redhat.com>
To: Vitaly Kuznetsov <vkuznets@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
Marcelo Tosatti <mtosatti@redhat.com>,
Eduardo Habkost <ehabkost@redhat.com>,
qemu-devel@nongnu.org
Subject: Re: [PATCH 5/5] i386: provide simple 'hyperv=on' option to x86 machine types
Date: Tue, 5 Jan 2021 17:33:50 +0100 [thread overview]
Message-ID: <20210105173350.01366101@redhat.com> (raw)
In-Reply-To: <87czyjifmb.fsf@vitty.brq.redhat.com>
On Tue, 05 Jan 2021 16:10:36 +0100
Vitaly Kuznetsov <vkuznets@redhat.com> wrote:
> Eduardo Habkost <ehabkost@redhat.com> writes:
>
> > On Tue, Jan 05, 2021 at 12:36:50AM +0100, Igor Mammedov wrote:
> >>
> >> documenting is good, but if it adds new semantics to how CPU features are handled
> >> users up the stack will need code it up as well and juggle with
> >> -machine + -cpu + -device cpu-foo
> >> not to mention poor developers who will have to figure out why we do
> >> set CPU properties in multiple different ways.
> >>
> >> however if we add it as CPU properties that behave the same way as other
> >> properties, all mgmt has to do is expose new property to user for usage.
> >
> > I think we need to be careful here. Sometimes just exposing the
> > QOM properties used to implemented a feature is not the best user
> > interface. e.g.: even if using compat_props for implementing the
> > hyperv features preset, that doesn't automatically mean we want
> > hyperv=on to be a -cpu option.
> >
> > I would even argue we shouldn't be focusing on implementation
> > details (like we are doing right now) until the desired external
> > interface is described clearly.
>
> I agree, the interface is definitely more important than the
> implementation here. AFAIU we have two options suggested:
>
> 1) 'hyperv=on' option for x86 machine types.
>
> Pros: we can use it later to create non-CPU Hyper-V devices
> (e.g. Vmbus).
> Cons: two different places for the currently existing Hyper-V features
> enablement (-cpu and -machine), non-standard way of doing things
> (code-wise).
>
> 2) 'hv_default=on' -cpu option
>
> Pros: Single place to enable all Hyper-V enlightenments, we can make it
> mutually exclusive with other hv_* options including hv_passthrough
> (clear semantics).
>
> Cons: This can't be reused to create non-CPU objects in the future and
> so upper layers will (again) need to be modified.
>
> There's probably more, please feel free to add.
#1 can be implemented on top of #2, when it becomes necessary.
> >> however in this case we are talking about a set of cpu features,
> >> if there is no way to implement it as cpu properties + compat properties
> >> and requires opencodding it within machine code it might be fine
> >> but I fail to see a very good reason for doing that at this momment.
> >
> > The reason would be just simplicity of implementation.
> >
> > I understand there are reasons to suggest using compat_props if
> > it makes things simpler, but I don't see why we would reject a
> > patch because the implementation is not based purely on
> > compat_props.
> >
> > I will let Vitaly to decide how to proceed, based on our
> > feedback. I encourage him to use compat_props like you suggest,
> > but I don't plan to make this a requirement.
> >
>
> Like I replied to Igor in a parallel thread, I hardly see how using
> compat_props can simplify things in case we decide to keep 'hyperv=on' a
> machine type option. It doesn't seem to fit our use-case when we need a
> mechanism to alter CPU properties for the current machine type as well
> as subtract some features for the old ones. If we, however, decide that
> '-cpu' option is better, then we can try to make it work (but the
> implementation won't be straitforward either).
lets discuss it in that thread.
next prev parent reply other threads:[~2021-01-05 16:38 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-19 10:32 [PATCH 0/5] i386: simplify Hyper-V enlightenments enablement Vitaly Kuznetsov
2020-11-19 10:32 ` [PATCH 1/5] i386: move hyperv_vendor_id initialization to x86_cpu_realizefn() Vitaly Kuznetsov
2021-03-10 11:27 ` Claudio Fontana
2021-03-10 11:43 ` Vitaly Kuznetsov
2021-03-10 12:18 ` Claudio Fontana
2021-03-10 13:13 ` Vitaly Kuznetsov
2020-11-19 10:32 ` [PATCH 2/5] i386: move hyperv_interface_id " Vitaly Kuznetsov
2020-11-19 10:32 ` [PATCH 3/5] i386: move hyperv_version_id " Vitaly Kuznetsov
2020-11-19 10:32 ` [PATCH 4/5] i386: move hyperv_limits " Vitaly Kuznetsov
2020-11-19 10:32 ` [PATCH 5/5] i386: provide simple 'hyperv=on' option to x86 machine types Vitaly Kuznetsov
2020-12-16 20:52 ` Eduardo Habkost
2020-12-17 9:34 ` Vitaly Kuznetsov
2020-12-18 17:13 ` Igor Mammedov
2020-12-18 18:07 ` Eduardo Habkost
2020-12-21 13:24 ` Igor Mammedov
2020-12-21 19:47 ` Eduardo Habkost
2020-12-21 20:39 ` David Hildenbrand
2021-01-04 12:54 ` Vitaly Kuznetsov
2021-01-04 18:29 ` Eduardo Habkost
2021-01-04 23:36 ` Igor Mammedov
2021-01-05 14:34 ` Eduardo Habkost
2021-01-05 15:10 ` Vitaly Kuznetsov
2021-01-05 16:33 ` Igor Mammedov [this message]
2021-01-05 16:31 ` Igor Mammedov
2021-01-05 17:02 ` Vitaly Kuznetsov
2021-01-05 18:19 ` Eduardo Habkost
2021-01-04 23:04 ` Igor Mammedov
2021-01-05 11:50 ` Vitaly Kuznetsov
2021-01-05 16:03 ` Igor Mammedov
2021-01-05 16:31 ` Vitaly Kuznetsov
2021-01-06 13:13 ` Igor Mammedov
2021-01-06 13:38 ` Vitaly Kuznetsov
2021-01-06 16:45 ` Igor Mammedov
2021-01-06 17:25 ` Eduardo Habkost
2021-01-07 9:14 ` Vitaly Kuznetsov
2021-01-06 17:02 ` Eduardo Habkost
2020-11-19 14:22 ` [PATCH 0/5] i386: simplify Hyper-V enlightenments enablement Claudio Fontana
2020-11-19 16:58 ` Vitaly Kuznetsov
2020-12-16 19:09 ` Eduardo Habkost
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=20210105173350.01366101@redhat.com \
--to=imammedo@redhat.com \
--cc=ehabkost@redhat.com \
--cc=mtosatti@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=vkuznets@redhat.com \
/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).