kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Valeriy Vdovin <valeriy.vdovin@virtuozzo.com>
To: qemu-devel@nongnu.org
Cc: Eduardo Habkost <ehabkost@redhat.com>,
	Marcel Apfelbaum <marcel.apfelbaum@gmail.com>,
	Eric Blake <eblake@redhat.com>,
	Markus Armbruster <armbru@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Marcelo Tosatti <mtosatti@redhat.com>,
	Richard Henderson <richard.henderson@linaro.org>,
	Thomas Huth <thuth@redhat.com>,
	Laurent Vivier <lvivier@redhat.com>,
	kvm@vger.kernel.org, Denis Lunev <den@openvz.org>,
	Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>,
	Valeriy Vdovin <valeriy.vdovin@virtuozzo.com>
Subject: [PATCH v7 0/1] qapi: introduce 'query-cpu-model-cpuid' action
Date: Tue,  4 May 2021 15:26:38 +0300	[thread overview]
Message-ID: <20210504122639.18342-1-valeriy.vdovin@virtuozzo.com> (raw)

In version 7 of the subject patch, I wanted to try to implement this qmp
method with the help of existing kvm ioctl KVM_GET_CPUID2. The reasoning
behind my decision is the fact that QEMU uses KVM_SET_CPUID2 to set full
cpuid response table to the virtual cpu, and KVM_GET_CPUID2 is a convenient
and complementary method for extracting the same cpuid entry table back
from the kernel.

So I've pushed a patch into Linux KVM subtree to fine tune ioctl
KVM_GET_CPUID2 for this type of application. This has triggered a small
discussion.
One of the responses here https://lkml.org/lkml/2021/5/4/109 is from
Paolo Bonzini. There he suggests to cache the the whole cpuid entries
table that we pass to the kernel via KVM_SET_CPUID2 and later just output
this cached data instead of calling the same table via KVM_GET_CPUID2.
Current patch is the reflection of that idea.

Valeriy Vdovin (1):
  qapi: introduce 'query-cpu-model-cpuid' action

 qapi/machine-target.json   | 51 ++++++++++++++++++++++++++++++++++++++
 target/i386/kvm/kvm.c      | 45 ++++++++++++++++++++++++++++++---
 tests/qtest/qmp-cmd-test.c |  1 +
 3 files changed, 93 insertions(+), 4 deletions(-)

-- 
2.17.1


             reply	other threads:[~2021-05-04 12:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-04 12:26 Valeriy Vdovin [this message]
2021-05-04 12:26 ` [PATCH v7 1/1] qapi: introduce 'query-cpu-model-cpuid' action Valeriy Vdovin
2021-05-26 21:44   ` Eduardo Habkost
2021-05-31 12:16     ` 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=20210504122639.18342-1-valeriy.vdovin@virtuozzo.com \
    --to=valeriy.vdovin@virtuozzo.com \
    --cc=armbru@redhat.com \
    --cc=den@openvz.org \
    --cc=eblake@redhat.com \
    --cc=ehabkost@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 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).