All of lore.kernel.org
 help / color / mirror / Atom feed
From: Valeriy Vdovin <valery.vdovin.s@gmail.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	Thomas Huth <thuth@redhat.com>,
	Marcel Apfelbaum <marcel.apfelbaum@gmail.com>,
	Eric Blake <eblake@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Marcelo Tosatti <mtosatti@redhat.com>,
	Richard Henderson <richard.henderson@linaro.org>,
	Laurent Vivier <lvivier@redhat.com>,
	kvm@vger.kernel.org, Denis Lunev <den@openvz.org>,
	Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>,
	Valeriy Vdovin <valery.vdovin.s@gmail.com>
Subject: Re: [PATCH v12] qapi: introduce 'query-x86-cpuid' QMP command.
Date: Fri, 3 Sep 2021 12:33:25 +0300	[thread overview]
Message-ID: <20210903093325.GA26525@zombie> (raw)
In-Reply-To: <8735qzpccg.fsf@dusky.pond.sub.org>

On Tue, 24 Aug 2021 08:48:31 +0200 Marcus Armbruster <armbru@redhat.com> wrote:

>Eduardo Habkost <ehabkost@redhat.com> writes:
>
>> On Mon, Aug 23, 2021 at 9:35 AM Markus Armbruster <armbru@redhat.com> wrote:
>>>
>>> Eduardo Habkost <ehabkost@redhat.com> writes:
>>>
>>> > On Wed, Aug 11, 2021 at 9:44 AM Thomas Huth <thuth@redhat.com> wrote:
>>> >>
>>> >> On 11/08/2021 15.40, Eduardo Habkost wrote:
>>> >> > On Wed, Aug 11, 2021 at 2:10 AM Thomas Huth <thuth@redhat.com> wrote:
>>> >> >>
>>> >> >> On 10/08/2021 20.56, Eduardo Habkost wrote:
>>> >> >>> On Sat, Aug 07, 2021 at 04:22:42PM +0200, Markus Armbruster wrote:
>>> >> >>>> Is this intended to be a stable interface?  Interfaces intended just
>>> >> >>>> for
>>> >> >>>> debugging usually aren't.
>>> >> >>>
>>> >> >>> I don't think we need to make it a stable interface, but I won't
>>> >> >>> mind if we declare it stable.
>>> >> >>
>>> >> >> If we don't feel 100% certain yet, it's maybe better to introduce this
>>> >> >> with
>>> >> >> a "x-" prefix first, isn't it? I.e. "x-query-x86-cpuid" ... then it's
>>> >> >> clear
>>> >> >> that this is only experimental/debugging/not-stable yet. Just my 0.02
>>> >> >> €.
>>> >> >
>>> >> > That would be my expectation. Is this a documented policy?
>>> >> >
>>> >>
>>> >> According to docs/interop/qmp-spec.txt :
>>> >>
>>> >>   Any command or member name beginning with "x-" is deemed
>>> >>   experimental, and may be withdrawn or changed in an incompatible
>>> >>   manner in a future release.
>>> >
>>> > Thanks! I had looked at other QMP docs, but not qmp-spec.txt.
>>> >
>>> > In my reply above, please read "make it a stable interface" as
>>> > "declare it as supported by not using the 'x-' prefix".
>>> >
>>> > I don't think we have to make it stable, but I won't argue against it
>>> > if the current proposal is deemed acceptable by other maintainers.
>>> >
>>> > Personally, I'm still frustrated by the complexity of the current
>>> > proposal, but I don't want to block it just because of my frustration.
>>>
>>> Is this a case of "there must be a simpler way", or did you actually
>>> propose a simpler way?  I don't remember...
>>>
>>
>> I did propose a simpler way at
>> 20210810195053.6vsjadglrexf6jwy@habkost.net/">https://lore.kernel.org/qemu-devel/20210810195053.6vsjadglrexf6jwy@habkost.net/
>

Hi. Sorry for the late response to that.

Also sorry for possible technical email header errors in my reply mail, as I was switching the e-mail accounts that I use to
communicate with this maillist, so hope technically all went well.

>Valeriy, would the simpler way still work for you?
>
>If no, please explain why.  If you already did, just provide a pointer.
>
Yes, I remember your proposal of using just 5 lines of code. To be exact here are
those proposed lines:

>>    for start in (0, 0x40000000, 0x80000000, 0xC0000000):
>>        leaf = query_cpuid(qom_path, start)
>>        for eax in range(start, leaf.max_eax + 1):
>>            for ecx in range(0, leaf.get('max_ecx', 0) + 1):
>>                all_leaves.append(query_cpuid(qom_path, eax, ecx))


