* [PATCH v3 1/3] qapi: Moved architecture agnostic data types to `machine`
2023-07-30 6:40 [PATCH v3 0/3] Enable -cpu <cpu>,help Dinah Baum
@ 2023-07-30 6:40 ` Dinah Baum
2023-07-31 9:54 ` Philippe Mathieu-Daudé
2023-08-01 13:09 ` Markus Armbruster
2023-07-30 6:40 ` [PATCH v3 2/3] qapi, target/: Enable 'query-cpu-model-expansion' on all architectures Dinah Baum
` (2 subsequent siblings)
3 siblings, 2 replies; 17+ messages in thread
From: Dinah Baum @ 2023-07-30 6:40 UTC (permalink / raw)
To: qemu-devel
Cc: Dinah Baum, Eric Blake, Markus Armbruster, Eduardo Habkost,
Marcel Apfelbaum, Philippe Mathieu-Daudé, Yanan Wang
Signed-off-by: Dinah Baum <dinahbaum123@gmail.com>
---
qapi/machine-target.json | 78 +---------------------------------------
qapi/machine.json | 77 +++++++++++++++++++++++++++++++++++++++
2 files changed, 78 insertions(+), 77 deletions(-)
diff --git a/qapi/machine-target.json b/qapi/machine-target.json
index f0a6b72414..3ee2f7ca6b 100644
--- a/qapi/machine-target.json
+++ b/qapi/machine-target.json
@@ -4,83 +4,7 @@
# This work is licensed under the terms of the GNU GPL, version 2 or later.
# See the COPYING file in the top-level directory.
-##
-# @CpuModelInfo:
-#
-# Virtual CPU model.
-#
-# A CPU model consists of the name of a CPU definition, to which delta
-# changes are applied (e.g. features added/removed). Most magic values
-# that an architecture might require should be hidden behind the name.
-# However, if required, architectures can expose relevant properties.
-#
-# @name: the name of the CPU definition the model is based on
-#
-# @props: a dictionary of QOM properties to be applied
-#
-# Since: 2.8
-##
-{ 'struct': 'CpuModelInfo',
- 'data': { 'name': 'str',
- '*props': 'any' } }
-
-##
-# @CpuModelExpansionType:
-#
-# An enumeration of CPU model expansion types.
-#
-# @static: Expand to a static CPU model, a combination of a static
-# base model name and property delta changes. As the static base
-# model will never change, the expanded CPU model will be the
-# same, independent of QEMU version, machine type, machine
-# options, and accelerator options. Therefore, the resulting
-# model can be used by tooling without having to specify a
-# compatibility machine - e.g. when displaying the "host" model.
-# The @static CPU models are migration-safe.
-#
-# @full: Expand all properties. The produced model is not guaranteed
-# to be 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
-##
-{ 'enum': 'CpuModelExpansionType',
- 'data': [ 'static', 'full' ] }
-
-##
-# @CpuModelCompareResult:
-#
-# An enumeration of CPU model comparison results. The result is
-# usually calculated using e.g. CPU features or CPU generations.
-#
-# @incompatible: If model A is incompatible to model B, model A is not
-# guaranteed to run where model B runs and the other way around.
-#
-# @identical: If model A is identical to model B, model A is
-# guaranteed to run where model B runs and the other way around.
-#
-# @superset: If model A is a superset of model B, model B is
-# guaranteed to run where model A runs. There are no guarantees
-# about the other way.
-#
-# @subset: If model A is a subset of model B, model A is guaranteed to
-# run where model B runs. There are no guarantees about the other
-# way.
-#
-# Since: 2.8
-##
-{ 'enum': 'CpuModelCompareResult',
- 'data': [ 'incompatible', 'identical', 'superset', 'subset' ] }
+{ 'include': 'machine.json' }
##
# @CpuModelBaselineInfo:
diff --git a/qapi/machine.json b/qapi/machine.json
index a08b6576ca..192c781310 100644
--- a/qapi/machine.json
+++ b/qapi/machine.json
@@ -1691,3 +1691,80 @@
{ 'command': 'dumpdtb',
'data': { 'filename': 'str' },
'if': 'CONFIG_FDT' }
+
+##
+# @CpuModelInfo:
+#
+# Virtual CPU model.
+#
+# A CPU model consists of the name of a CPU definition, to which delta
+# changes are applied (e.g. features added/removed). Most magic values
+# that an architecture might require should be hidden behind the name.
+# However, if required, architectures can expose relevant properties.
+#
+# @name: the name of the CPU definition the model is based on
+#
+# @props: a dictionary of QOM properties to be applied
+#
+# Since: 2.8
+##
+{ 'struct': 'CpuModelInfo',
+ 'data': { 'name': 'str', '*props': 'any' } }
+
+##
+# @CpuModelExpansionType:
+#
+# An enumeration of CPU model expansion types.
+#
+# @static: Expand to a static CPU model, a combination of a static
+# base model name and property delta changes. As the static base
+# model will never change, the expanded CPU model will be the
+# same, independent of QEMU version, machine type, machine
+# options, and accelerator options. Therefore, the resulting
+# model can be used by tooling without having to specify a
+# compatibility machine - e.g. when displaying the "host" model.
+# The @static CPU models are migration-safe.
+#
+# @full: Expand all properties. The produced model is not guaranteed
+# to be 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
+##
+{ 'enum': 'CpuModelExpansionType',
+ 'data': [ 'static', 'full' ] }
+
+##
+# @CpuModelCompareResult:
+#
+# An enumeration of CPU model comparison results. The result is
+# usually calculated using e.g. CPU features or CPU generations.
+#
+# @incompatible: If model A is incompatible to model B, model A is not
+# guaranteed to run where model B runs and the other way around.
+#
+# @identical: If model A is identical to model B, model A is
+# guaranteed to run where model B runs and the other way around.
+#
+# @superset: If model A is a superset of model B, model B is
+# guaranteed to run where model A runs. There are no guarantees
+# about the other way.
+#
+# @subset: If model A is a subset of model B, model A is guaranteed to
+# run where model B runs. There are no guarantees about the other
+# way.
+#
+# Since: 2.8
+##
+{ 'enum': 'CpuModelCompareResult',
+ 'data': [ 'incompatible', 'identical', 'superset', 'subset' ] }
--
2.30.2
^ permalink raw reply related [flat|nested] 17+ messages in thread
* Re: [PATCH v3 1/3] qapi: Moved architecture agnostic data types to `machine`
2023-07-30 6:40 ` [PATCH v3 1/3] qapi: Moved architecture agnostic data types to `machine` Dinah Baum
@ 2023-07-31 9:54 ` Philippe Mathieu-Daudé
2023-08-01 13:09 ` Markus Armbruster
1 sibling, 0 replies; 17+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-07-31 9:54 UTC (permalink / raw)
To: Dinah Baum, qemu-devel
Cc: Eric Blake, Markus Armbruster, Eduardo Habkost, Marcel Apfelbaum,
Yanan Wang
On 30/7/23 08:40, Dinah Baum wrote:
> Signed-off-by: Dinah Baum <dinahbaum123@gmail.com>
> ---
> qapi/machine-target.json | 78 +---------------------------------------
> qapi/machine.json | 77 +++++++++++++++++++++++++++++++++++++++
> 2 files changed, 78 insertions(+), 77 deletions(-)
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v3 1/3] qapi: Moved architecture agnostic data types to `machine`
2023-07-30 6:40 ` [PATCH v3 1/3] qapi: Moved architecture agnostic data types to `machine` Dinah Baum
2023-07-31 9:54 ` Philippe Mathieu-Daudé
@ 2023-08-01 13:09 ` Markus Armbruster
2023-11-01 2:24 ` Dinah B
1 sibling, 1 reply; 17+ messages in thread
From: Markus Armbruster @ 2023-08-01 13:09 UTC (permalink / raw)
To: Dinah Baum
Cc: qemu-devel, Eric Blake, Eduardo Habkost, Marcel Apfelbaum,
Philippe Mathieu-Daudé, Yanan Wang
Dinah Baum <dinahbaum123@gmail.com> writes:
> Signed-off-by: Dinah Baum <dinahbaum123@gmail.com>
> ---
> qapi/machine-target.json | 78 +---------------------------------------
> qapi/machine.json | 77 +++++++++++++++++++++++++++++++++++++++
> 2 files changed, 78 insertions(+), 77 deletions(-)
>
> diff --git a/qapi/machine-target.json b/qapi/machine-target.json
> index f0a6b72414..3ee2f7ca6b 100644
> --- a/qapi/machine-target.json
> +++ b/qapi/machine-target.json
> @@ -4,83 +4,7 @@
> # This work is licensed under the terms of the GNU GPL, version 2 or later.
> # See the COPYING file in the top-level directory.
>
> -##
> -# @CpuModelInfo:
> -#
> -# Virtual CPU model.
> -#
> -# A CPU model consists of the name of a CPU definition, to which delta
> -# changes are applied (e.g. features added/removed). Most magic values
> -# that an architecture might require should be hidden behind the name.
> -# However, if required, architectures can expose relevant properties.
> -#
> -# @name: the name of the CPU definition the model is based on
> -#
> -# @props: a dictionary of QOM properties to be applied
> -#
> -# Since: 2.8
> -##
> -{ 'struct': 'CpuModelInfo',
> - 'data': { 'name': 'str',
> - '*props': 'any' } }
> -
> -##
> -# @CpuModelExpansionType:
> -#
> -# An enumeration of CPU model expansion types.
> -#
> -# @static: Expand to a static CPU model, a combination of a static
> -# base model name and property delta changes. As the static base
> -# model will never change, the expanded CPU model will be the
> -# same, independent of QEMU version, machine type, machine
> -# options, and accelerator options. Therefore, the resulting
> -# model can be used by tooling without having to specify a
> -# compatibility machine - e.g. when displaying the "host" model.
> -# The @static CPU models are migration-safe.
> -#
> -# @full: Expand all properties. The produced model is not guaranteed
> -# to be 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
> -##
> -{ 'enum': 'CpuModelExpansionType',
> - 'data': [ 'static', 'full' ] }
> -
> -##
> -# @CpuModelCompareResult:
> -#
> -# An enumeration of CPU model comparison results. The result is
> -# usually calculated using e.g. CPU features or CPU generations.
> -#
> -# @incompatible: If model A is incompatible to model B, model A is not
> -# guaranteed to run where model B runs and the other way around.
> -#
> -# @identical: If model A is identical to model B, model A is
> -# guaranteed to run where model B runs and the other way around.
> -#
> -# @superset: If model A is a superset of model B, model B is
> -# guaranteed to run where model A runs. There are no guarantees
> -# about the other way.
> -#
> -# @subset: If model A is a subset of model B, model A is guaranteed to
> -# run where model B runs. There are no guarantees about the other
> -# way.
> -#
> -# Since: 2.8
> -##
> -{ 'enum': 'CpuModelCompareResult',
> - 'data': [ 'incompatible', 'identical', 'superset', 'subset' ] }
> +{ 'include': 'machine.json' }
>
> ##
> # @CpuModelBaselineInfo:
> diff --git a/qapi/machine.json b/qapi/machine.json
> index a08b6576ca..192c781310 100644
> --- a/qapi/machine.json
> +++ b/qapi/machine.json
> @@ -1691,3 +1691,80 @@
> { 'command': 'dumpdtb',
> 'data': { 'filename': 'str' },
> 'if': 'CONFIG_FDT' }
> +
> +##
> +# @CpuModelInfo:
> +#
> +# Virtual CPU model.
> +#
> +# A CPU model consists of the name of a CPU definition, to which delta
> +# changes are applied (e.g. features added/removed). Most magic values
> +# that an architecture might require should be hidden behind the name.
> +# However, if required, architectures can expose relevant properties.
> +#
> +# @name: the name of the CPU definition the model is based on
> +#
> +# @props: a dictionary of QOM properties to be applied
> +#
> +# Since: 2.8
> +##
> +{ 'struct': 'CpuModelInfo',
> + 'data': { 'name': 'str', '*props': 'any' } }
> +
> +##
> +# @CpuModelExpansionType:
> +#
> +# An enumeration of CPU model expansion types.
> +#
> +# @static: Expand to a static CPU model, a combination of a static
> +# base model name and property delta changes. As the static base
> +# model will never change, the expanded CPU model will be the
> +# same, independent of QEMU version, machine type, machine
> +# options, and accelerator options. Therefore, the resulting
> +# model can be used by tooling without having to specify a
> +# compatibility machine - e.g. when displaying the "host" model.
> +# The @static CPU models are migration-safe.
> +#
> +# @full: Expand all properties. The produced model is not guaranteed
> +# to be 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
> +##
> +{ 'enum': 'CpuModelExpansionType',
> + 'data': [ 'static', 'full' ] }
> +
> +##
> +# @CpuModelCompareResult:
> +#
> +# An enumeration of CPU model comparison results. The result is
> +# usually calculated using e.g. CPU features or CPU generations.
Single space after e.g., please.
> +#
> +# @incompatible: If model A is incompatible to model B, model A is not
> +# guaranteed to run where model B runs and the other way around.
> +#
> +# @identical: If model A is identical to model B, model A is
> +# guaranteed to run where model B runs and the other way around.
> +#
> +# @superset: If model A is a superset of model B, model B is
> +# guaranteed to run where model A runs. There are no guarantees
> +# about the other way.
> +#
> +# @subset: If model A is a subset of model B, model A is guaranteed to
> +# run where model B runs. There are no guarantees about the other
> +# way.
> +#
> +# Since: 2.8
> +##
> +{ 'enum': 'CpuModelCompareResult',
> + 'data': [ 'incompatible', 'identical', 'superset', 'subset' ] }
With that
Reviewed-by: Markus Armbruster <armbru@redhat.com>
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v3 1/3] qapi: Moved architecture agnostic data types to `machine`
2023-08-01 13:09 ` Markus Armbruster
@ 2023-11-01 2:24 ` Dinah B
2023-11-02 6:59 ` Markus Armbruster
0 siblings, 1 reply; 17+ messages in thread
From: Dinah B @ 2023-11-01 2:24 UTC (permalink / raw)
To: Markus Armbruster
Cc: qemu-devel, Eric Blake, Eduardo Habkost, Marcel Apfelbaum,
Philippe Mathieu-Daudé, Yanan Wang
[-- Attachment #1: Type: text/plain, Size: 8116 bytes --]
Hi,
I noticed that qapi now has a machine-common category - do you think these
changes would be more appropriate in that file
rather than "machine" for the revision?
Thanks and sorry for the delay,
-Dinah
On Tue, Aug 1, 2023 at 9:09 AM Markus Armbruster <armbru@redhat.com> wrote:
> Dinah Baum <dinahbaum123@gmail.com> writes:
>
> > Signed-off-by: Dinah Baum <dinahbaum123@gmail.com>
> > ---
> > qapi/machine-target.json | 78 +---------------------------------------
> > qapi/machine.json | 77 +++++++++++++++++++++++++++++++++++++++
> > 2 files changed, 78 insertions(+), 77 deletions(-)
> >
> > diff --git a/qapi/machine-target.json b/qapi/machine-target.json
> > index f0a6b72414..3ee2f7ca6b 100644
> > --- a/qapi/machine-target.json
> > +++ b/qapi/machine-target.json
> > @@ -4,83 +4,7 @@
> > # This work is licensed under the terms of the GNU GPL, version 2 or
> later.
> > # See the COPYING file in the top-level directory.
> >
> > -##
> > -# @CpuModelInfo:
> > -#
> > -# Virtual CPU model.
> > -#
> > -# A CPU model consists of the name of a CPU definition, to which delta
> > -# changes are applied (e.g. features added/removed). Most magic values
> > -# that an architecture might require should be hidden behind the name.
> > -# However, if required, architectures can expose relevant properties.
> > -#
> > -# @name: the name of the CPU definition the model is based on
> > -#
> > -# @props: a dictionary of QOM properties to be applied
> > -#
> > -# Since: 2.8
> > -##
> > -{ 'struct': 'CpuModelInfo',
> > - 'data': { 'name': 'str',
> > - '*props': 'any' } }
> > -
> > -##
> > -# @CpuModelExpansionType:
> > -#
> > -# An enumeration of CPU model expansion types.
> > -#
> > -# @static: Expand to a static CPU model, a combination of a static
> > -# base model name and property delta changes. As the static base
> > -# model will never change, the expanded CPU model will be the
> > -# same, independent of QEMU version, machine type, machine
> > -# options, and accelerator options. Therefore, the resulting
> > -# model can be used by tooling without having to specify a
> > -# compatibility machine - e.g. when displaying the "host" model.
> > -# The @static CPU models are migration-safe.
> > -#
> > -# @full: Expand all properties. The produced model is not guaranteed
> > -# to be 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
> > -##
> > -{ 'enum': 'CpuModelExpansionType',
> > - 'data': [ 'static', 'full' ] }
> > -
> > -##
> > -# @CpuModelCompareResult:
> > -#
> > -# An enumeration of CPU model comparison results. The result is
> > -# usually calculated using e.g. CPU features or CPU generations.
> > -#
> > -# @incompatible: If model A is incompatible to model B, model A is not
> > -# guaranteed to run where model B runs and the other way around.
> > -#
> > -# @identical: If model A is identical to model B, model A is
> > -# guaranteed to run where model B runs and the other way around.
> > -#
> > -# @superset: If model A is a superset of model B, model B is
> > -# guaranteed to run where model A runs. There are no guarantees
> > -# about the other way.
> > -#
> > -# @subset: If model A is a subset of model B, model A is guaranteed to
> > -# run where model B runs. There are no guarantees about the other
> > -# way.
> > -#
> > -# Since: 2.8
> > -##
> > -{ 'enum': 'CpuModelCompareResult',
> > - 'data': [ 'incompatible', 'identical', 'superset', 'subset' ] }
> > +{ 'include': 'machine.json' }
> >
> > ##
> > # @CpuModelBaselineInfo:
> > diff --git a/qapi/machine.json b/qapi/machine.json
> > index a08b6576ca..192c781310 100644
> > --- a/qapi/machine.json
> > +++ b/qapi/machine.json
> > @@ -1691,3 +1691,80 @@
> > { 'command': 'dumpdtb',
> > 'data': { 'filename': 'str' },
> > 'if': 'CONFIG_FDT' }
> > +
> > +##
> > +# @CpuModelInfo:
> > +#
> > +# Virtual CPU model.
> > +#
> > +# A CPU model consists of the name of a CPU definition, to which delta
> > +# changes are applied (e.g. features added/removed). Most magic values
> > +# that an architecture might require should be hidden behind the name.
> > +# However, if required, architectures can expose relevant properties.
> > +#
> > +# @name: the name of the CPU definition the model is based on
> > +#
> > +# @props: a dictionary of QOM properties to be applied
> > +#
> > +# Since: 2.8
> > +##
> > +{ 'struct': 'CpuModelInfo',
> > + 'data': { 'name': 'str', '*props': 'any' } }
> > +
> > +##
> > +# @CpuModelExpansionType:
> > +#
> > +# An enumeration of CPU model expansion types.
> > +#
> > +# @static: Expand to a static CPU model, a combination of a static
> > +# base model name and property delta changes. As the static base
> > +# model will never change, the expanded CPU model will be the
> > +# same, independent of QEMU version, machine type, machine
> > +# options, and accelerator options. Therefore, the resulting
> > +# model can be used by tooling without having to specify a
> > +# compatibility machine - e.g. when displaying the "host" model.
> > +# The @static CPU models are migration-safe.
> > +#
> > +# @full: Expand all properties. The produced model is not guaranteed
> > +# to be 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
> > +##
> > +{ 'enum': 'CpuModelExpansionType',
> > + 'data': [ 'static', 'full' ] }
> > +
> > +##
> > +# @CpuModelCompareResult:
> > +#
> > +# An enumeration of CPU model comparison results. The result is
> > +# usually calculated using e.g. CPU features or CPU generations.
>
> Single space after e.g., please.
>
> > +#
> > +# @incompatible: If model A is incompatible to model B, model A is not
> > +# guaranteed to run where model B runs and the other way around.
> > +#
> > +# @identical: If model A is identical to model B, model A is
> > +# guaranteed to run where model B runs and the other way around.
> > +#
> > +# @superset: If model A is a superset of model B, model B is
> > +# guaranteed to run where model A runs. There are no guarantees
> > +# about the other way.
> > +#
> > +# @subset: If model A is a subset of model B, model A is guaranteed to
> > +# run where model B runs. There are no guarantees about the other
> > +# way.
> > +#
> > +# Since: 2.8
> > +##
> > +{ 'enum': 'CpuModelCompareResult',
> > + 'data': [ 'incompatible', 'identical', 'superset', 'subset' ] }
>
> With that
> Reviewed-by: Markus Armbruster <armbru@redhat.com>
>
>
[-- Attachment #2: Type: text/html, Size: 10184 bytes --]
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v3 1/3] qapi: Moved architecture agnostic data types to `machine`
2023-11-01 2:24 ` Dinah B
@ 2023-11-02 6:59 ` Markus Armbruster
0 siblings, 0 replies; 17+ messages in thread
From: Markus Armbruster @ 2023-11-02 6:59 UTC (permalink / raw)
To: Dinah B
Cc: qemu-devel, Eric Blake, Eduardo Habkost, Marcel Apfelbaum,
Philippe Mathieu-Daudé, Yanan Wang
Dinah B <dinahbaum123@gmail.com> writes:
> Hi,
>
> I noticed that qapi now has a machine-common category - do you think these
> changes would be more appropriate in that file
> rather than "machine" for the revision?
You're right.
We created machine-common.json for stuff needed by both machine.json and
machine-target.json. The alternative was to have machine-target.json
include machine.json instead. When we discussed which alternative to
pick, I didn't remember your patch adds the include.
Picking both makes no sense. Please look into adding stuff in a way
that avoids the include.
Thanks for paying attention!
> Thanks and sorry for the delay,
I'm not in a hurry here :)
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH v3 2/3] qapi, target/: Enable 'query-cpu-model-expansion' on all architectures
2023-07-30 6:40 [PATCH v3 0/3] Enable -cpu <cpu>,help Dinah Baum
2023-07-30 6:40 ` [PATCH v3 1/3] qapi: Moved architecture agnostic data types to `machine` Dinah Baum
@ 2023-07-30 6:40 ` Dinah Baum
2023-08-01 13:44 ` Markus Armbruster
2023-07-30 6:40 ` [PATCH v3 3/3] cpu, softmmu/vl.c: Change parsing of -cpu argument to allow -cpu cpu, help to print options for the CPU type similar to how the '-device' option works Dinah Baum
2023-07-30 15:15 ` [PATCH v3 0/3] Enable -cpu <cpu>,help Peter Maydell
3 siblings, 1 reply; 17+ messages in thread
From: Dinah Baum @ 2023-07-30 6:40 UTC (permalink / raw)
To: qemu-devel
Cc: Dinah Baum, Eduardo Habkost, Marcel Apfelbaum,
Philippe Mathieu-Daudé, Yanan Wang, Richard Henderson,
Paolo Bonzini, Eric Blake, Markus Armbruster, Peter Maydell,
David Hildenbrand, Ilya Leoshkevich, Thomas Huth,
open list:ARM TCG CPUs, open list:S390 TCG CPUs
Only architectures that implement the command will return
results, others will return an error message as before.
Signed-off-by: Dinah Baum <dinahbaum123@gmail.com>
---
cpu.c | 20 +++++++++++
include/exec/cpu-common.h | 7 ++++
qapi/machine-target.json | 60 --------------------------------
qapi/machine.json | 53 ++++++++++++++++++++++++++++
target/arm/arm-qmp-cmds.c | 7 ++--
target/arm/cpu.h | 7 ++++
target/i386/cpu-sysemu.c | 7 ++--
target/i386/cpu.h | 6 ++++
target/s390x/cpu.h | 7 ++++
target/s390x/cpu_models_sysemu.c | 6 ++--
10 files changed, 110 insertions(+), 70 deletions(-)
diff --git a/cpu.c b/cpu.c
index 1c948d1161..a99d09cd47 100644
--- a/cpu.c
+++ b/cpu.c
@@ -292,6 +292,26 @@ void list_cpus(void)
#endif
}
+CpuModelExpansionInfo *get_cpu_model_expansion_info(CpuModelExpansionType type,
+ CpuModelInfo *model,
+ Error **errp)
+{
+ /* XXX: implement cpu_model_expansion for targets that still miss it */
+#if defined(cpu_model_expansion)
+ return cpu_model_expansion(type, model, errp);
+#else
+ error_setg(errp, "Could not query cpu model information");
+ return NULL;
+#endif
+}
+
+CpuModelExpansionInfo *qmp_query_cpu_model_expansion(CpuModelExpansionType type,
+ CpuModelInfo *model,
+ Error **errp)
+{
+ return get_cpu_model_expansion_info(type, model, errp);
+}
+
#if defined(CONFIG_USER_ONLY)
void tb_invalidate_phys_addr(hwaddr addr)
{
diff --git a/include/exec/cpu-common.h b/include/exec/cpu-common.h
index 87dc9a752c..653f8a9d2b 100644
--- a/include/exec/cpu-common.h
+++ b/include/exec/cpu-common.h
@@ -6,6 +6,7 @@
#ifndef CONFIG_USER_ONLY
#include "exec/hwaddr.h"
#endif
+#include "qapi/qapi-commands-machine.h"
/**
* vaddr:
@@ -167,4 +168,10 @@ int cpu_memory_rw_debug(CPUState *cpu, vaddr addr,
/* vl.c */
void list_cpus(void);
+CpuModelExpansionInfo *get_cpu_model_expansion_info(CpuModelExpansionType type,
+ CpuModelInfo *model,
+ Error **errp);
+void list_cpu_model_expansion(CpuModelExpansionType type,
+ CpuModelInfo *model, Error **errp);
+
#endif /* CPU_COMMON_H */
diff --git a/qapi/machine-target.json b/qapi/machine-target.json
index 3ee2f7ca6b..a658b1754b 100644
--- a/qapi/machine-target.json
+++ b/qapi/machine-target.json
@@ -139,66 +139,6 @@
'returns': 'CpuModelBaselineInfo',
'if': 'TARGET_S390X' }
-##
-# @CpuModelExpansionInfo:
-#
-# The result of a cpu model expansion.
-#
-# @model: the expanded CpuModelInfo.
-#
-# Since: 2.8
-##
-{ 'struct': 'CpuModelExpansionInfo',
- 'data': { 'model': 'CpuModelInfo' },
- 'if': { 'any': [ 'TARGET_S390X',
- 'TARGET_I386',
- 'TARGET_ARM' ] } }
-
-##
-# @query-cpu-model-expansion:
-#
-# Expands a given CPU model (or a combination of CPU model +
-# additional options) to different granularities, allowing tooling to
-# get an understanding what a specific CPU model looks like in QEMU
-# under a certain configuration.
-#
-# This interface can be used to query the "host" CPU model.
-#
-# The data returned by this command may be affected by:
-#
-# * QEMU version: CPU models may look different depending on the QEMU
-# version. (Except for CPU models reported as "static" in
-# query-cpu-definitions.)
-# * machine-type: CPU model may look different depending on the
-# machine-type. (Except for CPU models reported as "static" in
-# query-cpu-definitions.)
-# * machine options (including accelerator): in some architectures,
-# CPU models may look different depending on machine and accelerator
-# options. (Except for CPU models reported as "static" in
-# query-cpu-definitions.)
-# * "-cpu" arguments and global properties: arguments to the -cpu
-# option and global properties may affect expansion of CPU models.
-# Using query-cpu-model-expansion while using these is not advised.
-#
-# Some architectures may not support all expansion types. s390x
-# supports "full" and "static". Arm only supports "full".
-#
-# Returns: a CpuModelExpansionInfo. Returns an error if expanding CPU
-# models is not supported, if the model cannot be expanded, if the
-# model contains an unknown CPU definition name, unknown
-# properties or properties with a wrong type. Also returns an
-# error if an expansion type is not supported.
-#
-# Since: 2.8
-##
-{ 'command': 'query-cpu-model-expansion',
- 'data': { 'type': 'CpuModelExpansionType',
- 'model': 'CpuModelInfo' },
- 'returns': 'CpuModelExpansionInfo',
- 'if': { 'any': [ 'TARGET_S390X',
- 'TARGET_I386',
- 'TARGET_ARM' ] } }
-
##
# @CpuDefinitionInfo:
#
diff --git a/qapi/machine.json b/qapi/machine.json
index 192c781310..f24e19815e 100644
--- a/qapi/machine.json
+++ b/qapi/machine.json
@@ -1768,3 +1768,56 @@
##
{ 'enum': 'CpuModelCompareResult',
'data': [ 'incompatible', 'identical', 'superset', 'subset' ] }
+
+##
+# @CpuModelExpansionInfo:
+#
+# The result of a cpu model expansion.
+#
+# @model: the expanded CpuModelInfo.
+#
+# Since: 2.8
+##
+{ 'struct': 'CpuModelExpansionInfo',
+ 'data': { 'model': 'CpuModelInfo' }}
+
+##
+# @query-cpu-model-expansion:
+#
+# Expands a given CPU model (or a combination of CPU model +
+# additional options) to different granularities, allowing tooling to
+# get an understanding what a specific CPU model looks like in QEMU
+# under a certain configuration.
+#
+# This interface can be used to query the "host" CPU model.
+#
+# The data returned by this command may be affected by:
+#
+# * QEMU version: CPU models may look different depending on the QEMU
+# version. (Except for CPU models reported as "static" in
+# query-cpu-definitions.)
+# * machine-type: CPU model may look different depending on the
+# machine-type. (Except for CPU models reported as "static" in
+# query-cpu-definitions.)
+# * machine options (including accelerator): in some architectures,
+# CPU models may look different depending on machine and accelerator
+# options. (Except for CPU models reported as "static" in
+# query-cpu-definitions.)
+# * "-cpu" arguments and global properties: arguments to the -cpu
+# option and global properties may affect expansion of CPU models.
+# Using query-cpu-model-expansion while using these is not advised.
+#
+# Some architectures may not support all expansion types. s390x
+# supports "full" and "static". Arm only supports "full".
+#
+# Returns: a CpuModelExpansionInfo. Returns an error if expanding CPU
+# models is not supported, if the model cannot be expanded, if the
+# model contains an unknown CPU definition name, unknown
+# properties or properties with a wrong type. Also returns an
+# error if an expansion type is not supported.
+#
+# Since: 2.8
+##
+{ 'command': 'query-cpu-model-expansion',
+ 'data': { 'type': 'CpuModelExpansionType', 'model': 'CpuModelInfo' },
+ 'returns': 'CpuModelExpansionInfo'}
diff --git a/target/arm/arm-qmp-cmds.c b/target/arm/arm-qmp-cmds.c
index c8fa524002..295d690e93 100644
--- a/target/arm/arm-qmp-cmds.c
+++ b/target/arm/arm-qmp-cmds.c
@@ -22,6 +22,7 @@
#include "qemu/osdep.h"
#include "hw/boards.h"
+#include "cpu.h"
#include "kvm_arm.h"
#include "qapi/error.h"
#include "qapi/visitor.h"
@@ -99,9 +100,9 @@ static const char *cpu_model_advertised_features[] = {
NULL
};
-CpuModelExpansionInfo *qmp_query_cpu_model_expansion(CpuModelExpansionType type,
- CpuModelInfo *model,
- Error **errp)
+CpuModelExpansionInfo *get_cpu_model_expansion(CpuModelExpansionType type,
+ CpuModelInfo *model,
+ Error **errp)
{
CpuModelExpansionInfo *expansion_info;
const QDict *qdict_in = NULL;
diff --git a/target/arm/cpu.h b/target/arm/cpu.h
index 88e5accda6..71b15d4884 100644
--- a/target/arm/cpu.h
+++ b/target/arm/cpu.h
@@ -2740,6 +2740,13 @@ bool write_cpustate_to_list(ARMCPU *cpu, bool kvm_sync);
#define cpu_list arm_cpu_list
+#ifdef CONFIG_SOFTMMU
+CpuModelExpansionInfo *get_cpu_model_expansion(CpuModelExpansionType type,
+ CpuModelInfo *model,
+ Error **errp);
+#define cpu_model_expansion get_cpu_model_expansion
+#endif
+
/* ARM has the following "translation regimes" (as the ARM ARM calls them):
*
* If EL3 is 64-bit:
diff --git a/target/i386/cpu-sysemu.c b/target/i386/cpu-sysemu.c
index 28115edf44..c01c85839c 100644
--- a/target/i386/cpu-sysemu.c
+++ b/target/i386/cpu-sysemu.c
@@ -176,10 +176,9 @@ out:
return xc;
}
-CpuModelExpansionInfo *
-qmp_query_cpu_model_expansion(CpuModelExpansionType type,
- CpuModelInfo *model,
- Error **errp)
+CpuModelExpansionInfo *get_cpu_model_expansion(CpuModelExpansionType type,
+ CpuModelInfo *model,
+ Error **errp)
{
X86CPU *xc = NULL;
Error *err = NULL;
diff --git a/target/i386/cpu.h b/target/i386/cpu.h
index e0771a1043..699b987d12 100644
--- a/target/i386/cpu.h
+++ b/target/i386/cpu.h
@@ -2249,6 +2249,12 @@ uint64_t cpu_get_tsc(CPUX86State *env);
#endif
#define cpu_list x86_cpu_list
+#ifdef CONFIG_SOFTMMU
+CpuModelExpansionInfo *get_cpu_model_expansion(CpuModelExpansionType type,
+ CpuModelInfo *model,
+ Error **errp);
+#define cpu_model_expansion get_cpu_model_expansion
+#endif
/* MMU modes definitions */
#define MMU_KSMAP_IDX 0
diff --git a/target/s390x/cpu.h b/target/s390x/cpu.h
index eb5b65b7d3..932f8b642a 100644
--- a/target/s390x/cpu.h
+++ b/target/s390x/cpu.h
@@ -804,6 +804,13 @@ static inline uint8_t s390_cpu_get_state(S390CPU *cpu)
/* cpu_models.c */
void s390_cpu_list(void);
#define cpu_list s390_cpu_list
+#ifdef CONFIG_SOFTMMU
+CpuModelExpansionInfo *get_cpu_model_expansion(CpuModelExpansionType type,
+ CpuModelInfo *model,
+ Error **errp);
+#define cpu_model_expansion get_cpu_model_expansion
+#endif
+
void s390_set_qemu_cpu_model(uint16_t type, uint8_t gen, uint8_t ec_ga,
const S390FeatInit feat_init);
diff --git a/target/s390x/cpu_models_sysemu.c b/target/s390x/cpu_models_sysemu.c
index 63981bf36b..ef3845f11c 100644
--- a/target/s390x/cpu_models_sysemu.c
+++ b/target/s390x/cpu_models_sysemu.c
@@ -213,9 +213,9 @@ static void cpu_info_from_model(CpuModelInfo *info, const S390CPUModel *model,
}
}
-CpuModelExpansionInfo *qmp_query_cpu_model_expansion(CpuModelExpansionType type,
- CpuModelInfo *model,
- Error **errp)
+CpuModelExpansionInfo *get_cpu_model_expansion(CpuModelExpansionType type,
+ CpuModelInfo *model,
+ Error **errp)
{
Error *err = NULL;
CpuModelExpansionInfo *expansion_info = NULL;
--
2.30.2
^ permalink raw reply related [flat|nested] 17+ messages in thread
* Re: [PATCH v3 2/3] qapi, target/: Enable 'query-cpu-model-expansion' on all architectures
2023-07-30 6:40 ` [PATCH v3 2/3] qapi, target/: Enable 'query-cpu-model-expansion' on all architectures Dinah Baum
@ 2023-08-01 13:44 ` Markus Armbruster
0 siblings, 0 replies; 17+ messages in thread
From: Markus Armbruster @ 2023-08-01 13:44 UTC (permalink / raw)
To: Dinah Baum
Cc: qemu-devel, Eduardo Habkost, Marcel Apfelbaum,
Philippe Mathieu-Daudé, Yanan Wang, Richard Henderson,
Paolo Bonzini, Eric Blake, Peter Maydell, David Hildenbrand,
Ilya Leoshkevich, Thomas Huth, open list:ARM TCG CPUs,
open list:S390 TCG CPUs
Dinah Baum <dinahbaum123@gmail.com> writes:
> Only architectures that implement the command will return
> results, others will return an error message as before.
A brief explanation why this is useful would be nice.
>
> Signed-off-by: Dinah Baum <dinahbaum123@gmail.com>
> ---
> cpu.c | 20 +++++++++++
> include/exec/cpu-common.h | 7 ++++
> qapi/machine-target.json | 60 --------------------------------
> qapi/machine.json | 53 ++++++++++++++++++++++++++++
> target/arm/arm-qmp-cmds.c | 7 ++--
> target/arm/cpu.h | 7 ++++
> target/i386/cpu-sysemu.c | 7 ++--
> target/i386/cpu.h | 6 ++++
> target/s390x/cpu.h | 7 ++++
> target/s390x/cpu_models_sysemu.c | 6 ++--
> 10 files changed, 110 insertions(+), 70 deletions(-)
>
> diff --git a/cpu.c b/cpu.c
> index 1c948d1161..a99d09cd47 100644
> --- a/cpu.c
> +++ b/cpu.c
> @@ -292,6 +292,26 @@ void list_cpus(void)
> #endif
> }
>
> +CpuModelExpansionInfo *get_cpu_model_expansion_info(CpuModelExpansionType type,
> + CpuModelInfo *model,
> + Error **errp)
> +{
> + /* XXX: implement cpu_model_expansion for targets that still miss it */
> +#if defined(cpu_model_expansion)
> + return cpu_model_expansion(type, model, errp);
> +#else
> + error_setg(errp, "Could not query cpu model information");
> + return NULL;
> +#endif
> +}
This is vague enough to leave the user wondering what could be done to
avoid this error and by whom.
Before the patch, it's clear enough: "The command
query-cpu-model-expansion has not been found".
You could go with something like "command not supported for this
target".
The error class changes from CommandNotFound to GenericError. Please
verify libvirt is fine with that.
> +
> +CpuModelExpansionInfo *qmp_query_cpu_model_expansion(CpuModelExpansionType type,
> + CpuModelInfo *model,
> + Error **errp)
> +{
> + return get_cpu_model_expansion_info(type, model, errp);
> +}
> +
Why do you need qmp_query_cpu_model_expansion() to become a wrapper
around the real function?
> #if defined(CONFIG_USER_ONLY)
> void tb_invalidate_phys_addr(hwaddr addr)
> {
> diff --git a/include/exec/cpu-common.h b/include/exec/cpu-common.h
> index 87dc9a752c..653f8a9d2b 100644
> --- a/include/exec/cpu-common.h
> +++ b/include/exec/cpu-common.h
> @@ -6,6 +6,7 @@
> #ifndef CONFIG_USER_ONLY
> #include "exec/hwaddr.h"
> #endif
> +#include "qapi/qapi-commands-machine.h"
>
> /**
> * vaddr:
> @@ -167,4 +168,10 @@ int cpu_memory_rw_debug(CPUState *cpu, vaddr addr,
> /* vl.c */
> void list_cpus(void);
>
> +CpuModelExpansionInfo *get_cpu_model_expansion_info(CpuModelExpansionType type,
> + CpuModelInfo *model,
> + Error **errp);
> +void list_cpu_model_expansion(CpuModelExpansionType type,
> + CpuModelInfo *model, Error **errp);
> +
The declaration of list_cpu_model_expansion() belongs to the next patch.
> #endif /* CPU_COMMON_H */
> diff --git a/qapi/machine-target.json b/qapi/machine-target.json
> index 3ee2f7ca6b..a658b1754b 100644
> --- a/qapi/machine-target.json
> +++ b/qapi/machine-target.json
> @@ -139,66 +139,6 @@
> 'returns': 'CpuModelBaselineInfo',
> 'if': 'TARGET_S390X' }
>
> -##
> -# @CpuModelExpansionInfo:
> -#
> -# The result of a cpu model expansion.
> -#
> -# @model: the expanded CpuModelInfo.
> -#
> -# Since: 2.8
> -##
> -{ 'struct': 'CpuModelExpansionInfo',
> - 'data': { 'model': 'CpuModelInfo' },
> - 'if': { 'any': [ 'TARGET_S390X',
> - 'TARGET_I386',
> - 'TARGET_ARM' ] } }
> -
> -##
> -# @query-cpu-model-expansion:
> -#
> -# Expands a given CPU model (or a combination of CPU model +
> -# additional options) to different granularities, allowing tooling to
> -# get an understanding what a specific CPU model looks like in QEMU
> -# under a certain configuration.
> -#
> -# This interface can be used to query the "host" CPU model.
> -#
> -# The data returned by this command may be affected by:
> -#
> -# * QEMU version: CPU models may look different depending on the QEMU
> -# version. (Except for CPU models reported as "static" in
> -# query-cpu-definitions.)
> -# * machine-type: CPU model may look different depending on the
> -# machine-type. (Except for CPU models reported as "static" in
> -# query-cpu-definitions.)
> -# * machine options (including accelerator): in some architectures,
> -# CPU models may look different depending on machine and accelerator
> -# options. (Except for CPU models reported as "static" in
> -# query-cpu-definitions.)
> -# * "-cpu" arguments and global properties: arguments to the -cpu
> -# option and global properties may affect expansion of CPU models.
> -# Using query-cpu-model-expansion while using these is not advised.
> -#
> -# Some architectures may not support all expansion types. s390x
> -# supports "full" and "static". Arm only supports "full".
> -#
> -# Returns: a CpuModelExpansionInfo. Returns an error if expanding CPU
> -# models is not supported, if the model cannot be expanded, if the
> -# model contains an unknown CPU definition name, unknown
> -# properties or properties with a wrong type. Also returns an
> -# error if an expansion type is not supported.
> -#
> -# Since: 2.8
> -##
> -{ 'command': 'query-cpu-model-expansion',
> - 'data': { 'type': 'CpuModelExpansionType',
> - 'model': 'CpuModelInfo' },
> - 'returns': 'CpuModelExpansionInfo',
> - 'if': { 'any': [ 'TARGET_S390X',
> - 'TARGET_I386',
> - 'TARGET_ARM' ] } }
> -
> ##
> # @CpuDefinitionInfo:
> #
> diff --git a/qapi/machine.json b/qapi/machine.json
> index 192c781310..f24e19815e 100644
> --- a/qapi/machine.json
> +++ b/qapi/machine.json
> @@ -1768,3 +1768,56 @@
> ##
> { 'enum': 'CpuModelCompareResult',
> 'data': [ 'incompatible', 'identical', 'superset', 'subset' ] }
> +
> +##
> +# @CpuModelExpansionInfo:
> +#
> +# The result of a cpu model expansion.
> +#
> +# @model: the expanded CpuModelInfo.
> +#
> +# Since: 2.8
> +##
> +{ 'struct': 'CpuModelExpansionInfo',
> + 'data': { 'model': 'CpuModelInfo' }}
> +
> +##
> +# @query-cpu-model-expansion:
> +#
> +# Expands a given CPU model (or a combination of CPU model +
> +# additional options) to different granularities, allowing tooling to
> +# get an understanding what a specific CPU model looks like in QEMU
> +# under a certain configuration.
> +#
> +# This interface can be used to query the "host" CPU model.
> +#
> +# The data returned by this command may be affected by:
> +#
> +# * QEMU version: CPU models may look different depending on the QEMU
> +# version. (Except for CPU models reported as "static" in
> +# query-cpu-definitions.)
> +# * machine-type: CPU model may look different depending on the
> +# machine-type. (Except for CPU models reported as "static" in
> +# query-cpu-definitions.)
> +# * machine options (including accelerator): in some architectures,
> +# CPU models may look different depending on machine and accelerator
> +# options. (Except for CPU models reported as "static" in
> +# query-cpu-definitions.)
> +# * "-cpu" arguments and global properties: arguments to the -cpu
> +# option and global properties may affect expansion of CPU models.
> +# Using query-cpu-model-expansion while using these is not advised.
> +#
> +# Some architectures may not support all expansion types. s390x
> +# supports "full" and "static". Arm only supports "full".
> +#
> +# Returns: a CpuModelExpansionInfo. Returns an error if expanding CPU
Accidental space change, line should remain
# Returns: a CpuModelExpansionInfo. Returns an error if expanding CPU
> +# models is not supported, if the model cannot be expanded, if the
> +# model contains an unknown CPU definition name, unknown
> +# properties or properties with a wrong type. Also returns an
> +# error if an expansion type is not supported.
> +#
> +# Since: 2.8
> +##
> +{ 'command': 'query-cpu-model-expansion',
> + 'data': { 'type': 'CpuModelExpansionType', 'model': 'CpuModelInfo' },
> + 'returns': 'CpuModelExpansionInfo'}
> diff --git a/target/arm/arm-qmp-cmds.c b/target/arm/arm-qmp-cmds.c
> index c8fa524002..295d690e93 100644
> --- a/target/arm/arm-qmp-cmds.c
> +++ b/target/arm/arm-qmp-cmds.c
> @@ -22,6 +22,7 @@
>
> #include "qemu/osdep.h"
> #include "hw/boards.h"
> +#include "cpu.h"
> #include "kvm_arm.h"
> #include "qapi/error.h"
> #include "qapi/visitor.h"
> @@ -99,9 +100,9 @@ static const char *cpu_model_advertised_features[] = {
> NULL
> };
>
> -CpuModelExpansionInfo *qmp_query_cpu_model_expansion(CpuModelExpansionType type,
> - CpuModelInfo *model,
> - Error **errp)
> +CpuModelExpansionInfo *get_cpu_model_expansion(CpuModelExpansionType type,
> + CpuModelInfo *model,
> + Error **errp)
> {
> CpuModelExpansionInfo *expansion_info;
> const QDict *qdict_in = NULL;
> diff --git a/target/arm/cpu.h b/target/arm/cpu.h
> index 88e5accda6..71b15d4884 100644
> --- a/target/arm/cpu.h
> +++ b/target/arm/cpu.h
> @@ -2740,6 +2740,13 @@ bool write_cpustate_to_list(ARMCPU *cpu, bool kvm_sync);
>
> #define cpu_list arm_cpu_list
>
> +#ifdef CONFIG_SOFTMMU
> +CpuModelExpansionInfo *get_cpu_model_expansion(CpuModelExpansionType type,
> + CpuModelInfo *model,
> + Error **errp);
> +#define cpu_model_expansion get_cpu_model_expansion
What is this macro for?
> +#endif
> +
> /* ARM has the following "translation regimes" (as the ARM ARM calls them):
> *
> * If EL3 is 64-bit:
> diff --git a/target/i386/cpu-sysemu.c b/target/i386/cpu-sysemu.c
> index 28115edf44..c01c85839c 100644
> --- a/target/i386/cpu-sysemu.c
> +++ b/target/i386/cpu-sysemu.c
> @@ -176,10 +176,9 @@ out:
> return xc;
> }
>
> -CpuModelExpansionInfo *
> -qmp_query_cpu_model_expansion(CpuModelExpansionType type,
> - CpuModelInfo *model,
> - Error **errp)
> +CpuModelExpansionInfo *get_cpu_model_expansion(CpuModelExpansionType type,
> + CpuModelInfo *model,
> + Error **errp)
> {
> X86CPU *xc = NULL;
> Error *err = NULL;
> diff --git a/target/i386/cpu.h b/target/i386/cpu.h
> index e0771a1043..699b987d12 100644
> --- a/target/i386/cpu.h
> +++ b/target/i386/cpu.h
> @@ -2249,6 +2249,12 @@ uint64_t cpu_get_tsc(CPUX86State *env);
> #endif
>
> #define cpu_list x86_cpu_list
> +#ifdef CONFIG_SOFTMMU
> +CpuModelExpansionInfo *get_cpu_model_expansion(CpuModelExpansionType type,
> + CpuModelInfo *model,
> + Error **errp);
> +#define cpu_model_expansion get_cpu_model_expansion
Likewise.
> +#endif
>
> /* MMU modes definitions */
> #define MMU_KSMAP_IDX 0
> diff --git a/target/s390x/cpu.h b/target/s390x/cpu.h
> index eb5b65b7d3..932f8b642a 100644
> --- a/target/s390x/cpu.h
> +++ b/target/s390x/cpu.h
> @@ -804,6 +804,13 @@ static inline uint8_t s390_cpu_get_state(S390CPU *cpu)
> /* cpu_models.c */
> void s390_cpu_list(void);
> #define cpu_list s390_cpu_list
> +#ifdef CONFIG_SOFTMMU
> +CpuModelExpansionInfo *get_cpu_model_expansion(CpuModelExpansionType type,
> + CpuModelInfo *model,
> + Error **errp);
> +#define cpu_model_expansion get_cpu_model_expansion
Likewise.
> +#endif
> +
> void s390_set_qemu_cpu_model(uint16_t type, uint8_t gen, uint8_t ec_ga,
> const S390FeatInit feat_init);
>
> diff --git a/target/s390x/cpu_models_sysemu.c b/target/s390x/cpu_models_sysemu.c
> index 63981bf36b..ef3845f11c 100644
> --- a/target/s390x/cpu_models_sysemu.c
> +++ b/target/s390x/cpu_models_sysemu.c
> @@ -213,9 +213,9 @@ static void cpu_info_from_model(CpuModelInfo *info, const S390CPUModel *model,
> }
> }
>
> -CpuModelExpansionInfo *qmp_query_cpu_model_expansion(CpuModelExpansionType type,
> - CpuModelInfo *model,
> - Error **errp)
> +CpuModelExpansionInfo *get_cpu_model_expansion(CpuModelExpansionType type,
> + CpuModelInfo *model,
> + Error **errp)
> {
> Error *err = NULL;
> CpuModelExpansionInfo *expansion_info = NULL;
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH v3 3/3] cpu, softmmu/vl.c: Change parsing of -cpu argument to allow -cpu cpu, help to print options for the CPU type similar to how the '-device' option works.
2023-07-30 6:40 [PATCH v3 0/3] Enable -cpu <cpu>,help Dinah Baum
2023-07-30 6:40 ` [PATCH v3 1/3] qapi: Moved architecture agnostic data types to `machine` Dinah Baum
2023-07-30 6:40 ` [PATCH v3 2/3] qapi, target/: Enable 'query-cpu-model-expansion' on all architectures Dinah Baum
@ 2023-07-30 6:40 ` Dinah Baum
2023-08-01 13:02 ` Dinah B
2023-08-01 14:09 ` [PATCH v3 3/3] cpu, softmmu/vl.c: Change parsing of -cpu argument to allow -cpu cpu,help " Markus Armbruster
2023-07-30 15:15 ` [PATCH v3 0/3] Enable -cpu <cpu>,help Peter Maydell
3 siblings, 2 replies; 17+ messages in thread
From: Dinah Baum @ 2023-07-30 6:40 UTC (permalink / raw)
To: qemu-devel
Cc: Dinah Baum, Eduardo Habkost, Marcel Apfelbaum,
Philippe Mathieu-Daudé, Yanan Wang, Markus Armbruster,
Paolo Bonzini
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1480
Signed-off-by: Dinah Baum <dinahbaum123@gmail.com>
Signed-off-by: Dinah Baum <dinahbaum123@gmail.com>
---
cpu.c | 41 ++++++++++++++++++++++++++++++++++++++++
include/qapi/qmp/qdict.h | 1 +
qemu-options.hx | 7 ++++---
qobject/qdict.c | 5 +++++
softmmu/vl.c | 35 +++++++++++++++++++++++++++++++++-
5 files changed, 85 insertions(+), 4 deletions(-)
diff --git a/cpu.c b/cpu.c
index a99d09cd47..9971ffeeba 100644
--- a/cpu.c
+++ b/cpu.c
@@ -43,6 +43,10 @@
#include "trace/trace-root.h"
#include "qemu/accel.h"
#include "qemu/plugin.h"
+#include "qemu/cutils.h"
+#include "qemu/qemu-print.h"
+#include "qapi/qmp/qdict.h"
+#include "qapi/qmp/qobject.h"
uintptr_t qemu_host_page_size;
intptr_t qemu_host_page_mask;
@@ -312,6 +316,43 @@ CpuModelExpansionInfo *qmp_query_cpu_model_expansion(CpuModelExpansionType type,
return get_cpu_model_expansion_info(type, model, errp);
}
+void list_cpu_model_expansion(CpuModelExpansionType type,
+ CpuModelInfo *model,
+ Error **errp)
+{
+ CpuModelExpansionInfo *expansion_info;
+ QDict *qdict;
+ QDictEntry *qdict_entry;
+ const char *key;
+ QObject *obj;
+ QType q_type;
+ GPtrArray *array;
+ int i;
+ const char *type_name;
+
+ expansion_info = get_cpu_model_expansion_info(type, model, errp);
+ if (expansion_info) {
+ qdict = qobject_to(QDict, expansion_info->model->props);
+ if (qdict) {
+ qemu_printf("%s features:\n", model->name);
+ array = g_ptr_array_new();
+ for (qdict_entry = (QDictEntry *)qdict_first(qdict); qdict_entry;
+ qdict_entry = (QDictEntry *)qdict_next(qdict, qdict_entry)) {
+ g_ptr_array_add(array, qdict_entry);
+ }
+ g_ptr_array_sort(array, (GCompareFunc)dict_key_compare);
+ for (i = 0; i < array->len; i++) {
+ qdict_entry = array->pdata[i];
+ key = qdict_entry_key(qdict_entry);
+ obj = qdict_get(qdict, key);
+ q_type = qobject_type(obj);
+ type_name = QType_str(q_type);
+ qemu_printf(" %s=<%s>\n", key, type_name);
+ }
+ }
+ }
+}
+
#if defined(CONFIG_USER_ONLY)
void tb_invalidate_phys_addr(hwaddr addr)
{
diff --git a/include/qapi/qmp/qdict.h b/include/qapi/qmp/qdict.h
index 82e90fc072..d0b6c3d358 100644
--- a/include/qapi/qmp/qdict.h
+++ b/include/qapi/qmp/qdict.h
@@ -67,5 +67,6 @@ bool qdict_get_try_bool(const QDict *qdict, const char *key, bool def_value);
const char *qdict_get_try_str(const QDict *qdict, const char *key);
QDict *qdict_clone_shallow(const QDict *src);
+int dict_key_compare(QDictEntry **entry1, QDictEntry **entry2);
#endif /* QDICT_H */
diff --git a/qemu-options.hx b/qemu-options.hx
index 29b98c3d4c..e0f0284927 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -169,11 +169,12 @@ SRST
ERST
DEF("cpu", HAS_ARG, QEMU_OPTION_cpu,
- "-cpu cpu select CPU ('-cpu help' for list)\n", QEMU_ARCH_ALL)
+ "-cpu cpu select CPU ('-cpu help' for list)\n"
+ " use '-cpu cpu,help' to print possible properties\n", QEMU_ARCH_ALL)
SRST
``-cpu model``
- Select CPU model (``-cpu help`` for list and additional feature
- selection)
+ Select CPU model (``-cpu help`` and ``-cpu cpu,help``) for list and additional feature
+ selection
ERST
DEF("accel", HAS_ARG, QEMU_OPTION_accel,
diff --git a/qobject/qdict.c b/qobject/qdict.c
index 8faff230d3..31407e62f6 100644
--- a/qobject/qdict.c
+++ b/qobject/qdict.c
@@ -447,3 +447,8 @@ void qdict_unref(QDict *q)
{
qobject_unref(q);
}
+
+int dict_key_compare(QDictEntry **entry1, QDictEntry **entry2)
+{
+ return g_strcmp0(qdict_entry_key(*entry1), qdict_entry_key(*entry2));
+}
diff --git a/softmmu/vl.c b/softmmu/vl.c
index b0b96f67fa..1fd87f2c06 100644
--- a/softmmu/vl.c
+++ b/softmmu/vl.c
@@ -501,6 +501,15 @@ static QemuOptsList qemu_action_opts = {
},
};
+static QemuOptsList qemu_cpu_opts = {
+ .name = "cpu",
+ .implied_opt_name = "cpu",
+ .head = QTAILQ_HEAD_INITIALIZER(qemu_cpu_opts.head),
+ .desc = {
+ { /* end of list */ }
+ },
+};
+
const char *qemu_get_vm_name(void)
{
return qemu_name;
@@ -1159,6 +1168,26 @@ static int device_init_func(void *opaque, QemuOpts *opts, Error **errp)
return 0;
}
+static int cpu_help_func(void *opaque, QemuOpts *opts, Error **errp)
+{
+ CpuModelInfo *model;
+
+ if (cpu_option && is_help_option(cpu_option)) {
+ list_cpus();
+ return 1;
+ }
+
+ if (!cpu_option || !qemu_opt_has_help_opt(opts)) {
+ return 0;
+ }
+
+ model = g_new0(CpuModelInfo, 1);
+ model->name = (char *)qemu_opt_get(opts, "cpu");
+ /* TODO: handle other expansion cases */
+ list_cpu_model_expansion(CPU_MODEL_EXPANSION_TYPE_FULL, model, errp);
+ return 1;
+}
+
static int chardev_init_func(void *opaque, QemuOpts *opts, Error **errp)
{
Error *local_err = NULL;
@@ -2466,7 +2495,9 @@ static void qemu_process_help_options(void)
list_cpus();
exit(0);
}
-
+ if (qemu_opts_foreach(qemu_find_opts("cpu"), cpu_help_func, NULL, NULL)) {
+ exit(0);
+ }
if (qemu_opts_foreach(qemu_find_opts("device"),
device_help_func, NULL, NULL)) {
exit(0);
@@ -2704,6 +2735,7 @@ void qemu_init(int argc, char **argv)
qemu_add_opts(&qemu_semihosting_config_opts);
qemu_add_opts(&qemu_fw_cfg_opts);
qemu_add_opts(&qemu_action_opts);
+ qemu_add_opts(&qemu_cpu_opts);
module_call_init(MODULE_INIT_OPTS);
error_init(argv[0]);
@@ -2755,6 +2787,7 @@ void qemu_init(int argc, char **argv)
switch(popt->index) {
case QEMU_OPTION_cpu:
/* hw initialization will check this */
+ qemu_opts_parse_noisily(qemu_find_opts("cpu"), optarg, true);
cpu_option = optarg;
break;
case QEMU_OPTION_hda:
--
2.30.2
^ permalink raw reply related [flat|nested] 17+ messages in thread
* Re: [PATCH v3 3/3] cpu, softmmu/vl.c: Change parsing of -cpu argument to allow -cpu cpu, help to print options for the CPU type similar to how the '-device' option works.
2023-07-30 6:40 ` [PATCH v3 3/3] cpu, softmmu/vl.c: Change parsing of -cpu argument to allow -cpu cpu, help to print options for the CPU type similar to how the '-device' option works Dinah Baum
@ 2023-08-01 13:02 ` Dinah B
2023-08-01 14:09 ` [PATCH v3 3/3] cpu, softmmu/vl.c: Change parsing of -cpu argument to allow -cpu cpu,help " Markus Armbruster
1 sibling, 0 replies; 17+ messages in thread
From: Dinah B @ 2023-08-01 13:02 UTC (permalink / raw)
To: qemu-devel
Cc: Eduardo Habkost, Marcel Apfelbaum, Philippe Mathieu-Daudé,
Yanan Wang, Markus Armbruster, Paolo Bonzini
[-- Attachment #1: Type: text/plain, Size: 7020 bytes --]
Just realized that the commit message on this one got a little mangled. I'm
happy to revise it but I'd prefer to get the code reviewed first before
doing a purely commit message change.
-Dinah
On Sun, Jul 30, 2023 at 2:41 AM Dinah Baum <dinahbaum123@gmail.com> wrote:
> Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1480
> Signed-off-by: Dinah Baum <dinahbaum123@gmail.com>
>
> Signed-off-by: Dinah Baum <dinahbaum123@gmail.com>
> ---
> cpu.c | 41 ++++++++++++++++++++++++++++++++++++++++
> include/qapi/qmp/qdict.h | 1 +
> qemu-options.hx | 7 ++++---
> qobject/qdict.c | 5 +++++
> softmmu/vl.c | 35 +++++++++++++++++++++++++++++++++-
> 5 files changed, 85 insertions(+), 4 deletions(-)
>
> diff --git a/cpu.c b/cpu.c
> index a99d09cd47..9971ffeeba 100644
> --- a/cpu.c
> +++ b/cpu.c
> @@ -43,6 +43,10 @@
> #include "trace/trace-root.h"
> #include "qemu/accel.h"
> #include "qemu/plugin.h"
> +#include "qemu/cutils.h"
> +#include "qemu/qemu-print.h"
> +#include "qapi/qmp/qdict.h"
> +#include "qapi/qmp/qobject.h"
>
> uintptr_t qemu_host_page_size;
> intptr_t qemu_host_page_mask;
> @@ -312,6 +316,43 @@ CpuModelExpansionInfo
> *qmp_query_cpu_model_expansion(CpuModelExpansionType type,
> return get_cpu_model_expansion_info(type, model, errp);
> }
>
> +void list_cpu_model_expansion(CpuModelExpansionType type,
> + CpuModelInfo *model,
> + Error **errp)
> +{
> + CpuModelExpansionInfo *expansion_info;
> + QDict *qdict;
> + QDictEntry *qdict_entry;
> + const char *key;
> + QObject *obj;
> + QType q_type;
> + GPtrArray *array;
> + int i;
> + const char *type_name;
> +
> + expansion_info = get_cpu_model_expansion_info(type, model, errp);
> + if (expansion_info) {
> + qdict = qobject_to(QDict, expansion_info->model->props);
> + if (qdict) {
> + qemu_printf("%s features:\n", model->name);
> + array = g_ptr_array_new();
> + for (qdict_entry = (QDictEntry *)qdict_first(qdict);
> qdict_entry;
> + qdict_entry = (QDictEntry *)qdict_next(qdict,
> qdict_entry)) {
> + g_ptr_array_add(array, qdict_entry);
> + }
> + g_ptr_array_sort(array, (GCompareFunc)dict_key_compare);
> + for (i = 0; i < array->len; i++) {
> + qdict_entry = array->pdata[i];
> + key = qdict_entry_key(qdict_entry);
> + obj = qdict_get(qdict, key);
> + q_type = qobject_type(obj);
> + type_name = QType_str(q_type);
> + qemu_printf(" %s=<%s>\n", key, type_name);
> + }
> + }
> + }
> +}
> +
> #if defined(CONFIG_USER_ONLY)
> void tb_invalidate_phys_addr(hwaddr addr)
> {
> diff --git a/include/qapi/qmp/qdict.h b/include/qapi/qmp/qdict.h
> index 82e90fc072..d0b6c3d358 100644
> --- a/include/qapi/qmp/qdict.h
> +++ b/include/qapi/qmp/qdict.h
> @@ -67,5 +67,6 @@ bool qdict_get_try_bool(const QDict *qdict, const char
> *key, bool def_value);
> const char *qdict_get_try_str(const QDict *qdict, const char *key);
>
> QDict *qdict_clone_shallow(const QDict *src);
> +int dict_key_compare(QDictEntry **entry1, QDictEntry **entry2);
>
> #endif /* QDICT_H */
> diff --git a/qemu-options.hx b/qemu-options.hx
> index 29b98c3d4c..e0f0284927 100644
> --- a/qemu-options.hx
> +++ b/qemu-options.hx
> @@ -169,11 +169,12 @@ SRST
> ERST
>
> DEF("cpu", HAS_ARG, QEMU_OPTION_cpu,
> - "-cpu cpu select CPU ('-cpu help' for list)\n", QEMU_ARCH_ALL)
> + "-cpu cpu select CPU ('-cpu help' for list)\n"
> + " use '-cpu cpu,help' to print possible properties\n",
> QEMU_ARCH_ALL)
> SRST
> ``-cpu model``
> - Select CPU model (``-cpu help`` for list and additional feature
> - selection)
> + Select CPU model (``-cpu help`` and ``-cpu cpu,help``) for list and
> additional feature
> + selection
> ERST
>
> DEF("accel", HAS_ARG, QEMU_OPTION_accel,
> diff --git a/qobject/qdict.c b/qobject/qdict.c
> index 8faff230d3..31407e62f6 100644
> --- a/qobject/qdict.c
> +++ b/qobject/qdict.c
> @@ -447,3 +447,8 @@ void qdict_unref(QDict *q)
> {
> qobject_unref(q);
> }
> +
> +int dict_key_compare(QDictEntry **entry1, QDictEntry **entry2)
> +{
> + return g_strcmp0(qdict_entry_key(*entry1), qdict_entry_key(*entry2));
> +}
> diff --git a/softmmu/vl.c b/softmmu/vl.c
> index b0b96f67fa..1fd87f2c06 100644
> --- a/softmmu/vl.c
> +++ b/softmmu/vl.c
> @@ -501,6 +501,15 @@ static QemuOptsList qemu_action_opts = {
> },
> };
>
> +static QemuOptsList qemu_cpu_opts = {
> + .name = "cpu",
> + .implied_opt_name = "cpu",
> + .head = QTAILQ_HEAD_INITIALIZER(qemu_cpu_opts.head),
> + .desc = {
> + { /* end of list */ }
> + },
> +};
> +
> const char *qemu_get_vm_name(void)
> {
> return qemu_name;
> @@ -1159,6 +1168,26 @@ static int device_init_func(void *opaque, QemuOpts
> *opts, Error **errp)
> return 0;
> }
>
> +static int cpu_help_func(void *opaque, QemuOpts *opts, Error **errp)
> +{
> + CpuModelInfo *model;
> +
> + if (cpu_option && is_help_option(cpu_option)) {
> + list_cpus();
> + return 1;
> + }
> +
> + if (!cpu_option || !qemu_opt_has_help_opt(opts)) {
> + return 0;
> + }
> +
> + model = g_new0(CpuModelInfo, 1);
> + model->name = (char *)qemu_opt_get(opts, "cpu");
> + /* TODO: handle other expansion cases */
> + list_cpu_model_expansion(CPU_MODEL_EXPANSION_TYPE_FULL, model, errp);
> + return 1;
> +}
> +
> static int chardev_init_func(void *opaque, QemuOpts *opts, Error **errp)
> {
> Error *local_err = NULL;
> @@ -2466,7 +2495,9 @@ static void qemu_process_help_options(void)
> list_cpus();
> exit(0);
> }
> -
> + if (qemu_opts_foreach(qemu_find_opts("cpu"), cpu_help_func, NULL,
> NULL)) {
> + exit(0);
> + }
> if (qemu_opts_foreach(qemu_find_opts("device"),
> device_help_func, NULL, NULL)) {
> exit(0);
> @@ -2704,6 +2735,7 @@ void qemu_init(int argc, char **argv)
> qemu_add_opts(&qemu_semihosting_config_opts);
> qemu_add_opts(&qemu_fw_cfg_opts);
> qemu_add_opts(&qemu_action_opts);
> + qemu_add_opts(&qemu_cpu_opts);
> module_call_init(MODULE_INIT_OPTS);
>
> error_init(argv[0]);
> @@ -2755,6 +2787,7 @@ void qemu_init(int argc, char **argv)
> switch(popt->index) {
> case QEMU_OPTION_cpu:
> /* hw initialization will check this */
> + qemu_opts_parse_noisily(qemu_find_opts("cpu"), optarg,
> true);
> cpu_option = optarg;
> break;
> case QEMU_OPTION_hda:
> --
> 2.30.2
>
>
[-- Attachment #2: Type: text/html, Size: 8664 bytes --]
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v3 3/3] cpu, softmmu/vl.c: Change parsing of -cpu argument to allow -cpu cpu,help to print options for the CPU type similar to how the '-device' option works.
2023-07-30 6:40 ` [PATCH v3 3/3] cpu, softmmu/vl.c: Change parsing of -cpu argument to allow -cpu cpu, help to print options for the CPU type similar to how the '-device' option works Dinah Baum
2023-08-01 13:02 ` Dinah B
@ 2023-08-01 14:09 ` Markus Armbruster
2023-08-01 21:00 ` [PATCH v3 3/3] cpu, softmmu/vl.c: Change parsing of -cpu argument to allow -cpu cpu, help " Dinah B
1 sibling, 1 reply; 17+ messages in thread
From: Markus Armbruster @ 2023-08-01 14:09 UTC (permalink / raw)
To: Dinah Baum
Cc: qemu-devel, Eduardo Habkost, Marcel Apfelbaum,
Philippe Mathieu-Daudé, Yanan Wang, Paolo Bonzini
Dinah Baum <dinahbaum123@gmail.com> writes:
> Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1480
> Signed-off-by: Dinah Baum <dinahbaum123@gmail.com>
>
> Signed-off-by: Dinah Baum <dinahbaum123@gmail.com>
Looks basically the same as v2, which means my review still applies.
Message-ID: <878rdbfww1.fsf@pond.sub.org>
https://lists.nongnu.org/archive/html/qemu-devel/2023-05/msg06699.html
If you need further assistance, just ask.
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v3 3/3] cpu, softmmu/vl.c: Change parsing of -cpu argument to allow -cpu cpu, help to print options for the CPU type similar to how the '-device' option works.
2023-08-01 14:09 ` [PATCH v3 3/3] cpu, softmmu/vl.c: Change parsing of -cpu argument to allow -cpu cpu,help " Markus Armbruster
@ 2023-08-01 21:00 ` Dinah B
2023-08-02 5:36 ` [PATCH v3 3/3] cpu, softmmu/vl.c: Change parsing of -cpu argument to allow -cpu cpu,help " Markus Armbruster
0 siblings, 1 reply; 17+ messages in thread
From: Dinah B @ 2023-08-01 21:00 UTC (permalink / raw)
To: Markus Armbruster
Cc: qemu-devel, Eduardo Habkost, Marcel Apfelbaum,
Philippe Mathieu-Daudé, Yanan Wang, Paolo Bonzini
[-- Attachment #1: Type: text/plain, Size: 665 bytes --]
Thanks, I will fix this. I somehow didn't catch that you had replied to the
old one.
-Dinah
On Tue, Aug 1, 2023 at 10:10 AM Markus Armbruster <armbru@redhat.com> wrote:
> Dinah Baum <dinahbaum123@gmail.com> writes:
>
> > Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1480
> > Signed-off-by: Dinah Baum <dinahbaum123@gmail.com>
> >
> > Signed-off-by: Dinah Baum <dinahbaum123@gmail.com>
>
> Looks basically the same as v2, which means my review still applies.
>
> Message-ID: <878rdbfww1.fsf@pond.sub.org>
> https://lists.nongnu.org/archive/html/qemu-devel/2023-05/msg06699.html
>
> If you need further assistance, just ask.
>
>
[-- Attachment #2: Type: text/html, Size: 1505 bytes --]
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v3 3/3] cpu, softmmu/vl.c: Change parsing of -cpu argument to allow -cpu cpu,help to print options for the CPU type similar to how the '-device' option works.
2023-08-01 21:00 ` [PATCH v3 3/3] cpu, softmmu/vl.c: Change parsing of -cpu argument to allow -cpu cpu, help " Dinah B
@ 2023-08-02 5:36 ` Markus Armbruster
2023-11-14 16:22 ` [PATCH v3 3/3] cpu, softmmu/vl.c: Change parsing of -cpu argument to allow -cpu cpu, help " Dinah B
0 siblings, 1 reply; 17+ messages in thread
From: Markus Armbruster @ 2023-08-02 5:36 UTC (permalink / raw)
To: Dinah B
Cc: qemu-devel, Eduardo Habkost, Marcel Apfelbaum,
Philippe Mathieu-Daudé, Yanan Wang, Paolo Bonzini
Dinah B <dinahbaum123@gmail.com> writes:
> Thanks, I will fix this. I somehow didn't catch that you had replied to the
> old one.
Happens :)
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v3 3/3] cpu, softmmu/vl.c: Change parsing of -cpu argument to allow -cpu cpu, help to print options for the CPU type similar to how the '-device' option works.
2023-08-02 5:36 ` [PATCH v3 3/3] cpu, softmmu/vl.c: Change parsing of -cpu argument to allow -cpu cpu,help " Markus Armbruster
@ 2023-11-14 16:22 ` Dinah B
2023-11-14 17:44 ` [PATCH v3 3/3] cpu, softmmu/vl.c: Change parsing of -cpu argument to allow -cpu cpu,help " Markus Armbruster
0 siblings, 1 reply; 17+ messages in thread
From: Dinah B @ 2023-11-14 16:22 UTC (permalink / raw)
To: Markus Armbruster
Cc: qemu-devel, Eduardo Habkost, Marcel Apfelbaum,
Philippe Mathieu-Daudé, Yanan Wang, Paolo Bonzini
[-- Attachment #1: Type: text/plain, Size: 437 bytes --]
Hi,
Is there a way to distinguish between qemu-system-* vs qemu-* builds?
At first I thought #CONFIG_LINUX_USER might be it but not all non-mmu
builds set this.
Thanks,
-Dinah
On Wed, Aug 2, 2023 at 1:36 AM Markus Armbruster <armbru@redhat.com> wrote:
> Dinah B <dinahbaum123@gmail.com> writes:
>
> > Thanks, I will fix this. I somehow didn't catch that you had replied to
> the
> > old one.
>
> Happens :)
>
>
[-- Attachment #2: Type: text/html, Size: 900 bytes --]
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v3 3/3] cpu, softmmu/vl.c: Change parsing of -cpu argument to allow -cpu cpu,help to print options for the CPU type similar to how the '-device' option works.
2023-11-14 16:22 ` [PATCH v3 3/3] cpu, softmmu/vl.c: Change parsing of -cpu argument to allow -cpu cpu, help " Dinah B
@ 2023-11-14 17:44 ` Markus Armbruster
2023-12-11 6:02 ` [PATCH v3 3/3] cpu, softmmu/vl.c: Change parsing of -cpu argument to allow -cpu cpu, help " Dinah B
0 siblings, 1 reply; 17+ messages in thread
From: Markus Armbruster @ 2023-11-14 17:44 UTC (permalink / raw)
To: Dinah B
Cc: qemu-devel, Eduardo Habkost, Marcel Apfelbaum,
Philippe Mathieu-Daudé, Yanan Wang, Paolo Bonzini
Dinah B <dinahbaum123@gmail.com> writes:
> Hi,
>
> Is there a way to distinguish between qemu-system-* vs qemu-* builds?
> At first I thought #CONFIG_LINUX_USER might be it but not all non-mmu
> builds set this.
What are you trying to accomplish?
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v3 3/3] cpu, softmmu/vl.c: Change parsing of -cpu argument to allow -cpu cpu, help to print options for the CPU type similar to how the '-device' option works.
2023-11-14 17:44 ` [PATCH v3 3/3] cpu, softmmu/vl.c: Change parsing of -cpu argument to allow -cpu cpu,help " Markus Armbruster
@ 2023-12-11 6:02 ` Dinah B
0 siblings, 0 replies; 17+ messages in thread
From: Dinah B @ 2023-12-11 6:02 UTC (permalink / raw)
To: Markus Armbruster
Cc: qemu-devel, Eduardo Habkost, Marcel Apfelbaum,
Philippe Mathieu-Daudé, Yanan Wang, Paolo Bonzini
[-- Attachment #1: Type: text/plain, Size: 756 bytes --]
Hi,
Due to extracting CPU features via a qmp command, it only works on
qemu-system-* builds.
Building qmp for non system builds strikes me as extreme overkill so I need
a way to exclude this from non system builds.
Or maybe there's a way to disentangle querying CPU features independent
from the qom or qmp based data structures it's currently intertwined with.
Thanks,
-Dinah
On Tue, Nov 14, 2023 at 12:44 PM Markus Armbruster <armbru@redhat.com>
wrote:
> Dinah B <dinahbaum123@gmail.com> writes:
>
> > Hi,
> >
> > Is there a way to distinguish between qemu-system-* vs qemu-* builds?
> > At first I thought #CONFIG_LINUX_USER might be it but not all non-mmu
> > builds set this.
>
> What are you trying to accomplish?
>
>
[-- Attachment #2: Type: text/html, Size: 1257 bytes --]
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v3 0/3] Enable -cpu <cpu>,help
2023-07-30 6:40 [PATCH v3 0/3] Enable -cpu <cpu>,help Dinah Baum
` (2 preceding siblings ...)
2023-07-30 6:40 ` [PATCH v3 3/3] cpu, softmmu/vl.c: Change parsing of -cpu argument to allow -cpu cpu, help to print options for the CPU type similar to how the '-device' option works Dinah Baum
@ 2023-07-30 15:15 ` Peter Maydell
3 siblings, 0 replies; 17+ messages in thread
From: Peter Maydell @ 2023-07-30 15:15 UTC (permalink / raw)
To: Dinah Baum; +Cc: qemu-devel, Markus Armbruster
On Sun, 30 Jul 2023 at 08:21, Dinah Baum <dinahbaum123@gmail.com> wrote:
>
> This patch adds the ability to query for CPU
> features. Currently it is limited to the architecture that
> support feature probing (arm, i386, and s390x).
>
> Ex:
> athlon features:
> 3dnow=<qbool>
> 3dnowext=<qbool>
> 3dnowprefetch=<qbool>
> ...
>
> Suggested-by: Peter Maydell
> Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1480
Ccing Markus for review of the option parsing parts...
thanks
-- PMM
>
> Dinah Baum (3):
> qapi: Moved architecture agnostic data types to `machine`
> qapi, target/: Enable 'query-cpu-model-expansion' on all architectures
> cpu, softmmu/vl.c: Change parsing of -cpu argument to allow -cpu
> cpu,help to print options for the CPU type similar to how the
> '-device' option works.
>
> cpu.c | 61 ++++++++++++++
> include/exec/cpu-common.h | 7 ++
> include/qapi/qmp/qdict.h | 1 +
> qapi/machine-target.json | 138 +------------------------------
> qapi/machine.json | 130 +++++++++++++++++++++++++++++
> qemu-options.hx | 7 +-
> qobject/qdict.c | 5 ++
> softmmu/vl.c | 35 +++++++-
> target/arm/arm-qmp-cmds.c | 7 +-
> target/arm/cpu.h | 7 ++
> target/i386/cpu-sysemu.c | 7 +-
> target/i386/cpu.h | 6 ++
> target/s390x/cpu.h | 7 ++
> target/s390x/cpu_models_sysemu.c | 6 +-
> 14 files changed, 273 insertions(+), 151 deletions(-)
>
^ permalink raw reply [flat|nested] 17+ messages in thread