All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: Eduardo Habkost <ehabkost@redhat.com>
Cc: qemu-devel@nongnu.org, David Hildenbrand <david@redhat.com>,
	libvir-list@redhat.com,
	Christian Borntraeger <borntraeger@de.ibm.com>,
	"Jason J. Herne" <jjherne@linux.vnet.ibm.com>,
	Cornelia Huck <cornelia.huck@de.ibm.com>,
	Jiri Denemark <jdenemar@redhat.com>
Subject: Re: [Qemu-devel] [PATCH for-2.9 14/17] qapi: add static/migration-safe info to query-cpu-model-expansion
Date: Tue, 13 Dec 2016 10:47:38 +0100	[thread overview]
Message-ID: <87lgvkrwhx.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <1480713496-11213-15-git-send-email-ehabkost@redhat.com> (Eduardo Habkost's message of "Fri, 2 Dec 2016 19:18:13 -0200")

I'm not familiar with CPU model expansion, but here goes anyway.

Eduardo Habkost <ehabkost@redhat.com> writes:

> On x86, "-cpu host" enables some features that can't be
> represented by a static CPU model definition: cache info
> passthrough ("host-cache-info") and PMU passthrough ("pmu"). This
> means a type=static expansion of "host" can't include those
> features.
>
> A type=full expansion of "host", on the other hand, can include
> those features, but then the returned data won't be a static CPU
> model representation.
>
> Add a note to the documentation explaining that when using CPU
> models that include non-migration-safe features, users need to
> choose being precision and safety: a precise expansion of the CPU

s/being/between/

> model (full) won't be safe (static), (because they would include

s/they/it/

> pmu=on and host-cache-info=on), and a safe (static) expansion of
> the CPU model won't be precise.
>
> Architectures where CPU model expansion is always migration-safe
> (e.g. s390x) can simply do what they already do, and set
> 'migration-safe' and 'static' to true.

This patch does that exactly for s390x.  The next patch looks like it
does something for x86.  What about other targets?  I recommend to have
this commit message explain briefly what this patch does, what later
patches in this series do, and what's left for later (if anything).