It looks cool and short, but this is only a pseudocode with not only variable declarations omitted, but
with some logic omitted as well. It does not become obvious until you start typing the code and then review it.
In fact the patch, to which you have done this suggestion back then already had the same concept at it's basis, but
it has grown quickly to somewhat more complex code than it's conceptual pseudo-brother above.

I'm sure that this current patch (which is the most recent in v15 email) is the most simple and shortest of possible.
This is iteration 3 patch, with first iteration being the one to which you've made that suggestion, but then we also tried one
more version by trying to do this via KVM ioctls, but it did not work quite smooth. So this last iteration at which we are currently
looking at is really the product of thought and is the simplest.

I suggest that we stick to it and start converging towards it's submission instead of going to another round of coding and discussion.
v15 - is the result of fine-tunes and rebases, that has already covered a lot of comments. Please let's review it to the end and give it a go.


>If yes, we need to choose between the complex solution we have and the
>simpler solution we still need to code up.  The latter is extra work,
>but having to carry more complex code is going to be extra work, too.

I agree to the idea that we MUST minimize support effort in priority to the commiting effort, but here I do not see direct dependency
between the two. This is already the simplest solution. All the code we have here is mostly
to service the QMP machinery, which has to be in any version of the patch. The payload code is minimal.

Thanks.

WARNING: multiple messages have this Message-ID (diff)
From: Valeriy Vdovin <valery.vdovin.s@gmail.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: Laurent Vivier <lvivier@redhat.com>,
	Thomas Huth <thuth@redhat.com>,
	Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>,
	kvm@vger.kernel.org, Valeriy Vdovin <valery.vdovin.s@gmail.com>,
	Marcelo Tosatti <mtosatti@redhat.com>,
	Richard Henderson <richard.henderson@linaro.org>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	Denis Lunev <den@openvz.org>, Paolo Bonzini <pbonzini@redhat.com>,
	Eric Blake <eblake@redhat.com>
Subject: Re: [PATCH v12] qapi: introduce 'query-x86-cpuid' QMP command.
Date: Fri, 3 Sep 2021 12:33:25 +0300	[thread overview]
Message-ID: <20210903093325.GA26525@zombie> (raw)
In-Reply-To: <8735qzpccg.fsf@dusky.pond.sub.org>

On Tue, 24 Aug 2021 08:48:31 +0200 Marcus Armbruster <armbru@redhat.com> wrote:

>Eduardo Habkost <ehabkost@redhat.com> writes:
>
>> On Mon, Aug 23, 2021 at 9:35 AM Markus Armbruster <armbru@redhat.com> wrote:
>>>
>>> Eduardo Habkost <ehabkost@redhat.com> writes:
>>>
>>> > On Wed, Aug 11, 2021 at 9:44 AM Thomas Huth <thuth@redhat.com> wrote:
>>> >>
>>> >> On 11/08/2021 15.40, Eduardo Habkost wrote:
>>> >> > On Wed, Aug 11, 2021 at 2:10 AM Thomas Huth <thuth@redhat.com> wrote:
>>> >> >>
>>> >> >> On 10/08/2021 20.56, Eduardo Habkost wrote:
>>> >> >>> On Sat, Aug 07, 2021 at 04:22:42PM +0200, Markus Armbruster wrote:
>>> >> >>>> Is this intended to be a stable interface?  Interfaces intended just
>>> >> >>>> for
>>> >> >>>> debugging usually aren't.
>>> >> >>>
>>> >> >>> I don't think we need to make it a stable interface, but I won't
>>> >> >>> mind if we declare it stable.
>>> >> >>
>>> >> >> If we don't feel 100% certain yet, it's maybe better to introduce this
>>> >> >> with
>>> >> >> a "x-" prefix first, isn't it? I.e. "x-query-x86-cpuid" ... then it's
>>> >> >> clear
>>> >> >> that this is only experimental/debugging/not-stable yet. Just my 0.02
>>> >> >> €.
>>> >> >
>>> >> > That would be my expectation. Is this a documented policy?
>>> >> >
>>> >>
>>> >> According to docs/interop/qmp-spec.txt :
>>> >>
>>> >>   Any command or member name beginning with "x-" is deemed
>>> >>   experimental, and may be withdrawn or changed in an incompatible
>>> >>   manner in a future release.
>>> >
>>> > Thanks! I had looked at other QMP docs, but not qmp-spec.txt.
>>> >
>>> > In my reply above, please read "make it a stable interface" as
>>> > "declare it as supported by not using the 'x-' prefix".
>>> >
>>> > I don't think we have to make it stable, but I won't argue against it
>>> > if the current proposal is deemed acceptable by other maintainers.
>>> >
>>> > Personally, I'm still frustrated by the complexity of the current
>>> > proposal, but I don't want to block it just because of my frustration.
>>>
>>> Is this a case of "there must be a simpler way", or did you actually
>>> propose a simpler way?  I don't remember...
>>>
>>
>> I did propose a simpler way at
>> 20210810195053.6vsjadglrexf6jwy@habkost.net/">https://lore.kernel.org/qemu-devel/20210810195053.6vsjadglrexf6jwy@habkost.net/
>

