From: Eduardo Habkost <ehabkost@redhat.com>
To: Michael Mueller <mimu@linux.vnet.ibm.com>
Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org,
linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org,
Gleb Natapov <gleb@kernel.org>, Alexander Graf <agraf@suse.de>,
Christian Borntraeger <borntraeger@de.ibm.com>,
"Jason J. Herne" <jjherne@linux.vnet.ibm.com>,
Cornelia Huck <cornelia.huck@de.ibm.com>,
Paolo Bonzini <pbonzini@redhat.com>,
Andreas Faerber <afaerber@suse.de>,
Richard Henderson <rth@twiddle.net>
Subject: Re: [PATCH v3 14/16] target-s390x: Extend QMP command query-cpu-definitions
Date: Mon, 2 Mar 2015 16:11:00 -0300 [thread overview]
Message-ID: <20150302191100.GJ3513@thinpad.lan.raisama.net> (raw)
In-Reply-To: <1425300248-40277-15-git-send-email-mimu@linux.vnet.ibm.com>
On Mon, Mar 02, 2015 at 01:44:06PM +0100, Michael Mueller wrote:
> This patch implements the QMP command 'query-cpu-definitions' in the S390
> context. The command returns a list of cpu model names in the current host
> context. A consumer may successfully request each listed cpu model as long
> for a given accelerator this model is runnable.
>
> The QMP type AccelCpuModelInfo is introduced and the type CpuDefinitionInfo
> is extended by the optional field 'accelerators'. It contains a list of named
> accelerators and some indication whether the associated cpu model is runnable
> or the default cpu model. The default cpu model is used if either no specific
> cpu model is requested during QEMU startup or if the cpu model with name
> 'host' is requested.
>
> request:
> {"execute": "query-cpu-definitions"}
>
> answer:
> {"return":
> [{"name":"2964-ga1","accelerators":[{"name":"kvm","runnable":false,"default":false}]},
> {"name":"2828-ga1","accelerators":[{"name":"kvm","runnable":false,"default":false}]},
> {"name":"2827-ga2","accelerators":[{"name":"kvm","runnable":true,"default":true}]},
> {"name":"2827-ga1","accelerators":[{"name":"kvm","runnable":true,"default":false}]},
> {"name":"2818-ga1","accelerators":[{"name":"kvm","runnable":true,"default":false}]},
> ...
> {"name":"2064-ga1","accelerators":[{"runnable":true,"name":"kvm","default":false}]}
> ]
> }
On x86, being runnable or not is something that depends on the
machine-type. I expect that to happen in other machines as soon as they
start implementing backwards compatiblity.
I see two options to implement that: 1) adding a "machine-type" argument
to query-cpu-definitions; 2) returning a machine-type-based dictionary
on the "runnable" property. The former sounds better to me as it won't
require enumerating all machine-types every time.
In that case, why we do need to enumerate all accelerators on every
query, either? We could have both "machine-type" and "accel" arguments
to query-cpu-definitions, so callers will just ask for the
acceleratores/machine-types they are interested into.
e.g.:
request:
{"execute": "query-cpu-definitions",
"arguments": {"machine":"s390-virtio", "accel":"kvm"}}
answer:
{"return":
[{"name":"2964-ga1","runnable":true},
{"name":"2828-ga1","runnable":false}
...
]
}
We can also extend this to other variables, such as extra CPU flags that
could make the CPU runnable or not. e.g.: want to know if "-machine
foo,accel=bar -cpu xxx,+yyy,-zzz" is runnable? Send this request:
{"execute": "query-cpu-definitions",
"arguments": {"machine":"s390-virtio", "accel":"kvm", "cpu":"xxx,+yyy,-zzz"}}
and get this response:
{"return": [{"name":"xxx","runnable":false}]}
or maybe being more explicit in the response about the extra CPU flags:
{"return": [{"name":"xxx,+yyy,-zzz","runnable":false}]}
> {"execute": "query-cpu-definitions"}
>
> answer:
> {"return":
> [{"name":"2964-ga1","accelerators":[{"name":"kvm","runnable":false,"default":false}]},
> {"name":"2828-ga1","accelerators":[{"name":"kvm","runnable":false,"default":false}]},
> {"name":"2827-ga2","accelerators":[{"name":"kvm","runnable":true,"default":true}]},
> {"name":"2827-ga1","accelerators":[{"name":"kvm","runnable":true,"default":false}]},
> {"name":"2818-ga1","accelerators":[{"name":"kvm","runnable":true,"default":false}]},
>
> Signed-off-by: Michael Mueller <mimu@linux.vnet.ibm.com>
> [...]
--
Eduardo
next prev parent reply other threads:[~2015-03-02 19:11 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-02 12:43 [PATCH v3 00/16] s390x cpu model implementation Michael Mueller
2015-03-02 12:43 ` [PATCH v3 01/16] Introduce probe mode for machine type none Michael Mueller
2015-03-02 13:57 ` Andreas Färber
2015-03-02 16:43 ` [Qemu-devel] " Michael Mueller
2015-03-02 16:57 ` Andreas Färber
2015-03-03 10:55 ` Michael Mueller
2015-03-04 19:19 ` Eduardo Habkost
2015-03-05 14:56 ` Michael Mueller
2015-03-05 15:07 ` Eduardo Habkost
2015-03-02 19:17 ` Eduardo Habkost
2015-03-03 10:23 ` Michael Mueller
2015-03-02 12:43 ` [PATCH v3 02/16] Introduce option --probe to switch into probe mode Michael Mueller
2015-03-02 12:43 ` [PATCH v3 03/16] Introduce stub routine cpu_desc_avail Michael Mueller
2015-03-02 12:43 ` [PATCH v3 04/16] target-s390x: Introduce cpu facilities Michael Mueller
2015-03-02 12:43 ` [PATCH v3 05/16] target-s390x: Generate facility defines per cpu model Michael Mueller
2015-03-02 12:43 ` [PATCH v3 06/16] target-s390x: Introduce cpu models Michael Mueller
2015-03-02 12:43 ` [PATCH v3 07/16] target-s390x: Define cpu model specific facility lists Michael Mueller
2015-03-02 12:44 ` [PATCH v3 08/16] target-s390x: Add cpu model alias definition routines Michael Mueller
2015-03-02 12:44 ` [PATCH v3 09/16] target-s390x: Update linux-headers/asm-s390/kvm.h Michael Mueller
2015-03-02 12:44 ` [PATCH v3 10/16] target-s390x: Add KVM VM attribute interface for cpu models Michael Mueller
2015-03-02 12:44 ` [PATCH v3 11/16] target-s390x: Add cpu class initialization routines Michael Mueller
2015-03-02 12:44 ` [PATCH v3 12/16] target-s390x: Prepare accelerator during cpu object realization Michael Mueller
2015-03-02 12:44 ` [PATCH v3 13/16] target-s390x: New QMP command query-cpu-model Michael Mueller
2015-03-02 12:44 ` [PATCH v3 14/16] target-s390x: Extend QMP command query-cpu-definitions Michael Mueller
2015-03-02 19:11 ` Eduardo Habkost [this message]
2015-03-04 9:00 ` [Qemu-devel] " Michael Mueller
2015-03-02 12:44 ` [PATCH v3 15/16] target-s390x: Introduce facility test routine Michael Mueller
2015-03-02 12:44 ` [PATCH v3 16/16] target-s390x: Enable cpu model usage Michael Mueller
2015-03-02 19:25 ` [PATCH v3 00/16] s390x cpu model implementation 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=20150302191100.GJ3513@thinpad.lan.raisama.net \
--to=ehabkost@redhat.com \
--cc=afaerber@suse.de \
--cc=agraf@suse.de \
--cc=borntraeger@de.ibm.com \
--cc=cornelia.huck@de.ibm.com \
--cc=gleb@kernel.org \
--cc=jjherne@linux.vnet.ibm.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=mimu@linux.vnet.ibm.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--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