> Cc: Cornelia Huck <cornelia.huck@de.ibm.com>
> Cc: Christian Borntraeger <borntraeger@de.ibm.com>
> Cc: David Hildenbrand <david@redhat.com>
> Cc: libvir-list@redhat.com
> Cc: Jiri Denemark <jdenemar@redhat.com>
> Cc: "Jason J. Herne" <jjherne@linux.vnet.ibm.com>
> Cc: Markus Armbruster <armbru@redhat.com>
> Cc: Eric Blake <eblake@redhat.com>
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
> ---
>  qapi-schema.json          | 25 ++++++++++++++++++++++++-
>  target-s390x/cpu_models.c |  4 ++++
>  2 files changed, 28 insertions(+), 1 deletion(-)
>
> diff --git a/qapi-schema.json b/qapi-schema.json
> index 8d113f8..a102534 100644
> --- a/qapi-schema.json
> +++ b/qapi-schema.json
> @@ -3291,6 +3291,15 @@
>  #        migration-safe, but allows tooling to get an insight and work with
>  #        model details.
>  #
> +# Note: When a non-migration-safe CPU model is expanded in static mode, some
> +# features enabled by the CPU model may be omitted, because they can't be
> +# implemented by a static CPU model definition (e.g. cache info passthrough and
> +# PMU passthrough in x86). If you need an accurate representation of the
> +# features enabled by a non-migration-safe CPU model, use @full. If you need a
> +# static representation that will keep ABI compatibility even when changing QEMU
> +# version or machine-type, use @static (but keep in mind that some features may
> +# be omitted).
> +#
>  # Since: 2.8.0
>  ##
>  { 'enum': 'CpuModelExpansionType',
> @@ -3304,10 +3313,24 @@
>  #
>  # @model: the expanded CpuModelInfo.
>  #
> +# @migration-safe: the expanded CPU model in @model is a migration-safe
> +#                  CPU model. See @CpuDefinitionInfo.migration-safe.
> +#                  If expansion type was @static, this is always true.
> +#                  (since 2.9)
> +#
> +# @static: the expanded CPU model in @model is a static CPU model.
> +#          See @CpuDefinitionInfo.static. If expansion type was @static,
> +#          this is always true.
> +#          (since 2.9)
> +#
> +# query-cpu-model-expansion with static expansion type should always
> +# return a static and migration-safe expansion.
> +#
>  # Since: 2.8.0
>  ##
>  { 'struct': 'CpuModelExpansionInfo',
> -  'data': { 'model': 'CpuModelInfo' } }
> +  'data': { 'model': 'CpuModelInfo', 'static': 'bool',
> +            'migration-safe': 'bool' } }
>  
>  
>  ##
> diff --git a/target-s390x/cpu_models.c b/target-s390x/cpu_models.c
> index 5b66d33..f934add 100644
> --- a/target-s390x/cpu_models.c
> +++ b/target-s390x/cpu_models.c
> @@ -448,6 +448,10 @@ CpuModelExpansionInfo *arch_query_cpu_model_expansion(CpuModelExpansionType type
>      /* convert it back to a static representation */
>      expansion_info = g_malloc0(sizeof(*expansion_info));
>      expansion_info->model = g_malloc0(sizeof(*expansion_info->model));
> +
> +    /* We always expand to a static and migration-safe CpuModelInfo */
> +    expansion_info->q_static = true;
> +    expansion_info->migration_safe = true;
>      cpu_info_from_model(expansion_info->model, &s390_model, delta_changes);
>      return expansion_info;
>  }

  reply	other threads:[~2016-12-13  9:47 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-02 21:17 [Qemu-devel] [PATCH for-2.9 00/17] target-i386: Implement query-cpu-model-expansion Eduardo Habkost
2016-12-02 21:18 ` [Qemu-devel] [PATCH for-2.9 01/17] qmp: Report QOM type name on query-cpu-definitions Eduardo Habkost
2016-12-02 21:18 ` [Qemu-devel] [PATCH for-2.9 02/17] qemu.py: Make logging optional Eduardo Habkost
2016-12-02 21:18 ` [Qemu-devel] [PATCH for-2.9 03/17] qtest.py: Support QTEST_LOG environment variable Eduardo Habkost
2016-12-02 21:18 ` [Qemu-devel] [PATCH for-2.9 04/17] qtest.py: make logging optional Eduardo Habkost
2016-12-02 21:18 ` [Qemu-devel] [PATCH for-2.9 05/17] qtest.py: Make 'binary' parameter optional Eduardo Habkost
2016-12-02 21:18 ` [Qemu-devel] [PATCH for-2.9 06/17] tests: Add rules to non-gtester qtest test cases Eduardo Habkost
2016-12-02 21:18 ` [Qemu-devel] [PATCH for-2.9 07/17] target-i386: Reorganize and document CPUID initialization steps Eduardo Habkost
2016-12-02 21:18 ` [Qemu-devel] [PATCH for-2.9 08/17] target-i386: Support "-cpu host" on TCG too Eduardo Habkost
2016-12-02 21:18 ` [Qemu-devel] [PATCH for-2.9 09/17] target-i386: Move "host" properties to base class Eduardo Habkost
2016-12-02 21:18 ` [Qemu-devel] [PATCH for-2.9 10/17] target-i386: Allow short strings to be used as vendor ID Eduardo Habkost
2016-12-02 21:18 ` [Qemu-devel] [PATCH for-2.9 11/17] target-i386: Remove AMD feature flag aliases from Opteron models Eduardo Habkost
2016-12-02 21:18 ` [Qemu-devel] [PATCH for-2.9 12/17] target-i386: Return migration-safe field on query-cpu-definitions Eduardo Habkost
2016-12-02 21:18 ` [Qemu-devel] [PATCH for-2.9 13/17] cpu: Support comma escaping when parsing -cpu Eduardo Habkost
2016-12-02 21:18 ` [Qemu-devel] [PATCH for-2.9 14/17] qapi: add static/migration-safe info to query-cpu-model-expansion Eduardo Habkost
2016-12-13  9:47   ` Markus Armbruster [this message]
2016-12-13 12:46     ` Eduardo Habkost
2016-12-02 21:18 ` [Qemu-devel] [PATCH for-2.9 15/17] target-i386: Define static "base" CPU model Eduardo Habkost
2016-12-05 18:18   ` David Hildenbrand
2016-12-05 23:57     ` Eduardo Habkost
2016-12-06  9:32       ` David Hildenbrand
2016-12-06 12:43         ` Eduardo Habkost
2016-12-16 16:02       ` Jiri Denemark
2016-12-20 16:49         ` David Hildenbrand
2016-12-02 21:18 ` [Qemu-devel] [PATCH for-2.9 16/17] tests: query-cpu-model-test.py test code Eduardo Habkost
2016-12-02 21:18 ` [Qemu-devel] [PATCH for-2.9 17/17] target-i386: Implement query-cpu-model-expansion QMP command Eduardo Habkost
2016-12-13 10:16   ` Markus Armbruster
2016-12-13 12:55     ` Eduardo Habkost
2016-12-13 19:20       ` Markus Armbruster
2016-12-13 21:11         ` Eduardo Habkost
2016-12-05  9:09 ` [Qemu-devel] [libvirt] [PATCH for-2.9 00/17] target-i386: Implement query-cpu-model-expansion no-reply
2016-12-05 15:15 ` [Qemu-devel] " David Hildenbrand
2016-12-05 17:11   ` Eduardo Habkost
2016-12-05 18:13     ` David Hildenbrand
2016-12-05 23:45       ` 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=87lgvkrwhx.fsf@dusky.pond.sub.org \
    --to=armbru@redhat.com \
    --cc=borntraeger@de.ibm.com \
    --cc=cornelia.huck@de.ibm.com \
    --cc=david@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=jdenemar@redhat.com \
    --cc=jjherne@linux.vnet.ibm.com \
    --cc=libvir-list@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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.