Hi. Sorry for the late response to that.

Also sorry for possible technical email header errors in my reply mail, as I was switching the e-mail accounts that I use to
communicate with this maillist, so hope technically all went well.

>Valeriy, would the simpler way still work for you?
>
>If no, please explain why.  If you already did, just provide a pointer.
>
Yes, I remember your proposal of using just 5 lines of code. To be exact here are
those proposed lines:

>>    for start in (0, 0x40000000, 0x80000000, 0xC0000000):
>>        leaf = query_cpuid(qom_path, start)
>>        for eax in range(start, leaf.max_eax + 1):
>>            for ecx in range(0, leaf.get('max_ecx', 0) + 1):
>>                all_leaves.append(query_cpuid(qom_path, eax, ecx))


It looks cool and short, but this is only a pseudocode with not only variable declarations omitted, but
with some logic omitted as well. It does not become obvious until you start typing the code and then review it.
In fact the patch, to which you have done this suggestion back then already had the same concept at it's basis, but
it has grown quickly to somewhat more complex code than it's conceptual pseudo-brother above.

I'm sure that this current patch (which is the most recent in v15 email) is the most simple and shortest of possible.
This is iteration 3 patch, with first iteration being the one to which you've made that suggestion, but then we also tried one
more version by trying to do this via KVM ioctls, but it did not work quite smooth. So this last iteration at which we are currently
looking at is really the product of thought and is the simplest.

I suggest that we stick to it and start converging towards it's submission instead of going to another round of coding and discussion.
v15 - is the result of fine-tunes and rebases, that has already covered a lot of comments. Please let's review it to the end and give it a go.


>If yes, we need to choose between the complex solution we have and the
>simpler solution we still need to code up.  The latter is extra work,
>but having to carry more complex code is going to be extra work, too.

I agree to the idea that we MUST minimize support effort in priority to the commiting effort, but here I do not see direct dependency
between the two. This is already the simplest solution. All the code we have here is mostly
to service the QMP machinery, which has to be in any version of the patch. The payload code is minimal.

Thanks.


  reply	other threads:[~2021-09-03  9:33 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-28 12:54 [PATCH v12] qapi: introduce 'query-x86-cpuid' QMP command Valeriy Vdovin
2021-07-28 13:25 ` [PATCH-for-6.2 " Philippe Mathieu-Daudé
2021-07-28 13:25   ` Philippe Mathieu-Daudé
2021-08-07 14:22 ` [PATCH " Markus Armbruster
2021-08-07 14:22   ` Markus Armbruster
2021-08-10 18:56   ` Eduardo Habkost
2021-08-10 18:56     ` Eduardo Habkost
2021-08-11  6:09     ` Thomas Huth
2021-08-11  6:09       ` Thomas Huth
2021-08-11 13:40       ` Eduardo Habkost
2021-08-11 13:40         ` Eduardo Habkost
2021-08-11 13:44         ` Thomas Huth
2021-08-11 13:44           ` Thomas Huth
2021-08-11 13:58           ` Eduardo Habkost
2021-08-11 13:58             ` Eduardo Habkost
2021-08-23 13:35             ` Markus Armbruster
2021-08-23 13:35               ` Markus Armbruster
2021-08-23 15:55               ` Eduardo Habkost
2021-08-23 15:55                 ` Eduardo Habkost
2021-08-24  6:48                 ` Markus Armbruster
2021-08-24  6:48                   ` Markus Armbruster
2021-09-03  9:33                   ` Valeriy Vdovin [this message]
2021-09-03  9:33                     ` Valeriy Vdovin

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=20210903093325.GA26525@zombie \
    --to=valery.vdovin.s@gmail.com \
    --cc=armbru@redhat.com \
    --cc=den@openvz.org \
    --cc=eblake@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=lvivier@redhat.com \
    --cc=marcel.apfelbaum@gmail.com \
    --cc=mtosatti@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=thuth@redhat.com \
    --cc=vsementsov@virtuozzo.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 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.