All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/6] qapi: introduce the SysEmuTarget enumeration
@ 2018-04-24 21:45 Laszlo Ersek
  2018-04-24 21:45 ` [Qemu-devel] [PATCH 1/6] qapi: fill in CpuInfoFast.arch in query-cpus-fast Laszlo Ersek
                   ` (6 more replies)
  0 siblings, 7 replies; 46+ messages in thread
From: Laszlo Ersek @ 2018-04-24 21:45 UTC (permalink / raw)
  To: qemu-devel
  Cc: Daniel P. Berrange, Bastian Koppelmann, David Gibson, Eric Blake,
	Gerd Hoffmann, Kashyap Chamarthy, Laurent Vivier,
	Markus Armbruster, Michael Clark, Palmer Dabbelt, Paolo Bonzini,
	Peter Crosthwaite, Richard Henderson, Riku Voipio,
	Sagar Karandikar, Thomas Huth

This patch set adds the @SysEmuTarget enum type, and rebases a few other
types to it. Here's the "anatomy" of the series:

- Patches #1 and #2 fix QAPI bugs that have crept in in the 2.12
  development cycle. I noticed the bugs while working on patch #6; i.e.
  patch #6 depends on #1 and #2. The issues should likely be fixed in
  2.12.1, so patches #1 and #2 are CC'd to qemu-stable.

- Patch #3 is what I primarily care about in this series. It introduces
  the @SysEmuTarget enum, for the sake of my end-goal patch at:

    [Qemu-devel] [qemu RFC v3 3/3] qapi: add "firmware.json"
    http://mid.mail-archive.com/20180420231246.23130-4-lersek@redhat.com

  (BTW review comments for that RFCv3 patch are still super welcome).

- Patch #4 is a small cleanup that utilizes @SysEmuTarget, rebasing
  @TargetInfo to it.

- Patch #5 is an attempt at normalizing @CpuInfo and @CpuInfoFast, by
  factoring out @CpuInfoCommon. I'm proposing this in order to save some
  busy-work for patch #6. If patch #5 is doing the wrong thing, it can
  be dropped, with relatively small updates to patch #6.

- Patch #6 demotes the current discriminator field of @CpuInfo and
  @CpuInfoFast, namely @arch (of type @CpuInfoArch), to "normal base
  struct field", and introduces @target (of type @SysEmuTarget) in its
  place. This is a pretty intrusive patch which caused me hours of
  struggle. Similarly to patch #4, the goal is to help clean up the fuzz
  around the "target architecture" concept in QAPI. I'm proposing this
  patch because Markus suggested that I might try :) If significantly
  more work was necessary to hammer this patch into acceptable shape,
  then I'd prefer to limit the scope, just add @target, and keep @arch
  as the discriminator.

Sorry about the humongous CC list.

Cc: "Daniel P. Berrange" <berrange@redhat.com>
Cc: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
Cc: David Gibson <dgibson@redhat.com>
Cc: Eric Blake <eblake@redhat.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Kashyap Chamarthy <kchamart@redhat.com>
Cc: Laurent Vivier <laurent@vivier.eu>
Cc: Markus Armbruster <armbru@redhat.com>
Cc: Michael Clark <mjc@sifive.com>
Cc: Palmer Dabbelt <palmer@sifive.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Peter Crosthwaite <crosthwaite.peter@gmail.com>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Riku Voipio <riku.voipio@iki.fi>
Cc: Sagar Karandikar <sagark@eecs.berkeley.edu>
Cc: Thomas Huth <thuth@redhat.com>

Thanks
Laszlo

Laszlo Ersek (6):
  qapi: fill in CpuInfoFast.arch in query-cpus-fast
  qapi: handle the riscv CpuInfoArch in query-cpus-fast
  qapi: add SysEmuTarget to "common.json"
  qapi: change the type of TargetInfo.arch from string to enum
    SysEmuTarget
  qapi: extract CpuInfoCommon to mitigate schema duplication
  qapi: discriminate CpuInfo[Fast] on SysEmuTarget, not CpuInfoArch

 qapi/common.json                    |  19 +++
 qapi/misc.json                      | 196 ++++++++++++++++++++-------
 qapi/qapi-schema.json               |   2 +-
 arch_init.c                         |  10 +-
 cpus.c                              | 261 ++++++++++++++++++++++++++++--------
 tests/test-x86-cpuid-compat.c       |   2 +-
 tests/migration/guestperf/engine.py |   2 +-
 7 files changed, 380 insertions(+), 112 deletions(-)

-- 
2.14.1.3.gb7cf6e02401b

^ permalink raw reply	[flat|nested] 46+ messages in thread

* [Qemu-devel] [PATCH 1/6] qapi: fill in CpuInfoFast.arch in query-cpus-fast
  2018-04-24 21:45 [Qemu-devel] [PATCH 0/6] qapi: introduce the SysEmuTarget enumeration Laszlo Ersek
@ 2018-04-24 21:45 ` Laszlo Ersek
  2018-04-24 22:30   ` Eric Blake
                     ` (2 more replies)
  2018-04-24 21:45 ` [Qemu-devel] [PATCH 2/6] qapi: handle the riscv CpuInfoArch " Laszlo Ersek
                   ` (5 subsequent siblings)
  6 siblings, 3 replies; 46+ messages in thread
From: Laszlo Ersek @ 2018-04-24 21:45 UTC (permalink / raw)
  To: qemu-devel
  Cc: Eric Blake, Markus Armbruster, Paolo Bonzini, Peter Crosthwaite,
	Richard Henderson, qemu-stable

Commit ca230ff33f89 added added the @arch field to @CpuInfoFast, but it
failed to set the new field in qmp_query_cpus_fast(), when TARGET_S390X
was not defined. The updated @query-cpus-fast example in
"qapi-schema.json" showed "arch":"x86" only because qmp_query_cpus_fast()
calls g_malloc0() to allocate CpuInfoFast, and the CPU_INFO_ARCH_X86 enum
constant is generated with value 0.

All @arch values other than @s390 implied the @CpuInfoOther sub-struct for
@CpuInfoFast -- at the time of writing the patch --, thus no fields other
than @arch needed to be set when TARGET_S390X was not defined. Set @arch
now, by copying the corresponding assignments from qmp_query_cpus().

Cc: Eric Blake <eblake@redhat.com>
Cc: Markus Armbruster <armbru@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Peter Crosthwaite <crosthwaite.peter@gmail.com>
Cc: Richard Henderson <rth@twiddle.net>
Cc: qemu-stable@nongnu.org
Fixes: ca230ff33f89bf7102cbfbc2328716da6750aaed
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
---

Notes:
    PATCHv1:
    
    - new patch

 cpus.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/cpus.c b/cpus.c
index 38eba8bff334..1a9a2edee1f2 100644
--- a/cpus.c
+++ b/cpus.c
@@ -2210,27 +2210,39 @@ CpuInfoFastList *qmp_query_cpus_fast(Error **errp)
         info->value->qom_path = object_get_canonical_path(OBJECT(cpu));
         info->value->thread_id = cpu->thread_id;
 
         info->value->has_props = !!mc->cpu_index_to_instance_props;
         if (info->value->has_props) {
             CpuInstanceProperties *props;
             props = g_malloc0(sizeof(*props));
             *props = mc->cpu_index_to_instance_props(ms, cpu->cpu_index);
             info->value->props = props;
         }
 
-#if defined(TARGET_S390X)
+#if defined(TARGET_I386)
+        info->value->arch = CPU_INFO_ARCH_X86;
+#elif defined(TARGET_PPC)
+        info->value->arch = CPU_INFO_ARCH_PPC;
+#elif defined(TARGET_SPARC)
+        info->value->arch = CPU_INFO_ARCH_SPARC;
+#elif defined(TARGET_MIPS)
+        info->value->arch = CPU_INFO_ARCH_MIPS;
+#elif defined(TARGET_TRICORE)
+        info->value->arch = CPU_INFO_ARCH_TRICORE;
+#elif defined(TARGET_S390X)
         s390_cpu = S390_CPU(cpu);
         env = &s390_cpu->env;
         info->value->arch = CPU_INFO_ARCH_S390;
         info->value->u.s390.cpu_state = env->cpu_state;
+#else
+        info->value->arch = CPU_INFO_ARCH_OTHER;
 #endif
         if (!cur_item) {
             head = cur_item = info;
         } else {
             cur_item->next = info;
             cur_item = info;
         }
     }
 
     return head;
 }
-- 
2.14.1.3.gb7cf6e02401b

^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [Qemu-devel] [PATCH 2/6] qapi: handle the riscv CpuInfoArch in query-cpus-fast
  2018-04-24 21:45 [Qemu-devel] [PATCH 0/6] qapi: introduce the SysEmuTarget enumeration Laszlo Ersek
  2018-04-24 21:45 ` [Qemu-devel] [PATCH 1/6] qapi: fill in CpuInfoFast.arch in query-cpus-fast Laszlo Ersek
@ 2018-04-24 21:45 ` Laszlo Ersek
  2018-04-24 22:32   ` Eric Blake
  2018-04-25  6:44   ` Markus Armbruster
  2018-04-24 21:45 ` [Qemu-devel] [PATCH 3/6] qapi: add SysEmuTarget to "common.json" Laszlo Ersek
                   ` (4 subsequent siblings)
  6 siblings, 2 replies; 46+ messages in thread
From: Laszlo Ersek @ 2018-04-24 21:45 UTC (permalink / raw)
  To: qemu-devel
  Cc: Bastian Koppelmann, Eric Blake, Laurent Vivier,
	Markus Armbruster, Michael Clark, Palmer Dabbelt, Paolo Bonzini,
	Peter Crosthwaite, Richard Henderson, Riku Voipio,
	Sagar Karandikar, qemu-stable

Commit 25fa194b7b11 added the @riscv enum constant to @CpuInfoArch (used
in both @CpuInfo and @CpuInfoFast -- the return types of the @query-cpus
and @query-cpus-fast commands, respectively), and assigned, in both return
structures, the @CpuInfoRISCV sub-structure to the new enum value.

However, qmp_query_cpus_fast() would not populate either the @arch field
or the @CpuInfoRISCV sub-structure, when TARGET_RISCV was defined; only
qmp_query_cpus() would.

In theory, there are two ways to fix this:

(a) Fill in both the @arch field and the @CpuInfoRISCV sub-structure in
    qmp_query_cpus_fast(), by copying the logic from qmp_query_cpus().

(b) Assign @CpuInfoOther to the @riscv enum constant in @CpuInfoFast, and
    populate only the @arch field in qmp_query_cpus_fast().

Approach (b) seems more robust, because:

- clearly there has never been an attempt to get actual RISV CPU state
  from qmp_query_cpus_fast(), so its lack of RISCV support is not actually
  a problem,

- getting CPU state without interrupting KVM looks like an exceptional
  thing to do (only S390X does it currently).

Cc: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
Cc: Eric Blake <eblake@redhat.com>
Cc: Laurent Vivier <laurent@vivier.eu>
Cc: Markus Armbruster <armbru@redhat.com>
Cc: Michael Clark <mjc@sifive.com>
Cc: Palmer Dabbelt <palmer@sifive.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Peter Crosthwaite <crosthwaite.peter@gmail.com>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Riku Voipio <riku.voipio@iki.fi>
Cc: Sagar Karandikar <sagark@eecs.berkeley.edu>
Cc: qemu-stable@nongnu.org
Fixes: 25fa194b7b11901561532e435beb83d046899f7a
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
---

Notes:
    PATCHv1:
    
    - new patch

 qapi/misc.json | 2 +-
 cpus.c         | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/qapi/misc.json b/qapi/misc.json
index 5636f4a14997..104d013adba6 100644
--- a/qapi/misc.json
+++ b/qapi/misc.json
@@ -565,23 +565,23 @@
 { 'union': 'CpuInfoFast',
   'base': {'cpu-index': 'int', 'qom-path': 'str',
            'thread-id': 'int', '*props': 'CpuInstanceProperties',
            'arch': 'CpuInfoArch' },
   'discriminator': 'arch',
   'data': { 'x86': 'CpuInfoOther',
             'sparc': 'CpuInfoOther',
             'ppc': 'CpuInfoOther',
             'mips': 'CpuInfoOther',
             'tricore': 'CpuInfoOther',
             's390': 'CpuInfoS390',
-            'riscv': 'CpuInfoRISCV',
+            'riscv': 'CpuInfoOther',
             'other': 'CpuInfoOther' } }
 
 ##
 # @query-cpus-fast:
 #
 # Returns information about all virtual CPUs. This command does not
 # incur a performance penalty and should be used in production
 # instead of query-cpus.
 #
 # Returns: list of @CpuInfoFast
 #
diff --git a/cpus.c b/cpus.c
index 1a9a2edee1f2..60563a6d54ec 100644
--- a/cpus.c
+++ b/cpus.c
@@ -2225,22 +2225,24 @@ CpuInfoFastList *qmp_query_cpus_fast(Error **errp)
 #elif defined(TARGET_SPARC)
         info->value->arch = CPU_INFO_ARCH_SPARC;
 #elif defined(TARGET_MIPS)
         info->value->arch = CPU_INFO_ARCH_MIPS;
 #elif defined(TARGET_TRICORE)
         info->value->arch = CPU_INFO_ARCH_TRICORE;
 #elif defined(TARGET_S390X)
         s390_cpu = S390_CPU(cpu);
         env = &s390_cpu->env;
         info->value->arch = CPU_INFO_ARCH_S390;
         info->value->u.s390.cpu_state = env->cpu_state;
+#elif defined(TARGET_RISCV)
+        info->value->arch = CPU_INFO_ARCH_RISCV;
 #else
         info->value->arch = CPU_INFO_ARCH_OTHER;
 #endif
         if (!cur_item) {
             head = cur_item = info;
         } else {
             cur_item->next = info;
             cur_item = info;
         }
     }
 
-- 
2.14.1.3.gb7cf6e02401b

^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [Qemu-devel] [PATCH 3/6] qapi: add SysEmuTarget to "common.json"
  2018-04-24 21:45 [Qemu-devel] [PATCH 0/6] qapi: introduce the SysEmuTarget enumeration Laszlo Ersek
  2018-04-24 21:45 ` [Qemu-devel] [PATCH 1/6] qapi: fill in CpuInfoFast.arch in query-cpus-fast Laszlo Ersek
  2018-04-24 21:45 ` [Qemu-devel] [PATCH 2/6] qapi: handle the riscv CpuInfoArch " Laszlo Ersek
@ 2018-04-24 21:45 ` Laszlo Ersek
  2018-04-24 23:11   ` Eric Blake
  2018-04-24 21:45 ` [Qemu-devel] [PATCH 4/6] qapi: change the type of TargetInfo.arch from string to enum SysEmuTarget Laszlo Ersek
                   ` (3 subsequent siblings)
  6 siblings, 1 reply; 46+ messages in thread
From: Laszlo Ersek @ 2018-04-24 21:45 UTC (permalink / raw)
  To: qemu-devel
  Cc: Daniel P. Berrange, David Gibson, Eric Blake, Gerd Hoffmann,
	Kashyap Chamarthy, Markus Armbruster, Paolo Bonzini, Thomas Huth

We'll soon need an enumeration type that lists all the softmmu targets
that QEMU (the project) supports. Introduce @SysEmuTarget to
"common.json".

Cc: "Daniel P. Berrange" <berrange@redhat.com>
Cc: David Gibson <dgibson@redhat.com>
Cc: Eric Blake <eblake@redhat.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Kashyap Chamarthy <kchamart@redhat.com>
Cc: Markus Armbruster <armbru@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Thomas Huth <thuth@redhat.com>
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Kashyap Chamarthy <kchamart@redhat.com>
---

Notes:
    PATCHv1:
    
    - pick up R-b's from Markus and Kashyap, no changes
    
    RFCv3:
    
    - The patch is new in this version. [Dan, Markus]
    
    - The original idea was to call the new enum @Target; however, @Target
      generates exactly the TARGET_AARCH64, TARGET_ALPHA, TARGET_ARM, ...
      enumeration constants that conflict with the poisoned preprocessing
      macros of the same names. Hence @SysEmuTarget -- it's more accurate
      anyway, since we want it to stand for system emulation targets.
    
    - Also, we discussed defining the new type in either "common.json" or
      "misc.json". "misc.json" turned out to be a problem: "firmware.json"
      would then include "misc.json" for the new type's sake, but that
      inclusion would become the first appearance of "misc.json" -- within
      "firmware.json". That messed up the generated documentation. By adding
      the new type to "common.json", "misc.json" (see the 2nd patch) and
      "firmware.json" (see the 3rd patch) can both consume the new type
      without problems.

 qapi/common.json | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/qapi/common.json b/qapi/common.json
index d9b14dd429f3..1fd63172754a 100644
--- a/qapi/common.json
+++ b/qapi/common.json
@@ -118,11 +118,30 @@
 #
 # @bar3: PCI BAR3 is used for the feature
 #
 # @bar4: PCI BAR4 is used for the feature
 #
 # @bar5: PCI BAR5 is used for the feature
 #
 # Since: 2.12
 ##
 { 'enum': 'OffAutoPCIBAR',
   'data': [ 'off', 'auto', 'bar0', 'bar1', 'bar2', 'bar3', 'bar4', 'bar5' ] }
+
+##
+# @SysEmuTarget:
+#
+# The comprehensive enumeration of QEMU system emulation ("softmmu")
+# targets. Run "./configure --help" in the project root directory, and
+# look for the *-softmmu targets near the "--target-list" option. The
+# individual target constants are not documented here, for the time
+# being.
+#
+# Since: 2.13
+##
+{ 'enum' : 'SysEmuTarget',
+  'data' : [ 'aarch64', 'alpha', 'arm', 'cris', 'hppa', 'i386', 'lm32',
+             'm68k', 'microblaze', 'microblazeel', 'mips', 'mips64',
+             'mips64el', 'mipsel', 'moxie', 'nios2', 'or1k', 'ppc',
+             'ppc64', 'ppcemb', 'riscv32', 'riscv64', 's390x', 'sh4',
+             'sh4eb', 'sparc', 'sparc64', 'tricore', 'unicore32',
+             'x86_64', 'xtensa', 'xtensaeb' ] }
-- 
2.14.1.3.gb7cf6e02401b

^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [Qemu-devel] [PATCH 4/6] qapi: change the type of TargetInfo.arch from string to enum SysEmuTarget
  2018-04-24 21:45 [Qemu-devel] [PATCH 0/6] qapi: introduce the SysEmuTarget enumeration Laszlo Ersek
                   ` (2 preceding siblings ...)
  2018-04-24 21:45 ` [Qemu-devel] [PATCH 3/6] qapi: add SysEmuTarget to "common.json" Laszlo Ersek
@ 2018-04-24 21:45 ` Laszlo Ersek
  2018-04-25  6:48   ` Markus Armbruster
  2018-04-24 21:45 ` [Qemu-devel] [PATCH 5/6] qapi: extract CpuInfoCommon to mitigate schema duplication Laszlo Ersek
                   ` (2 subsequent siblings)
  6 siblings, 1 reply; 46+ messages in thread
From: Laszlo Ersek @ 2018-04-24 21:45 UTC (permalink / raw)
  To: qemu-devel
  Cc: Daniel P. Berrange, David Gibson, Eric Blake, Gerd Hoffmann,
	Kashyap Chamarthy, Markus Armbruster, Paolo Bonzini, Thomas Huth

Now that we have @SysEmuTarget, it makes sense to restict
@TargetInfo.@arch to valid sysemu targets at the schema level.

Cc: "Daniel P. Berrange" <berrange@redhat.com>
Cc: David Gibson <dgibson@redhat.com>
Cc: Eric Blake <eblake@redhat.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Kashyap Chamarthy <kchamart@redhat.com>
Cc: Markus Armbruster <armbru@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Thomas Huth <thuth@redhat.com>
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
---

Notes:
    PATCHv1:
    
    - qmp_query_target(): pass (-1) as fallback value [Markus]
    - qmp_query_target(): catch lookup error with error_abort [Markus]
    
    RFCv3:
    
    - The patch is new in this version. [Markus]

 qapi/misc.json |  6 ++++--
 arch_init.c    | 10 +++++++++-
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/qapi/misc.json b/qapi/misc.json
index 104d013adba6..460866cf542f 100644
--- a/qapi/misc.json
+++ b/qapi/misc.json
@@ -1,18 +1,20 @@
 # -*- Mode: Python -*-
 #
 
 ##
 # = Miscellanea
 ##
 
+{ 'include': 'common.json' }
+
 ##
 # @qmp_capabilities:
 #
 # Enable QMP capabilities.
 #
 # Arguments:
 #
 # @enable:   An optional list of QMPCapability values to enable.  The
 #            client must not enable any capability that is not
 #            mentioned in the QMP greeting message.  If the field is not
 #            provided, it means no QMP capabilities will be enabled.
@@ -2441,28 +2443,28 @@
 #      ]
 #    }
 #
 ##
 { 'command': 'query-fdsets', 'returns': ['FdsetInfo'] }
 
 ##
 # @TargetInfo:
 #
 # Information describing the QEMU target.
 #
-# @arch: the target architecture (eg "x86_64", "i386", etc)
+# @arch: the target architecture
 #
 # Since: 1.2.0
 ##
 { 'struct': 'TargetInfo',
-  'data': { 'arch': 'str' } }
+  'data': { 'arch': 'SysEmuTarget' } }
 
 ##
 # @query-target:
 #
 # Return information about the target for this QEMU
 #
 # Returns: TargetInfo
 #
 # Since: 1.2.0
 ##
 { 'command': 'query-target', 'returns': 'TargetInfo' }
diff --git a/arch_init.c b/arch_init.c
index 6ee07478bd11..ee3a57019000 100644
--- a/arch_init.c
+++ b/arch_init.c
@@ -21,22 +21,23 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
 #include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "cpu.h"
 #include "sysemu/sysemu.h"
 #include "sysemu/arch_init.h"
 #include "hw/pci/pci.h"
 #include "hw/audio/soundhw.h"
 #include "qapi/qapi-commands-misc.h"
+#include "qapi/error.h"
 #include "qemu/config-file.h"
 #include "qemu/error-report.h"
 #include "hw/acpi/acpi.h"
 #include "qemu/help_option.h"
 
 #ifdef TARGET_SPARC
 int graphic_width = 1024;
 int graphic_height = 768;
 int graphic_depth = 8;
 #else
 int graphic_width = 800;
@@ -104,15 +105,22 @@ int xen_available(void)
     return 1;
 #else
     return 0;
 #endif
 }
 
 
 TargetInfo *qmp_query_target(Error **errp)
 {
     TargetInfo *info = g_malloc0(sizeof(*info));
 
-    info->arch = g_strdup(TARGET_NAME);
+    /*
+     * The fallback enum value is irrelevant here (TARGET_NAME is a
+     * macro and can never be NULL), so simply pass (-1). Also, the
+     * lookup should never fail -- if it fails, then @SysEmuTarget needs
+     * extending. Catch that with "error_abort".
+     */
+    info->arch = qapi_enum_parse(&SysEmuTarget_lookup, TARGET_NAME, -1,
+                                 &error_abort);
 
     return info;
 }
-- 
2.14.1.3.gb7cf6e02401b

^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [Qemu-devel] [PATCH 5/6] qapi: extract CpuInfoCommon to mitigate schema duplication
  2018-04-24 21:45 [Qemu-devel] [PATCH 0/6] qapi: introduce the SysEmuTarget enumeration Laszlo Ersek
                   ` (3 preceding siblings ...)
  2018-04-24 21:45 ` [Qemu-devel] [PATCH 4/6] qapi: change the type of TargetInfo.arch from string to enum SysEmuTarget Laszlo Ersek
@ 2018-04-24 21:45 ` Laszlo Ersek
  2018-04-25  7:06   ` Markus Armbruster
  2018-04-24 21:45 ` [Qemu-devel] [PATCH 6/6] qapi: discriminate CpuInfo[Fast] on SysEmuTarget, not CpuInfoArch Laszlo Ersek
  2018-04-24 22:03 ` [Qemu-devel] [PATCH 0/6] qapi: introduce the SysEmuTarget enumeration no-reply
  6 siblings, 1 reply; 46+ messages in thread
From: Laszlo Ersek @ 2018-04-24 21:45 UTC (permalink / raw)
  To: qemu-devel; +Cc: Eric Blake, Markus Armbruster

@CpuInfo and @CpuInfoFast duplicate the following four fields: @qom-path,
@thread-id, @props and @arch. From these, extract the first three to a
common structure called @CpuInfoCommon. (More on @arch later.)

Introduce two new mid-layer structures, @CpuInfoBase and @CpuInfoFastBase,
to soak up the union base struct fields on top of @CpuInfoCommon that are
specific to @query-cpus and @query-cpus-fast, respectively. This is
necessary because the base struct spec in union definitions does not let
us mix named fields with a recursive base struct. (In other words, we
couldn't directly use @CpuInfoCommon *plus* some other fields within
@CpuInfo and @CpuInfoFast as base struct).

@arch cannot be hoisted higher than to @CpuInfoBase and @CpuInfoFastBase
because the union descriminator is only accepted from a direct base
struct, not from an indirect one.

Cc: Eric Blake <eblake@redhat.com>
Cc: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
---

Notes:
    PATCHv1:
    
    - new patch

 qapi/misc.json                      | 94 +++++++++++++++++++++++++------------
 qapi/qapi-schema.json               |  2 +-
 tests/test-x86-cpuid-compat.c       |  2 +-
 tests/migration/guestperf/engine.py |  2 +-
 4 files changed, 68 insertions(+), 32 deletions(-)

diff --git a/qapi/misc.json b/qapi/misc.json
index 460866cf542f..d7b776a5af37 100644
--- a/qapi/misc.json
+++ b/qapi/misc.json
@@ -348,52 +348,81 @@
 #
 # @s390: since 2.12
 #
 # @riscv: since 2.12
 #
 # Since: 2.6
 ##
 { 'enum': 'CpuInfoArch',
   'data': ['x86', 'sparc', 'ppc', 'mips', 'tricore', 's390', 'riscv', 'other' ] }
 
 ##
-# @CpuInfo:
+# @CpuInfoCommon:
 #
-# Information about a virtual CPU
+# Collects fields common to @CpuInfoBase and @CpuInfoFastBase; that is,
+# fields that are shared by @query-cpus and @query-cpus-fast, and not
+# specific to the target architecture.
+#
+# @qom-path: path to the CPU object in the QOM tree (since 2.4)
+#
+# @thread-id: ID of the underlying host thread
+#
+# @props: properties describing which node/socket/core/thread the
+#         virtual CPU belongs to, if supported by the board (since 2.10)
+#
+# Since: 2.13
+##
+{ 'struct' : 'CpuInfoCommon',
+  'data'   : { 'qom-path'  : 'str',
+               'thread-id' : 'int',
+               '*props'    : 'CpuInstanceProperties' } }
+
+##
+# @CpuInfoBase:
+#
+# Extends @CpuInfoCommon with fields that are specific to the @query-cpus
+# command, but not specific to the target architecture.
 #
 # @CPU: the index of the virtual CPU
 #
 # @current: this only exists for backwards compatibility and should be ignored
 #
 # @halted: true if the virtual CPU is in the halt state.  Halt usually refers
 #          to a processor specific low power mode.
 #
-# @qom_path: path to the CPU object in the QOM tree (since 2.4)
-#
-# @thread_id: ID of the underlying host thread
-#
-# @props: properties describing to which node/socket/core/thread
-#         virtual CPU belongs to, provided if supported by board (since 2.10)
-#
 # @arch: architecture of the cpu, which determines which additional fields
 #        will be listed (since 2.6)
 #
-# Since: 0.14.0
+# Since: 2.13
 #
 # Notes: @halted is a transient state that changes frequently.  By the time the
 #        data is sent to the client, the guest may no longer be halted.
+#        Moreover, @arch cannot be moved up to @CpuInfoCommon because
+#        that would prevent its use as the discriminator in @CpuInfo.
+##
+{ 'struct' : 'CpuInfoBase',
+  'base'   : 'CpuInfoCommon',
+  'data'   : { 'CPU'     : 'int',
+               'current' : 'bool',
+               'halted'  : 'bool',
+               'arch'    : 'CpuInfoArch' } }
+
+##
+# @CpuInfo:
+#
+# Information about a virtual CPU
+#
+# Since: 0.14.0
 ##
 { 'union': 'CpuInfo',
-  'base': {'CPU': 'int', 'current': 'bool', 'halted': 'bool',
-           'qom_path': 'str', 'thread_id': 'int',
-           '*props': 'CpuInstanceProperties', 'arch': 'CpuInfoArch' },
+  'base': 'CpuInfoBase',
   'discriminator': 'arch',
   'data': { 'x86': 'CpuInfoX86',
             'sparc': 'CpuInfoSPARC',
             'ppc': 'CpuInfoPPC',
             'mips': 'CpuInfoMIPS',
             'tricore': 'CpuInfoTricore',
             's390': 'CpuInfoS390',
             'riscv': 'CpuInfoRISCV',
             'other': 'CpuInfoOther' } }
 
 ##
@@ -512,70 +541,77 @@
 #
 # Since: 0.14.0
 #
 # Example:
 #
 # -> { "execute": "query-cpus" }
 # <- { "return": [
 #          {
 #             "CPU":0,
 #             "current":true,
 #             "halted":false,
-#             "qom_path":"/machine/unattached/device[0]",
+#             "qom-path":"/machine/unattached/device[0]",
 #             "arch":"x86",
 #             "pc":3227107138,
-#             "thread_id":3134
+#             "thread-id":3134
 #          },
 #          {
 #             "CPU":1,
 #             "current":false,
 #             "halted":true,
-#             "qom_path":"/machine/unattached/device[2]",
+#             "qom-path":"/machine/unattached/device[2]",
 #             "arch":"x86",
 #             "pc":7108165,
-#             "thread_id":3135
+#             "thread-id":3135
 #          }
 #       ]
 #    }
 #
 # Notes: This interface is deprecated (since 2.12.0), and it is strongly
 #        recommended that you avoid using it. Use @query-cpus-fast to
 #        obtain information about virtual CPUs.
 #
 ##
 { 'command': 'query-cpus', 'returns': ['CpuInfo'] }
 
 ##
-# @CpuInfoFast:
+# @CpuInfoFastBase:
 #
-# Information about a virtual CPU
+# Extends @CpuInfoCommon with fields that are specific to the
+# @query-cpus-fast command, but not specific to the target architecture.
 #
 # @cpu-index: index of the virtual CPU
 #
-# @qom-path: path to the CPU object in the QOM tree
-#
-# @thread-id: ID of the underlying host thread
-#
-# @props: properties describing to which node/socket/core/thread
-#         virtual CPU belongs to, provided if supported by board
-#
 # @arch: architecture of the cpu, which determines which additional fields
 #        will be listed
 #
+# Since: 2.13
+#
+# Notes: @arch cannot be moved up to @CpuInfoCommon because that would
+#        prevent its use as the discriminator in @CpuInfoFast.
+##
+{ 'struct' : 'CpuInfoFastBase',
+  'base'   : 'CpuInfoCommon',
+  'data'   : { 'cpu-index' : 'int',
+               'arch'      : 'CpuInfoArch' } }
+
+##
+# @CpuInfoFast:
+#
+# Information about a virtual CPU
+#
 # Since: 2.12
 #
 ##
 { 'union': 'CpuInfoFast',
-  'base': {'cpu-index': 'int', 'qom-path': 'str',
-           'thread-id': 'int', '*props': 'CpuInstanceProperties',
-           'arch': 'CpuInfoArch' },
+  'base': 'CpuInfoFastBase',
   'discriminator': 'arch',
   'data': { 'x86': 'CpuInfoOther',
             'sparc': 'CpuInfoOther',
             'ppc': 'CpuInfoOther',
             'mips': 'CpuInfoOther',
             'tricore': 'CpuInfoOther',
             's390': 'CpuInfoS390',
             'riscv': 'CpuInfoOther',
             'other': 'CpuInfoOther' } }
 
 ##
diff --git a/qapi/qapi-schema.json b/qapi/qapi-schema.json
index 25bce78352b8..5bfd2ef1dd3b 100644
--- a/qapi/qapi-schema.json
+++ b/qapi/qapi-schema.json
@@ -61,23 +61,23 @@
         'query-migrate-cache-size',
         'query-tpm-models',
         'query-tpm-types',
         'ringbuf-read' ],
     'name-case-whitelist': [
         'ACPISlotType',         # DIMM, visible through query-acpi-ospm-status
         'CpuInfoMIPS',          # PC, visible through query-cpu
         'CpuInfoTricore',       # PC, visible through query-cpu
         'QapiErrorClass',       # all members, visible through errors
         'UuidInfo',             # UUID, visible through query-uuid
         'X86CPURegister32',     # all members, visible indirectly through qom-get
-        'q_obj_CpuInfo-base'    # CPU, visible through query-cpu
+        'CpuInfoBase'           # CPU, visible through query-cpu
     ] } }
 
 # Documentation generated with qapi-gen.py is in source order, with
 # included sub-schemas inserted at the first include directive
 # (subsequent include directives have no effect).  To get a sane and
 # stable order, it's best to include each sub-schema just once, or
 # include it first right here.
 
 { 'include': 'common.json' }
 { 'include': 'sockets.json' }
 { 'include': 'run-state.json' }
diff --git a/tests/test-x86-cpuid-compat.c b/tests/test-x86-cpuid-compat.c
index 02e41843fc9c..df51b3bbacbc 100644
--- a/tests/test-x86-cpuid-compat.c
+++ b/tests/test-x86-cpuid-compat.c
@@ -10,23 +10,23 @@ static char *get_cpu0_qom_path(void)
 {
     QDict *resp;
     QList *ret;
     QDict *cpu0;
     char *path;
 
     resp = qmp("{'execute': 'query-cpus', 'arguments': {}}");
     g_assert(qdict_haskey(resp, "return"));
     ret = qdict_get_qlist(resp, "return");
 
     cpu0 = qobject_to(QDict, qlist_peek(ret));
-    path = g_strdup(qdict_get_str(cpu0, "qom_path"));
+    path = g_strdup(qdict_get_str(cpu0, "qom-path"));
     QDECREF(resp);
     return path;
 }
 
 static QObject *qom_get(const char *path, const char *prop)
 {
     QDict *resp = qmp("{ 'execute': 'qom-get',"
                       "  'arguments': { 'path': %s,"
                       "                 'property': %s } }",
                       path, prop);
     QObject *ret = qdict_get(resp, "return");
diff --git a/tests/migration/guestperf/engine.py b/tests/migration/guestperf/engine.py
index e14d4320b239..663881c163e9 100644
--- a/tests/migration/guestperf/engine.py
+++ b/tests/migration/guestperf/engine.py
@@ -104,23 +104,23 @@ class Engine(object):
             info.get("x-cpu-throttle-percentage", 0),
         )
 
     def _migrate(self, hardware, scenario, src, dst, connect_uri):
         src_qemu_time = []
         src_vcpu_time = []
         src_pid = src.get_pid()
 
         vcpus = src.command("query-cpus")
         src_threads = []
         for vcpu in vcpus:
-            src_threads.append(vcpu["thread_id"])
+            src_threads.append(vcpu["thread-id"])
 
         # XXX how to get dst timings on remote host ?
 
         if self._verbose:
             print "Sleeping %d seconds for initial guest workload run" % self._sleep
         sleep_secs = self._sleep
         while sleep_secs > 1:
             src_qemu_time.append(self._cpu_timing(src_pid))
             src_vcpu_time.extend(self._vcpu_timing(src_pid, src_threads))
             time.sleep(1)
             sleep_secs -= 1
-- 
2.14.1.3.gb7cf6e02401b

^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [Qemu-devel] [PATCH 6/6] qapi: discriminate CpuInfo[Fast] on SysEmuTarget, not CpuInfoArch
  2018-04-24 21:45 [Qemu-devel] [PATCH 0/6] qapi: introduce the SysEmuTarget enumeration Laszlo Ersek
                   ` (4 preceding siblings ...)
  2018-04-24 21:45 ` [Qemu-devel] [PATCH 5/6] qapi: extract CpuInfoCommon to mitigate schema duplication Laszlo Ersek
@ 2018-04-24 21:45 ` Laszlo Ersek
  2018-04-25  7:33   ` Markus Armbruster
  2018-04-24 22:03 ` [Qemu-devel] [PATCH 0/6] qapi: introduce the SysEmuTarget enumeration no-reply
  6 siblings, 1 reply; 46+ messages in thread
From: Laszlo Ersek @ 2018-04-24 21:45 UTC (permalink / raw)
  To: qemu-devel
  Cc: Eric Blake, Markus Armbruster, Paolo Bonzini, Peter Crosthwaite,
	Richard Henderson

Add a new field @target (of type @SysEmuTarget) to the outputs of the
@query-cpus and @query-cpus-fast commands, which provides more information
about the emulation target than the field @arch (of type @CpuInfoArch).
Keep @arch for compatibility.

Make @target the new discriminator for the @CpuInfo and @CpuInfoFast
return structures. This lets us hoist @arch to @CpuInfoCommon, but it also
requires some gymnastics in qmp_query_cpus() and qmp_query_cpus_fast().

In particular, conditional compilation cannot be removed, because each
pair of CPU base arch structures, such as X86CPU/CPUX86State,
PowerPCCPU/CPUPPCState, SPARCCPU/CPUSPARCState, is only visible when
building QEMU for a target that maps to that CPU base arch.

Cc: Eric Blake <eblake@redhat.com>
Cc: Markus Armbruster <armbru@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Peter Crosthwaite <crosthwaite.peter@gmail.com>
Cc: Richard Henderson <rth@twiddle.net>
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
---

Notes:
    PATCHv1:
    
    - new patch

 qapi/misc.json | 118 ++++++++++++++++++-------
 cpus.c         | 275 ++++++++++++++++++++++++++++++++++++++++++---------------
 2 files changed, 291 insertions(+), 102 deletions(-)

diff --git a/qapi/misc.json b/qapi/misc.json
index d7b776a5af37..98c15880f9f0 100644
--- a/qapi/misc.json
+++ b/qapi/misc.json
@@ -361,77 +361,105 @@
 # Collects fields common to @CpuInfoBase and @CpuInfoFastBase; that is,
 # fields that are shared by @query-cpus and @query-cpus-fast, and not
 # specific to the target architecture.
 #
 # @qom-path: path to the CPU object in the QOM tree (since 2.4)
 #
 # @thread-id: ID of the underlying host thread
 #
 # @props: properties describing which node/socket/core/thread the
 #         virtual CPU belongs to, if supported by the board (since 2.10)
 #
+# @arch: base architecture of the cpu (since 2.6)
+#
 # Since: 2.13
 ##
 { 'struct' : 'CpuInfoCommon',
   'data'   : { 'qom-path'  : 'str',
                'thread-id' : 'int',
-               '*props'    : 'CpuInstanceProperties' } }
+               '*props'    : 'CpuInstanceProperties',
+               'arch'      : 'CpuInfoArch' } }
 
 ##
 # @CpuInfoBase:
 #
 # Extends @CpuInfoCommon with fields that are specific to the @query-cpus
 # command, but not specific to the target architecture.
 #
 # @CPU: the index of the virtual CPU
 #
 # @current: this only exists for backwards compatibility and should be ignored
 #
 # @halted: true if the virtual CPU is in the halt state.  Halt usually refers
 #          to a processor specific low power mode.
 #
-# @arch: architecture of the cpu, which determines which additional fields
-#        will be listed (since 2.6)
+# @target: the QEMU system emulation target, which is more specific than
+#          @arch and determines which additional fields will be listed
+#
 #
 # Since: 2.13
 #
 # Notes: @halted is a transient state that changes frequently.  By the time the
 #        data is sent to the client, the guest may no longer be halted.
-#        Moreover, @arch cannot be moved up to @CpuInfoCommon because
+#        Moreover, @target cannot be moved up to @CpuInfoCommon because
 #        that would prevent its use as the discriminator in @CpuInfo.
 ##
 { 'struct' : 'CpuInfoBase',
   'base'   : 'CpuInfoCommon',
   'data'   : { 'CPU'     : 'int',
                'current' : 'bool',
                'halted'  : 'bool',
-               'arch'    : 'CpuInfoArch' } }
+               'target'  : 'SysEmuTarget' } }
 
 ##
 # @CpuInfo:
 #
 # Information about a virtual CPU
 #
 # Since: 0.14.0
 ##
-{ 'union': 'CpuInfo',
-  'base': 'CpuInfoBase',
-  'discriminator': 'arch',
-  'data': { 'x86': 'CpuInfoX86',
-            'sparc': 'CpuInfoSPARC',
-            'ppc': 'CpuInfoPPC',
-            'mips': 'CpuInfoMIPS',
-            'tricore': 'CpuInfoTricore',
-            's390': 'CpuInfoS390',
-            'riscv': 'CpuInfoRISCV',
-            'other': 'CpuInfoOther' } }
+{ 'union'         : 'CpuInfo',
+  'base'          : 'CpuInfoBase',
+  'discriminator' : 'target',
+  'data'          : { 'i386'         : 'CpuInfoX86',
+                      'x86_64'       : 'CpuInfoX86',
+                      'sparc'        : 'CpuInfoSPARC',
+                      'sparc64'      : 'CpuInfoSPARC',
+                      'ppc'          : 'CpuInfoPPC',
+                      'ppcemb'       : 'CpuInfoPPC',
+                      'ppc64'        : 'CpuInfoPPC',
+                      'mips'         : 'CpuInfoMIPS',
+                      'mipsel'       : 'CpuInfoMIPS',
+                      'mips64'       : 'CpuInfoMIPS',
+                      'mips64el'     : 'CpuInfoMIPS',
+                      'tricore'      : 'CpuInfoTricore',
+                      's390x'        : 'CpuInfoS390',
+                      'riscv32'      : 'CpuInfoRISCV',
+                      'riscv64'      : 'CpuInfoRISCV',
+                      'aarch64'      : 'CpuInfoOther',
+                      'alpha'        : 'CpuInfoOther',
+                      'arm'          : 'CpuInfoOther',
+                      'cris'         : 'CpuInfoOther',
+                      'hppa'         : 'CpuInfoOther',
+                      'lm32'         : 'CpuInfoOther',
+                      'm68k'         : 'CpuInfoOther',
+                      'microblaze'   : 'CpuInfoOther',
+                      'microblazeel' : 'CpuInfoOther',
+                      'moxie'        : 'CpuInfoOther',
+                      'nios2'        : 'CpuInfoOther',
+                      'or1k'         : 'CpuInfoOther',
+                      'sh4'          : 'CpuInfoOther',
+                      'sh4eb'        : 'CpuInfoOther',
+                      'unicore32'    : 'CpuInfoOther',
+                      'xtensa'       : 'CpuInfoOther',
+                      'xtensaeb'     : 'CpuInfoOther' } }
 
 ##
 # @CpuInfoX86:
 #
 # Additional information about a virtual i386 or x86_64 CPU
 #
 # @pc: the 64-bit instruction pointer
 #
 # Since: 2.6
 ##
 { 'struct': 'CpuInfoX86', 'data': { 'pc': 'int' } }
@@ -543,84 +571,110 @@
 #
 # Example:
 #
 # -> { "execute": "query-cpus" }
 # <- { "return": [
 #          {
 #             "CPU":0,
 #             "current":true,
 #             "halted":false,
 #             "qom-path":"/machine/unattached/device[0]",
 #             "arch":"x86",
+#             "target":"x86_64",
 #             "pc":3227107138,
 #             "thread-id":3134
 #          },
 #          {
 #             "CPU":1,
 #             "current":false,
 #             "halted":true,
 #             "qom-path":"/machine/unattached/device[2]",
 #             "arch":"x86",
+#             "target":"x86_64",
 #             "pc":7108165,
 #             "thread-id":3135
 #          }
 #       ]
 #    }
 #
 # Notes: This interface is deprecated (since 2.12.0), and it is strongly
 #        recommended that you avoid using it. Use @query-cpus-fast to
 #        obtain information about virtual CPUs.
 #
 ##
 { 'command': 'query-cpus', 'returns': ['CpuInfo'] }
 
 ##
 # @CpuInfoFastBase:
 #
 # Extends @CpuInfoCommon with fields that are specific to the
 # @query-cpus-fast command, but not specific to the target architecture.
 #
 # @cpu-index: index of the virtual CPU
 #
-# @arch: architecture of the cpu, which determines which additional fields
-#        will be listed
+# @target: the QEMU system emulation target, which is more specific than
+#          @arch and determines which additional fields will be listed
 #
 # Since: 2.13
 #
-# Notes: @arch cannot be moved up to @CpuInfoCommon because that would
+# Notes: @target cannot be moved up to @CpuInfoCommon because that would
 #        prevent its use as the discriminator in @CpuInfoFast.
 ##
 { 'struct' : 'CpuInfoFastBase',
   'base'   : 'CpuInfoCommon',
   'data'   : { 'cpu-index' : 'int',
-               'arch'      : 'CpuInfoArch' } }
+               'target'    : 'SysEmuTarget' } }
 
 ##
 # @CpuInfoFast:
 #
 # Information about a virtual CPU
 #
 # Since: 2.12
 #
 ##
-{ 'union': 'CpuInfoFast',
-  'base': 'CpuInfoFastBase',
-  'discriminator': 'arch',
-  'data': { 'x86': 'CpuInfoOther',
-            'sparc': 'CpuInfoOther',
-            'ppc': 'CpuInfoOther',
-            'mips': 'CpuInfoOther',
-            'tricore': 'CpuInfoOther',
-            's390': 'CpuInfoS390',
-            'riscv': 'CpuInfoOther',
-            'other': 'CpuInfoOther' } }
+{ 'union'         : 'CpuInfoFast',
+  'base'          : 'CpuInfoFastBase',
+  'discriminator' : 'target',
+  'data'          : { 'i386'         : 'CpuInfoOther',
+                      'x86_64'       : 'CpuInfoOther',
+                      'sparc'        : 'CpuInfoOther',
+                      'sparc64'      : 'CpuInfoOther',
+                      'ppc'          : 'CpuInfoOther',
+                      'ppcemb'       : 'CpuInfoOther',
+                      'ppc64'        : 'CpuInfoOther',
+                      'mips'         : 'CpuInfoOther',
+                      'mipsel'       : 'CpuInfoOther',
+                      'mips64'       : 'CpuInfoOther',
+                      'mips64el'     : 'CpuInfoOther',
+                      'tricore'      : 'CpuInfoOther',
+                      's390x'        : 'CpuInfoS390',
+                      'riscv32'      : 'CpuInfoOther',
+                      'riscv64'      : 'CpuInfoOther',
+                      'aarch64'      : 'CpuInfoOther',
+                      'alpha'        : 'CpuInfoOther',
+                      'arm'          : 'CpuInfoOther',
+                      'cris'         : 'CpuInfoOther',
+                      'hppa'         : 'CpuInfoOther',
+                      'lm32'         : 'CpuInfoOther',
+                      'm68k'         : 'CpuInfoOther',
+                      'microblaze'   : 'CpuInfoOther',
+                      'microblazeel' : 'CpuInfoOther',
+                      'moxie'        : 'CpuInfoOther',
+                      'nios2'        : 'CpuInfoOther',
+                      'or1k'         : 'CpuInfoOther',
+                      'sh4'          : 'CpuInfoOther',
+                      'sh4eb'        : 'CpuInfoOther',
+                      'unicore32'    : 'CpuInfoOther',
+                      'xtensa'       : 'CpuInfoOther',
+                      'xtensaeb'     : 'CpuInfoOther' } }
 
 ##
 # @query-cpus-fast:
 #
 # Returns information about all virtual CPUs. This command does not
 # incur a performance penalty and should be used in production
 # instead of query-cpus.
 #
 # Returns: list of @CpuInfoFast
 #
 # Since: 2.12
@@ -630,33 +684,35 @@
 # -> { "execute": "query-cpus-fast" }
 # <- { "return": [
 #         {
 #             "thread-id": 25627,
 #             "props": {
 #                 "core-id": 0,
 #                 "thread-id": 0,
 #                 "socket-id": 0
 #             },
 #             "qom-path": "/machine/unattached/device[0]",
 #             "arch":"x86",
+#             "target":"x86_64",
 #             "cpu-index": 0
 #         },
 #         {
 #             "thread-id": 25628,
 #             "props": {
 #                 "core-id": 0,
 #                 "thread-id": 0,
 #                 "socket-id": 1
 #             },
 #             "qom-path": "/machine/unattached/device[2]",
 #             "arch":"x86",
+#             "target":"x86_64",
 #             "cpu-index": 1
 #         }
 #     ]
 # }
 ##
 { 'command': 'query-cpus-fast', 'returns': [ 'CpuInfoFast' ] }
 
 ##
 # @IOThreadInfo:
 #
 # Information about an iothread
diff --git a/cpus.c b/cpus.c
index 60563a6d54ec..86eed0ffe796 100644
--- a/cpus.c
+++ b/cpus.c
@@ -2093,88 +2093,235 @@ int vm_stop_force_state(RunState state)
     }
 }
 
 void list_cpus(FILE *f, fprintf_function cpu_fprintf, const char *optarg)
 {
     /* XXX: implement xxx_cpu_list for targets that still miss it */
 #if defined(cpu_list)
     cpu_list(f, cpu_fprintf);
 #endif
 }
 
+static CpuInfoArch sysemu_target_to_cpuinfo_arch(SysEmuTarget target)
+{
+    /*
+     * The @SysEmuTarget -> @CpuInfoArch mapping below is based on the
+     * TARGET_ARCH -> TARGET_BASE_ARCH mapping in the "configure" script.
+     */
+    switch (target) {
+    case SYS_EMU_TARGET_I386:
+    case SYS_EMU_TARGET_X86_64:
+        return CPU_INFO_ARCH_X86;
+
+    case SYS_EMU_TARGET_PPC:
+    case SYS_EMU_TARGET_PPCEMB:
+    case SYS_EMU_TARGET_PPC64:
+        return CPU_INFO_ARCH_PPC;
+
+    case SYS_EMU_TARGET_SPARC:
+    case SYS_EMU_TARGET_SPARC64:
+        return CPU_INFO_ARCH_SPARC;
+
+    case SYS_EMU_TARGET_MIPS:
+    case SYS_EMU_TARGET_MIPSEL:
+    case SYS_EMU_TARGET_MIPS64:
+    case SYS_EMU_TARGET_MIPS64EL:
+        return CPU_INFO_ARCH_MIPS;
+
+    case SYS_EMU_TARGET_TRICORE:
+        return CPU_INFO_ARCH_TRICORE;
+
+    case SYS_EMU_TARGET_S390X:
+        return CPU_INFO_ARCH_S390;
+
+    case SYS_EMU_TARGET_RISCV32:
+    case SYS_EMU_TARGET_RISCV64:
+        return CPU_INFO_ARCH_RISCV;
+
+    default:
+        return CPU_INFO_ARCH_OTHER;
+    }
+}
+
+static void cpustate_to_cpuinfo_x86(CpuInfoX86 *info, const CPUState *cpu)
+{
+#ifdef TARGET_I386
+    X86CPU *x86_cpu = X86_CPU(cpu);
+    CPUX86State *env = &x86_cpu->env;
+
+    info->pc = env->eip + env->segs[R_CS].base;
+#else
+    abort();
+#endif
+}
+
+static void cpustate_to_cpuinfo_ppc(CpuInfoPPC *info, const CPUState *cpu)
+{
+#ifdef TARGET_PPC
+    PowerPCCPU *ppc_cpu = POWERPC_CPU(cpu);
+    CPUPPCState *env = &ppc_cpu->env;
+
+    info->nip = env->nip;
+#else
+    abort();
+#endif
+}
+
+static void cpustate_to_cpuinfo_sparc(CpuInfoSPARC *info, const CPUState *cpu)
+{
+#ifdef TARGET_SPARC
+    SPARCCPU *sparc_cpu = SPARC_CPU(cpu);
+    CPUSPARCState *env = &sparc_cpu->env;
+
+    info->pc = env->pc;
+    info->npc = env->npc;
+#else
+    abort();
+#endif
+}
+
+static void cpustate_to_cpuinfo_mips(CpuInfoMIPS *info, const CPUState *cpu)
+{
+#ifdef TARGET_MIPS
+    MIPSCPU *mips_cpu = MIPS_CPU(cpu);
+    CPUMIPSState *env = &mips_cpu->env;
+
+    info->PC = env->active_tc.PC;
+#else
+    abort();
+#endif
+}
+
+static void cpustate_to_cpuinfo_tricore(CpuInfoTricore *info,
+                                        const CPUState *cpu)
+{
+#ifdef TARGET_TRICORE
+    TriCoreCPU *tricore_cpu = TRICORE_CPU(cpu);
+    CPUTriCoreState *env = &tricore_cpu->env;
+
+    info->PC = env->PC;
+#else
+    abort();
+#endif
+}
+
+static void cpustate_to_cpuinfo_s390(CpuInfoS390 *info, const CPUState *cpu)
+{
+#ifdef TARGET_S390X
+    S390CPU *s390_cpu = S390_CPU(cpu);
+    CPUS390XState *env = &s390_cpu->env;
+
+    info->cpu_state = env->cpu_state;
+#else
+    abort();
+#endif
+}
+
+static void cpustate_to_cpuinfo_riscv(CpuInfoRISCV *info, const CPUState *cpu)
+{
+#ifdef TARGET_RISCV
+    RISCVCPU *riscv_cpu = RISCV_CPU(cpu);
+    CPURISCVState *env = &riscv_cpu->env;
+
+    info->pc = env->pc;
+#else
+    abort();
+#endif
+}
+
 CpuInfoList *qmp_query_cpus(Error **errp)
 {
     MachineState *ms = MACHINE(qdev_get_machine());
     MachineClass *mc = MACHINE_GET_CLASS(ms);
     CpuInfoList *head = NULL, *cur_item = NULL;
+    SysEmuTarget target = qapi_enum_parse(&SysEmuTarget_lookup, TARGET_NAME,
+                                          -1, &error_abort);
     CPUState *cpu;
 
     CPU_FOREACH(cpu) {
         CpuInfoList *info;
-#if defined(TARGET_I386)
-        X86CPU *x86_cpu = X86_CPU(cpu);
-        CPUX86State *env = &x86_cpu->env;
-#elif defined(TARGET_PPC)
-        PowerPCCPU *ppc_cpu = POWERPC_CPU(cpu);
-        CPUPPCState *env = &ppc_cpu->env;
-#elif defined(TARGET_SPARC)
-        SPARCCPU *sparc_cpu = SPARC_CPU(cpu);
-        CPUSPARCState *env = &sparc_cpu->env;
-#elif defined(TARGET_RISCV)
-        RISCVCPU *riscv_cpu = RISCV_CPU(cpu);
-        CPURISCVState *env = &riscv_cpu->env;
-#elif defined(TARGET_MIPS)
-        MIPSCPU *mips_cpu = MIPS_CPU(cpu);
-        CPUMIPSState *env = &mips_cpu->env;
-#elif defined(TARGET_TRICORE)
-        TriCoreCPU *tricore_cpu = TRICORE_CPU(cpu);
-        CPUTriCoreState *env = &tricore_cpu->env;
-#elif defined(TARGET_S390X)
-        S390CPU *s390_cpu = S390_CPU(cpu);
-        CPUS390XState *env = &s390_cpu->env;
-#endif
 
         cpu_synchronize_state(cpu);
 
         info = g_malloc0(sizeof(*info));
         info->value = g_malloc0(sizeof(*info->value));
         info->value->CPU = cpu->cpu_index;
         info->value->current = (cpu == first_cpu);
         info->value->halted = cpu->halted;
         info->value->qom_path = object_get_canonical_path(OBJECT(cpu));
         info->value->thread_id = cpu->thread_id;
-#if defined(TARGET_I386)
-        info->value->arch = CPU_INFO_ARCH_X86;
-        info->value->u.x86.pc = env->eip + env->segs[R_CS].base;
-#elif defined(TARGET_PPC)
-        info->value->arch = CPU_INFO_ARCH_PPC;
-        info->value->u.ppc.nip = env->nip;
-#elif defined(TARGET_SPARC)
-        info->value->arch = CPU_INFO_ARCH_SPARC;
-        info->value->u.q_sparc.pc = env->pc;
-        info->value->u.q_sparc.npc = env->npc;
-#elif defined(TARGET_MIPS)
-        info->value->arch = CPU_INFO_ARCH_MIPS;
-        info->value->u.q_mips.PC = env->active_tc.PC;
-#elif defined(TARGET_TRICORE)
-        info->value->arch = CPU_INFO_ARCH_TRICORE;
-        info->value->u.tricore.PC = env->PC;
-#elif defined(TARGET_S390X)
-        info->value->arch = CPU_INFO_ARCH_S390;
-        info->value->u.s390.cpu_state = env->cpu_state;
-#elif defined(TARGET_RISCV)
-        info->value->arch = CPU_INFO_ARCH_RISCV;
-        info->value->u.riscv.pc = env->pc;
-#else
-        info->value->arch = CPU_INFO_ARCH_OTHER;
-#endif
+        info->value->arch = sysemu_target_to_cpuinfo_arch(target);
+        info->value->target = target;
+
+        /*
+         * The @SysEmuTarget -> @CpuInfo mapping below is based on the
+         * TARGET_ARCH -> TARGET_BASE_ARCH mapping in the "configure" script.
+         */
+        switch (target) {
+        case SYS_EMU_TARGET_I386:
+            cpustate_to_cpuinfo_x86(&info->value->u.i386, cpu);
+            break;
+        case SYS_EMU_TARGET_X86_64:
+            cpustate_to_cpuinfo_x86(&info->value->u.x86_64, cpu);
+            break;
+
+        case SYS_EMU_TARGET_PPC:
+            cpustate_to_cpuinfo_ppc(&info->value->u.ppc, cpu);
+            break;
+        case SYS_EMU_TARGET_PPCEMB:
+            cpustate_to_cpuinfo_ppc(&info->value->u.ppcemb, cpu);
+            break;
+        case SYS_EMU_TARGET_PPC64:
+            cpustate_to_cpuinfo_ppc(&info->value->u.ppc64, cpu);
+            break;
+
+        case SYS_EMU_TARGET_SPARC:
+            cpustate_to_cpuinfo_sparc(&info->value->u.q_sparc, cpu);
+            break;
+        case SYS_EMU_TARGET_SPARC64:
+            cpustate_to_cpuinfo_sparc(&info->value->u.sparc64, cpu);
+            break;
+
+        case SYS_EMU_TARGET_MIPS:
+            cpustate_to_cpuinfo_mips(&info->value->u.q_mips, cpu);
+            break;
+        case SYS_EMU_TARGET_MIPSEL:
+            cpustate_to_cpuinfo_mips(&info->value->u.mipsel, cpu);
+            break;
+        case SYS_EMU_TARGET_MIPS64:
+            cpustate_to_cpuinfo_mips(&info->value->u.mips64, cpu);
+            break;
+        case SYS_EMU_TARGET_MIPS64EL:
+            cpustate_to_cpuinfo_mips(&info->value->u.mips64el, cpu);
+            break;
+
+        case SYS_EMU_TARGET_TRICORE:
+            cpustate_to_cpuinfo_tricore(&info->value->u.tricore, cpu);
+            break;
+
+        case SYS_EMU_TARGET_S390X:
+            cpustate_to_cpuinfo_s390(&info->value->u.s390x, cpu);
+            break;
+
+        case SYS_EMU_TARGET_RISCV32:
+            cpustate_to_cpuinfo_riscv(&info->value->u.riscv32, cpu);
+            break;
+        case SYS_EMU_TARGET_RISCV64:
+            cpustate_to_cpuinfo_riscv(&info->value->u.riscv64, cpu);
+            break;
+
+        default:
+            /* do nothing for @CpuInfoOther */
+            break;
+        }
+
         info->value->has_props = !!mc->cpu_index_to_instance_props;
         if (info->value->has_props) {
             CpuInstanceProperties *props;
             props = g_malloc0(sizeof(*props));
             *props = mc->cpu_index_to_instance_props(ms, cpu->cpu_index);
             info->value->props = props;
         }
 
         /* XXX: waiting for the qapi to support GSList */
         if (!cur_item) {
             head = cur_item = info;
@@ -2188,64 +2335,50 @@ CpuInfoList *qmp_query_cpus(Error **errp)
 }
 
 /*
  * fast means: we NEVER interrupt vCPU threads to retrieve
  * information from KVM.
  */
 CpuInfoFastList *qmp_query_cpus_fast(Error **errp)
 {
     MachineState *ms = MACHINE(qdev_get_machine());
     MachineClass *mc = MACHINE_GET_CLASS(ms);
     CpuInfoFastList *head = NULL, *cur_item = NULL;
+    SysEmuTarget target = qapi_enum_parse(&SysEmuTarget_lookup, TARGET_NAME,
+                                          -1, &error_abort);
     CPUState *cpu;
-#if defined(TARGET_S390X)
-    S390CPU *s390_cpu;
-    CPUS390XState *env;
-#endif
 
     CPU_FOREACH(cpu) {
         CpuInfoFastList *info = g_malloc0(sizeof(*info));
         info->value = g_malloc0(sizeof(*info->value));
 
         info->value->cpu_index = cpu->cpu_index;
         info->value->qom_path = object_get_canonical_path(OBJECT(cpu));
         info->value->thread_id = cpu->thread_id;
 
         info->value->has_props = !!mc->cpu_index_to_instance_props;
         if (info->value->has_props) {
             CpuInstanceProperties *props;
             props = g_malloc0(sizeof(*props));
             *props = mc->cpu_index_to_instance_props(ms, cpu->cpu_index);
             info->value->props = props;
         }
 
-#if defined(TARGET_I386)
-        info->value->arch = CPU_INFO_ARCH_X86;
-#elif defined(TARGET_PPC)
-        info->value->arch = CPU_INFO_ARCH_PPC;
-#elif defined(TARGET_SPARC)
-        info->value->arch = CPU_INFO_ARCH_SPARC;
-#elif defined(TARGET_MIPS)
-        info->value->arch = CPU_INFO_ARCH_MIPS;
-#elif defined(TARGET_TRICORE)
-        info->value->arch = CPU_INFO_ARCH_TRICORE;
-#elif defined(TARGET_S390X)
-        s390_cpu = S390_CPU(cpu);
-        env = &s390_cpu->env;
-        info->value->arch = CPU_INFO_ARCH_S390;
-        info->value->u.s390.cpu_state = env->cpu_state;
-#elif defined(TARGET_RISCV)
-        info->value->arch = CPU_INFO_ARCH_RISCV;
-#else
-        info->value->arch = CPU_INFO_ARCH_OTHER;
-#endif
+        info->value->arch = sysemu_target_to_cpuinfo_arch(target);
+        info->value->target = target;
+        if (target == SYS_EMU_TARGET_S390X) {
+            cpustate_to_cpuinfo_s390(&info->value->u.s390x, cpu);
+        } else {
+            /* do nothing for @CpuInfoOther */
+        }
+
         if (!cur_item) {
             head = cur_item = info;
         } else {
             cur_item->next = info;
             cur_item = info;
         }
     }
 
     return head;
 }
 
-- 
2.14.1.3.gb7cf6e02401b

^ permalink raw reply related	[flat|nested] 46+ messages in thread

* Re: [Qemu-devel] [PATCH 0/6] qapi: introduce the SysEmuTarget enumeration
  2018-04-24 21:45 [Qemu-devel] [PATCH 0/6] qapi: introduce the SysEmuTarget enumeration Laszlo Ersek
                   ` (5 preceding siblings ...)
  2018-04-24 21:45 ` [Qemu-devel] [PATCH 6/6] qapi: discriminate CpuInfo[Fast] on SysEmuTarget, not CpuInfoArch Laszlo Ersek
@ 2018-04-24 22:03 ` no-reply
  2018-04-25 12:26   ` Laszlo Ersek
  6 siblings, 1 reply; 46+ messages in thread
From: no-reply @ 2018-04-24 22:03 UTC (permalink / raw)
  To: lersek
  Cc: famz, qemu-devel, riku.voipio, crosthwaite.peter, sagark,
	kchamart, kbastian, palmer, laurent, armbru, mjc, kraxel,
	pbonzini, thuth, dgibson, rth

Hi,

This series failed docker-mingw@fedora build test. Please find the testing commands and
their output below. If you have Docker installed, you can probably reproduce it
locally.

Type: series
Message-id: 20180424214550.32549-1-lersek@redhat.com
Subject: [Qemu-devel] [PATCH 0/6] qapi: introduce the SysEmuTarget enumeration

=== TEST SCRIPT BEGIN ===
#!/bin/bash
set -e
git submodule update --init dtc
# Let docker tests dump environment info
export SHOW_ENV=1
export J=8
time make docker-test-mingw@fedora
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
Switched to a new branch 'test'
ba0e1c68e9 qapi: discriminate CpuInfo[Fast] on SysEmuTarget, not CpuInfoArch
44f275b0bc qapi: extract CpuInfoCommon to mitigate schema duplication
e15a24debc qapi: change the type of TargetInfo.arch from string to enum SysEmuTarget
86f00afff1 qapi: add SysEmuTarget to "common.json"
595295bcc3 qapi: handle the riscv CpuInfoArch in query-cpus-fast
ed37c57473 qapi: fill in CpuInfoFast.arch in query-cpus-fast

=== OUTPUT BEGIN ===
Submodule 'dtc' (git://git.qemu-project.org/dtc.git) registered for path 'dtc'
Cloning into '/var/tmp/patchew-tester-tmp-0rhlqvqc/src/dtc'...
Submodule path 'dtc': checked out 'e54388015af1fb4bf04d0bca99caba1074d9cc42'
  BUILD   fedora
make[1]: Entering directory '/var/tmp/patchew-tester-tmp-0rhlqvqc/src'
  GEN     /var/tmp/patchew-tester-tmp-0rhlqvqc/src/docker-src.2018-04-24-17.55.55.22859/qemu.tar
Cloning into '/var/tmp/patchew-tester-tmp-0rhlqvqc/src/docker-src.2018-04-24-17.55.55.22859/qemu.tar.vroot'...
done.
Your branch is up-to-date with 'origin/test'.
Submodule 'dtc' (git://git.qemu-project.org/dtc.git) registered for path 'dtc'
Cloning into '/var/tmp/patchew-tester-tmp-0rhlqvqc/src/docker-src.2018-04-24-17.55.55.22859/qemu.tar.vroot/dtc'...
Submodule path 'dtc': checked out 'e54388015af1fb4bf04d0bca99caba1074d9cc42'
Submodule 'ui/keycodemapdb' (git://git.qemu.org/keycodemapdb.git) registered for path 'ui/keycodemapdb'
Cloning into '/var/tmp/patchew-tester-tmp-0rhlqvqc/src/docker-src.2018-04-24-17.55.55.22859/qemu.tar.vroot/ui/keycodemapdb'...
Submodule path 'ui/keycodemapdb': checked out '6b3d716e2b6472eb7189d3220552280ef3d832ce'
  COPY    RUNNER
    RUN test-mingw in qemu:fedora 
Packages installed:
PyYAML-3.12-5.fc27.x86_64
SDL2-devel-2.0.7-2.fc27.x86_64
bc-1.07.1-3.fc27.x86_64
bison-3.0.4-8.fc27.x86_64
bluez-libs-devel-5.48-3.fc27.x86_64
brlapi-devel-0.6.6-8.fc27.x86_64
bzip2-1.0.6-24.fc27.x86_64
bzip2-devel-1.0.6-24.fc27.x86_64
ccache-3.3.6-1.fc27.x86_64
clang-5.0.1-5.fc27.x86_64
device-mapper-multipath-devel-0.7.1-9.git847cc43.fc27.x86_64
findutils-4.6.0-16.fc27.x86_64
flex-2.6.1-5.fc27.x86_64
gcc-7.3.1-5.fc27.x86_64
gcc-c++-7.3.1-5.fc27.x86_64
gettext-0.19.8.1-12.fc27.x86_64
git-2.14.3-3.fc27.x86_64
glib2-devel-2.54.3-2.fc27.x86_64
glusterfs-api-devel-3.12.7-1.fc27.x86_64
gnutls-devel-3.5.18-2.fc27.x86_64
gtk3-devel-3.22.26-2.fc27.x86_64
hostname-3.18-4.fc27.x86_64
libaio-devel-0.3.110-9.fc27.x86_64
libasan-7.3.1-5.fc27.x86_64
libattr-devel-2.4.47-21.fc27.x86_64
libcap-devel-2.25-7.fc27.x86_64
libcap-ng-devel-0.7.8-5.fc27.x86_64
libcurl-devel-7.55.1-10.fc27.x86_64
libfdt-devel-1.4.6-1.fc27.x86_64
libpng-devel-1.6.31-1.fc27.x86_64
librbd-devel-12.2.4-1.fc27.x86_64
libssh2-devel-1.8.0-5.fc27.x86_64
libubsan-7.3.1-5.fc27.x86_64
libusbx-devel-1.0.21-4.fc27.x86_64
libxml2-devel-2.9.7-1.fc27.x86_64
llvm-5.0.1-6.fc27.x86_64
lzo-devel-2.08-11.fc27.x86_64
make-4.2.1-4.fc27.x86_64
mingw32-SDL-1.2.15-9.fc27.noarch
mingw32-bzip2-1.0.6-9.fc27.noarch
mingw32-curl-7.54.1-2.fc27.noarch
mingw32-glib2-2.54.1-1.fc27.noarch
mingw32-gmp-6.1.2-2.fc27.noarch
mingw32-gnutls-3.5.13-2.fc27.noarch
mingw32-gtk2-2.24.31-4.fc27.noarch
mingw32-gtk3-3.22.16-1.fc27.noarch
mingw32-libjpeg-turbo-1.5.1-3.fc27.noarch
mingw32-libpng-1.6.29-2.fc27.noarch
mingw32-libssh2-1.8.0-3.fc27.noarch
mingw32-libtasn1-4.13-1.fc27.noarch
mingw32-nettle-3.3-3.fc27.noarch
mingw32-pixman-0.34.0-3.fc27.noarch
mingw32-pkg-config-0.28-9.fc27.x86_64
mingw64-SDL-1.2.15-9.fc27.noarch
mingw64-bzip2-1.0.6-9.fc27.noarch
mingw64-curl-7.54.1-2.fc27.noarch
mingw64-glib2-2.54.1-1.fc27.noarch
mingw64-gmp-6.1.2-2.fc27.noarch
mingw64-gnutls-3.5.13-2.fc27.noarch
mingw64-gtk2-2.24.31-4.fc27.noarch
mingw64-gtk3-3.22.16-1.fc27.noarch
mingw64-libjpeg-turbo-1.5.1-3.fc27.noarch
mingw64-libpng-1.6.29-2.fc27.noarch
mingw64-libssh2-1.8.0-3.fc27.noarch
mingw64-libtasn1-4.13-1.fc27.noarch
mingw64-nettle-3.3-3.fc27.noarch
mingw64-pixman-0.34.0-3.fc27.noarch
mingw64-pkg-config-0.28-9.fc27.x86_64
ncurses-devel-6.0-13.20170722.fc27.x86_64
nettle-devel-3.4-1.fc27.x86_64
nss-devel-3.36.0-1.0.fc27.x86_64
numactl-devel-2.0.11-5.fc27.x86_64
package libjpeg-devel is not installed
perl-5.26.1-403.fc27.x86_64
pixman-devel-0.34.0-4.fc27.x86_64
python3-3.6.2-13.fc27.x86_64
snappy-devel-1.1.4-5.fc27.x86_64
sparse-0.5.1-2.fc27.x86_64
spice-server-devel-0.14.0-1.fc27.x86_64
systemtap-sdt-devel-3.2-3.fc27.x86_64
tar-1.29-7.fc27.x86_64
usbredir-devel-0.7.1-5.fc27.x86_64
virglrenderer-devel-0.6.0-3.20170210git76b3da97b.fc27.x86_64
vte3-devel-0.36.5-5.fc27.x86_64
which-2.21-4.fc27.x86_64
xen-devel-4.9.1-5.fc27.x86_64
zlib-devel-1.2.11-4.fc27.x86_64

Environment variables:
TARGET_LIST=
PACKAGES=ccache gettext git tar PyYAML sparse flex bison python3 bzip2 hostname     gcc gcc-c++ llvm clang make perl which bc findutils glib2-devel     libaio-devel pixman-devel zlib-devel libfdt-devel libasan libubsan     bluez-libs-devel brlapi-devel bzip2-devel     device-mapper-multipath-devel glusterfs-api-devel gnutls-devel     gtk3-devel libattr-devel libcap-devel libcap-ng-devel libcurl-devel     libjpeg-devel libpng-devel librbd-devel libssh2-devel libusbx-devel     libxml2-devel lzo-devel ncurses-devel nettle-devel nss-devel     numactl-devel SDL2-devel snappy-devel spice-server-devel     systemtap-sdt-devel usbredir-devel virglrenderer-devel vte3-devel     xen-devel     mingw32-pixman mingw32-glib2 mingw32-gmp mingw32-SDL mingw32-pkg-config     mingw32-gtk2 mingw32-gtk3 mingw32-gnutls mingw32-nettle mingw32-libtasn1     mingw32-libjpeg-turbo mingw32-libpng mingw32-curl mingw32-libssh2     mingw32-bzip2     mingw64-pixman mingw64-glib2 mingw64-gmp mingw64-SDL mingw64-pkg-config     mingw64-gtk2 mingw64-gtk3 mingw64-gnutls mingw64-nettle mingw64-libtasn1     mingw64-libjpeg-turbo mingw64-libpng mingw64-curl mingw64-libssh2     mingw64-bzip2
J=8
V=
HOSTNAME=8163b70130e9
DEBUG=
SHOW_ENV=1
PWD=/
HOME=/root
CCACHE_DIR=/var/tmp/ccache
DISTTAG=f27container
QEMU_CONFIGURE_OPTS=--python=/usr/bin/python3
FGC=f27
TEST_DIR=/tmp/qemu-test
SHLVL=1
FEATURES=mingw clang pyyaml asan dtc
PATH=/usr/lib/ccache:/usr/lib64/ccache:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
MAKEFLAGS= -j8
EXTRA_CONFIGURE_OPTS=
_=/usr/bin/env

Configure options:
--enable-werror --target-list=x86_64-softmmu,aarch64-softmmu --prefix=/tmp/qemu-test/install --python=/usr/bin/python3 --cross-prefix=x86_64-w64-mingw32- --enable-trace-backends=simple --enable-gnutls --enable-nettle --enable-curl --enable-vnc --enable-bzip2 --enable-guest-agent --with-sdlabi=1.2 --with-gtkabi=2.0
Install prefix    /tmp/qemu-test/install
BIOS directory    /tmp/qemu-test/install
firmware path     /tmp/qemu-test/install/share/qemu-firmware
binary directory  /tmp/qemu-test/install
library directory /tmp/qemu-test/install/lib
module directory  /tmp/qemu-test/install/lib
libexec directory /tmp/qemu-test/install/libexec
include directory /tmp/qemu-test/install/include
config directory  /tmp/qemu-test/install
local state directory   queried at runtime
Windows SDK       no
Source path       /tmp/qemu-test/src
GIT binary        git
GIT submodules    
C compiler        x86_64-w64-mingw32-gcc
Host C compiler   cc
C++ compiler      x86_64-w64-mingw32-g++
Objective-C compiler clang
ARFLAGS           rv
CFLAGS            -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -g 
QEMU_CFLAGS       -I/usr/x86_64-w64-mingw32/sys-root/mingw/include/pixman-1  -I$(SRC_PATH)/dtc/libfdt -Werror -DHAS_LIBSSH2_SFTP_FSYNC -mms-bitfields -I/usr/x86_64-w64-mingw32/sys-root/mingw/include/glib-2.0 -I/usr/x86_64-w64-mingw32/sys-root/mingw/lib/glib-2.0/include -I/usr/x86_64-w64-mingw32/sys-root/mingw/include  -m64 -mcx16 -mthreads -D__USE_MINGW_ANSI_STDIO=1 -DWIN32_LEAN_AND_MEAN -DWINVER=0x501 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wall -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -fwrapv  -Wexpansion-to-defined -Wendif-labels -Wno-shift-negative-value -Wno-missing-include-dirs -Wempty-body -Wnested-externs -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wold-style-declaration -Wold-style-definition -Wtype-limits -fstack-protector-strong -I/usr/x86_64-w64-mingw32/sys-root/mingw/include -I/usr/x86_64-w64-mingw32/sys-root/mingw/include/p11-kit-1 -I/usr/x86_64-w64-mingw32/sys-root/mingw/include  -I/usr/x86_64-w64-mingw32/sys-root/mingw/include   -I/usr/x86_64-w64-mingw32/sys-root/mingw/include/libpng16 
LDFLAGS           -Wl,--nxcompat -Wl,--no-seh -Wl,--dynamicbase -Wl,--warn-common -m64 -g 
make              make
install           install
python            /usr/bin/python3 -B
smbd              /usr/sbin/smbd
module support    no
host CPU          x86_64
host big endian   no
target list       x86_64-softmmu aarch64-softmmu
gprof enabled     no
sparse enabled    no
strip binaries    yes
profiler          no
static build      no
SDL support       yes (1.2.15)
GTK support       yes (2.24.31)
GTK GL support    no
VTE support       no 
TLS priority      NORMAL
GNUTLS support    yes
GNUTLS rnd        yes
libgcrypt         no
libgcrypt kdf     no
nettle            yes (3.3)
nettle kdf        yes
libtasn1          yes
curses support    no
virgl support     no
curl support      yes
mingw32 support   yes
Audio drivers     dsound
Block whitelist (rw) 
Block whitelist (ro) 
VirtFS support    no
Multipath support no
VNC support       yes
VNC SASL support  no
VNC JPEG support  yes
VNC PNG support   yes
xen support       no
brlapi support    no
bluez  support    no
Documentation     no
PIE               no
vde support       no
netmap support    no
Linux AIO support no
ATTR/XATTR support no
Install blobs     yes
KVM support       no
HAX support       yes
HVF support       no
WHPX support      no
TCG support       yes
TCG debug enabled no
TCG interpreter   no
malloc trim support no
RDMA support      no
fdt support       yes
membarrier        no
preadv support    no
fdatasync         no
madvise           no
posix_madvise     no
posix_memalign    no
libcap-ng support no
vhost-net support no
vhost-crypto support no
vhost-scsi support no
vhost-vsock support no
vhost-user support no
Trace backends    simple
Trace output file trace-<pid>
spice support     no 
rbd support       no
xfsctl support    no
smartcard support no
libusb            no
usb net redir     no
OpenGL support    no
OpenGL dmabufs    no
libiscsi support  no
libnfs support    no
build guest agent yes
QGA VSS support   no
QGA w32 disk info yes
QGA MSI support   no
seccomp support   no
coroutine backend win32
coroutine pool    yes
debug stack usage no
crypto afalg      no
GlusterFS support no
gcov              gcov
gcov enabled      no
TPM support       yes
libssh2 support   yes
TPM passthrough   no
TPM emulator      no
QOM debugging     yes
Live block migration yes
lzo support       no
snappy support    no
bzip2 support     yes
NUMA host support no
libxml2           no
tcmalloc support  no
jemalloc support  no
avx2 optimization yes
replication support yes
VxHS block device no
capstone          no

WARNING: Use of GTK 2.0 is deprecated and will be removed in
WARNING: future releases. Please switch to using GTK 3.0

WARNING: Use of SDL 1.2 is deprecated and will be removed in
WARNING: future releases. Please switch to using SDL 2.0
mkdir -p dtc/libfdt
mkdir -p dtc/tests
  GEN     x86_64-softmmu/config-devices.mak.tmp
  GEN     aarch64-softmmu/config-devices.mak.tmp
  GEN     config-host.h
  GEN     qemu-options.def
  GEN     qapi-gen
  GEN     trace/generated-tcg-tracers.h
  GEN     trace/generated-helpers-wrappers.h
  GEN     trace/generated-helpers.h
  GEN     trace/generated-helpers.c
  GEN     x86_64-softmmu/config-devices.mak
  GEN     aarch64-softmmu/config-devices.mak
  GEN     module_block.h
  GEN     ui/input-keymap-linux-to-qcode.c
  GEN     ui/input-keymap-atset1-to-qcode.c
  GEN     ui/input-keymap-qcode-to-atset2.c
  GEN     ui/input-keymap-qcode-to-atset1.c
  GEN     ui/input-keymap-qcode-to-atset3.c
  GEN     ui/input-keymap-qcode-to-linux.c
  GEN     ui/input-keymap-qcode-to-qnum.c
  GEN     ui/input-keymap-qcode-to-sun.c
  GEN     ui/input-keymap-qnum-to-qcode.c
  GEN     ui/input-keymap-win32-to-qcode.c
  GEN     ui/input-keymap-x11-to-qcode.c
  GEN     ui/input-keymap-usb-to-qcode.c
  GEN     ui/input-keymap-xorgevdev-to-qcode.c
  GEN     ui/input-keymap-xorgkbd-to-qcode.c
  GEN     ui/input-keymap-xorgxquartz-to-qcode.c
  GEN     ui/input-keymap-xorgxwin-to-qcode.c
  GEN     tests/test-qapi-gen
  GEN     trace-root.h
  GEN     util/trace.h
  GEN     crypto/trace.h
  GEN     io/trace.h
  GEN     migration/trace.h
  GEN     block/trace.h
  GEN     chardev/trace.h
  GEN     hw/block/trace.h
  GEN     hw/block/dataplane/trace.h
  GEN     hw/char/trace.h
  GEN     hw/intc/trace.h
  GEN     hw/net/trace.h
  GEN     hw/rdma/trace.h
  GEN     hw/rdma/vmw/trace.h
  GEN     hw/virtio/trace.h
  GEN     hw/audio/trace.h
  GEN     hw/misc/trace.h
  GEN     hw/misc/macio/trace.h
  GEN     hw/usb/trace.h
  GEN     hw/scsi/trace.h
  GEN     hw/nvram/trace.h
  GEN     hw/display/trace.h
  GEN     hw/input/trace.h
  GEN     hw/timer/trace.h
  GEN     hw/dma/trace.h
  GEN     hw/sparc/trace.h
  GEN     hw/sparc64/trace.h
  GEN     hw/sd/trace.h
  GEN     hw/isa/trace.h
  GEN     hw/mem/trace.h
  GEN     hw/i386/trace.h
  GEN     hw/i386/xen/trace.h
  GEN     hw/9pfs/trace.h
  GEN     hw/ppc/trace.h
  GEN     hw/pci/trace.h
  GEN     hw/pci-host/trace.h
  GEN     hw/s390x/trace.h
  GEN     hw/vfio/trace.h
  GEN     hw/acpi/trace.h
  GEN     hw/arm/trace.h
  GEN     hw/alpha/trace.h
  GEN     hw/hppa/trace.h
  GEN     hw/xen/trace.h
  GEN     hw/ide/trace.h
  GEN     hw/tpm/trace.h
  GEN     ui/trace.h
  GEN     audio/trace.h
  GEN     net/trace.h
  GEN     target/arm/trace.h
  GEN     target/i386/trace.h
  GEN     target/mips/trace.h
  GEN     target/sparc/trace.h
  GEN     target/s390x/trace.h
  GEN     target/ppc/trace.h
  GEN     qom/trace.h
  GEN     linux-user/trace.h
  GEN     qapi/trace.h
  GEN     accel/tcg/trace.h
  GEN     accel/kvm/trace.h
  GEN     nbd/trace.h
  GEN     scsi/trace.h
  GEN     trace-root.c
  GEN     util/trace.c
  GEN     crypto/trace.c
  GEN     io/trace.c
  GEN     migration/trace.c
  GEN     block/trace.c
  GEN     chardev/trace.c
  GEN     hw/block/trace.c
  GEN     hw/block/dataplane/trace.c
  GEN     hw/char/trace.c
  GEN     hw/intc/trace.c
  GEN     hw/net/trace.c
  GEN     hw/rdma/trace.c
  GEN     hw/rdma/vmw/trace.c
  GEN     hw/virtio/trace.c
  GEN     hw/audio/trace.c
  GEN     hw/misc/trace.c
  GEN     hw/misc/macio/trace.c
  GEN     hw/usb/trace.c
  GEN     hw/scsi/trace.c
  GEN     hw/nvram/trace.c
  GEN     hw/display/trace.c
  GEN     hw/input/trace.c
  GEN     hw/timer/trace.c
  GEN     hw/dma/trace.c
  GEN     hw/sparc/trace.c
  GEN     hw/sparc64/trace.c
  GEN     hw/sd/trace.c
  GEN     hw/isa/trace.c
  GEN     hw/mem/trace.c
  GEN     hw/i386/trace.c
  GEN     hw/i386/xen/trace.c
  GEN     hw/9pfs/trace.c
  GEN     hw/ppc/trace.c
  GEN     hw/pci/trace.c
  GEN     hw/pci-host/trace.c
  GEN     hw/s390x/trace.c
  GEN     hw/vfio/trace.c
  GEN     hw/acpi/trace.c
  GEN     hw/arm/trace.c
  GEN     hw/alpha/trace.c
  GEN     hw/hppa/trace.c
  GEN     hw/xen/trace.c
  GEN     hw/ide/trace.c
  GEN     hw/tpm/trace.c
  GEN     ui/trace.c
  GEN     audio/trace.c
  GEN     net/trace.c
  GEN     target/arm/trace.c
  GEN     target/i386/trace.c
  GEN     target/mips/trace.c
  GEN     target/sparc/trace.c
  GEN     target/s390x/trace.c
  GEN     target/ppc/trace.c
  GEN     qom/trace.c
  GEN     linux-user/trace.c
  GEN     qapi/trace.c
  GEN     accel/tcg/trace.c
  GEN     accel/kvm/trace.c
  GEN     nbd/trace.c
  GEN     scsi/trace.c
  GEN     config-all-devices.mak
	 DEP /tmp/qemu-test/src/dtc/tests/dumptrees.c
	 DEP /tmp/qemu-test/src/dtc/tests/trees.S
	 DEP /tmp/qemu-test/src/dtc/tests/testutils.c
	 DEP /tmp/qemu-test/src/dtc/tests/value-labels.c
	 DEP /tmp/qemu-test/src/dtc/tests/asm_tree_dump.c
	 DEP /tmp/qemu-test/src/dtc/tests/truncated_property.c
	 DEP /tmp/qemu-test/src/dtc/tests/check_path.c
	 DEP /tmp/qemu-test/src/dtc/tests/overlay_bad_fixup.c
	 DEP /tmp/qemu-test/src/dtc/tests/overlay.c
	 DEP /tmp/qemu-test/src/dtc/tests/subnode_iterate.c
	 DEP /tmp/qemu-test/src/dtc/tests/property_iterate.c
	 DEP /tmp/qemu-test/src/dtc/tests/integer-expressions.c
	 DEP /tmp/qemu-test/src/dtc/tests/utilfdt_test.c
	 DEP /tmp/qemu-test/src/dtc/tests/path_offset_aliases.c
	 DEP /tmp/qemu-test/src/dtc/tests/add_subnode_with_nops.c
	 DEP /tmp/qemu-test/src/dtc/tests/dtbs_equal_unordered.c
	 DEP /tmp/qemu-test/src/dtc/tests/dtb_reverse.c
	 DEP /tmp/qemu-test/src/dtc/tests/dtbs_equal_ordered.c
	 DEP /tmp/qemu-test/src/dtc/tests/extra-terminating-null.c
	 DEP /tmp/qemu-test/src/dtc/tests/incbin.c
	 DEP /tmp/qemu-test/src/dtc/tests/boot-cpuid.c
	 DEP /tmp/qemu-test/src/dtc/tests/phandle_format.c
	 DEP /tmp/qemu-test/src/dtc/tests/path-references.c
	 DEP /tmp/qemu-test/src/dtc/tests/references.c
	 DEP /tmp/qemu-test/src/dtc/tests/string_escapes.c
	 DEP /tmp/qemu-test/src/dtc/tests/propname_escapes.c
	 DEP /tmp/qemu-test/src/dtc/tests/appendprop2.c
	 DEP /tmp/qemu-test/src/dtc/tests/appendprop1.c
	 DEP /tmp/qemu-test/src/dtc/tests/del_node.c
	 DEP /tmp/qemu-test/src/dtc/tests/del_property.c
	 DEP /tmp/qemu-test/src/dtc/tests/setprop.c
	 DEP /tmp/qemu-test/src/dtc/tests/rw_tree1.c
	 DEP /tmp/qemu-test/src/dtc/tests/set_name.c
	 DEP /tmp/qemu-test/src/dtc/tests/open_pack.c
	 DEP /tmp/qemu-test/src/dtc/tests/nopulate.c
	 DEP /tmp/qemu-test/src/dtc/tests/mangle-layout.c
	 DEP /tmp/qemu-test/src/dtc/tests/move_and_save.c
	 DEP /tmp/qemu-test/src/dtc/tests/sw_tree1.c
	 DEP /tmp/qemu-test/src/dtc/tests/nop_node.c
	 DEP /tmp/qemu-test/src/dtc/tests/nop_property.c
	 DEP /tmp/qemu-test/src/dtc/tests/setprop_inplace.c
	 DEP /tmp/qemu-test/src/dtc/tests/stringlist.c
	 DEP /tmp/qemu-test/src/dtc/tests/addr_size_cells.c
	 DEP /tmp/qemu-test/src/dtc/tests/notfound.c
	 DEP /tmp/qemu-test/src/dtc/tests/sized_cells.c
	 DEP /tmp/qemu-test/src/dtc/tests/char_literal.c
	 DEP /tmp/qemu-test/src/dtc/tests/get_alias.c
	 DEP /tmp/qemu-test/src/dtc/tests/node_offset_by_compatible.c
	 DEP /tmp/qemu-test/src/dtc/tests/node_check_compatible.c
	 DEP /tmp/qemu-test/src/dtc/tests/node_offset_by_phandle.c
	 DEP /tmp/qemu-test/src/dtc/tests/node_offset_by_prop_value.c
	 DEP /tmp/qemu-test/src/dtc/tests/parent_offset.c
	 DEP /tmp/qemu-test/src/dtc/tests/supernode_atdepth_offset.c
	 DEP /tmp/qemu-test/src/dtc/tests/get_path.c
	 DEP /tmp/qemu-test/src/dtc/tests/get_phandle.c
	 DEP /tmp/qemu-test/src/dtc/tests/getprop.c
	 DEP /tmp/qemu-test/src/dtc/tests/get_name.c
	 DEP /tmp/qemu-test/src/dtc/tests/path_offset.c
	 DEP /tmp/qemu-test/src/dtc/tests/subnode_offset.c
	 DEP /tmp/qemu-test/src/dtc/tests/find_property.c
	 DEP /tmp/qemu-test/src/dtc/tests/root_node.c
	 DEP /tmp/qemu-test/src/dtc/tests/get_mem_rsv.c
	 DEP /tmp/qemu-test/src/dtc/libfdt/fdt_overlay.c
	 DEP /tmp/qemu-test/src/dtc/libfdt/fdt_addresses.c
	 DEP /tmp/qemu-test/src/dtc/libfdt/fdt_empty_tree.c
	 DEP /tmp/qemu-test/src/dtc/libfdt/fdt_strerror.c
	 DEP /tmp/qemu-test/src/dtc/libfdt/fdt_rw.c
	 DEP /tmp/qemu-test/src/dtc/libfdt/fdt_sw.c
	 DEP /tmp/qemu-test/src/dtc/libfdt/fdt_wip.c
	 DEP /tmp/qemu-test/src/dtc/libfdt/fdt.c
	 DEP /tmp/qemu-test/src/dtc/libfdt/fdt_ro.c
	 DEP /tmp/qemu-test/src/dtc/util.c
	 DEP /tmp/qemu-test/src/dtc/fdtoverlay.c
	 DEP /tmp/qemu-test/src/dtc/fdtput.c
	 DEP /tmp/qemu-test/src/dtc/fdtget.c
	 DEP /tmp/qemu-test/src/dtc/fdtdump.c
	 LEX convert-dtsv0-lexer.lex.c
	 DEP /tmp/qemu-test/src/dtc/srcpos.c
	 BISON dtc-parser.tab.c
	 LEX dtc-lexer.lex.c
	 DEP /tmp/qemu-test/src/dtc/treesource.c
	 DEP /tmp/qemu-test/src/dtc/livetree.c
	 DEP /tmp/qemu-test/src/dtc/fstree.c
	 DEP /tmp/qemu-test/src/dtc/flattree.c
	 DEP /tmp/qemu-test/src/dtc/dtc.c
	 DEP /tmp/qemu-test/src/dtc/checks.c
	 DEP /tmp/qemu-test/src/dtc/data.c
	 DEP convert-dtsv0-lexer.lex.c
	 DEP dtc-lexer.lex.c
	 DEP dtc-parser.tab.c
	CHK version_gen.h
	UPD version_gen.h
	 DEP /tmp/qemu-test/src/dtc/util.c
	 CC libfdt/fdt.o
	 CC libfdt/fdt_ro.o
	 CC libfdt/fdt_wip.o
	 CC libfdt/fdt_sw.o
	 CC libfdt/fdt_strerror.o
	 CC libfdt/fdt_addresses.o
	 CC libfdt/fdt_empty_tree.o
	 CC libfdt/fdt_rw.o
	 CC libfdt/fdt_overlay.o
	 AR libfdt/libfdt.a
x86_64-w64-mingw32-ar: creating libfdt/libfdt.a
a - libfdt/fdt.o
a - libfdt/fdt_ro.o
a - libfdt/fdt_wip.o
a - libfdt/fdt_sw.o
a - libfdt/fdt_rw.o
a - libfdt/fdt_strerror.o
a - libfdt/fdt_empty_tree.o
a - libfdt/fdt_addresses.o
a - libfdt/fdt_overlay.o
  RC      version.o
mkdir -p dtc/libfdt
mkdir -p dtc/tests
  GEN     qga/qapi-generated/qapi-gen
  CC      qapi/qapi-types.o
  CC      qapi/qapi-builtin-types.o
  CC      qapi/qapi-types-block-core.o
  CC      qapi/qapi-types-char.o
  CC      qapi/qapi-types-block.o
  CC      qapi/qapi-types-common.o
  CC      qapi/qapi-types-crypto.o
  CC      qapi/qapi-types-introspect.o
  CC      qapi/qapi-types-migration.o
  CC      qapi/qapi-types-misc.o
  CC      qapi/qapi-types-net.o
  CC      qapi/qapi-types-rocker.o
  CC      qapi/qapi-types-run-state.o
  CC      qapi/qapi-types-sockets.o
  CC      qapi/qapi-types-tpm.o
  CC      qapi/qapi-types-trace.o
  CC      qapi/qapi-types-transaction.o
  CC      qapi/qapi-types-ui.o
  CC      qapi/qapi-builtin-visit.o
  CC      qapi/qapi-visit.o
  CC      qapi/qapi-visit-block-core.o
  CC      qapi/qapi-visit-block.o
  CC      qapi/qapi-visit-char.o
  CC      qapi/qapi-visit-common.o
  CC      qapi/qapi-visit-crypto.o
  CC      qapi/qapi-visit-introspect.o
  CC      qapi/qapi-visit-migration.o
  CC      qapi/qapi-visit-misc.o
  CC      qapi/qapi-visit-net.o
  CC      qapi/qapi-visit-rocker.o
  CC      qapi/qapi-visit-sockets.o
  CC      qapi/qapi-visit-run-state.o
  CC      qapi/qapi-visit-tpm.o
  CC      qapi/qapi-visit-trace.o
  CC      qapi/qapi-visit-transaction.o
  CC      qapi/qapi-visit-ui.o
  CC      qapi/qapi-events.o
  CC      qapi/qapi-events-block.o
  CC      qapi/qapi-events-block-core.o
  CC      qapi/qapi-events-char.o
  CC      qapi/qapi-events-common.o
  CC      qapi/qapi-events-crypto.o
  CC      qapi/qapi-events-introspect.o
  CC      qapi/qapi-events-migration.o
  CC      qapi/qapi-events-misc.o
  CC      qapi/qapi-events-net.o
  CC      qapi/qapi-events-rocker.o
  CC      qapi/qapi-events-run-state.o
  CC      qapi/qapi-events-sockets.o
  CC      qapi/qapi-events-tpm.o
  CC      qapi/qapi-events-trace.o
  CC      qapi/qapi-events-transaction.o
  CC      qapi/qapi-events-ui.o
  CC      qapi/qapi-introspect.o
  CC      qapi/qapi-visit-core.o
  CC      qapi/qapi-dealloc-visitor.o
  CC      qapi/qobject-input-visitor.o
  CC      qapi/qobject-output-visitor.o
  CC      qapi/qmp-dispatch.o
  CC      qapi/qmp-registry.o
  CC      qapi/string-input-visitor.o
  CC      qapi/string-output-visitor.o
  CC      qapi/opts-visitor.o
  CC      qapi/qapi-clone-visitor.o
  CC      qapi/qmp-event.o
  CC      qapi/qapi-util.o
  CC      qobject/qnull.o
  CC      qobject/qnum.o
  CC      qobject/qstring.o
  CC      qobject/qdict.o
  CC      qobject/qlist.o
  CC      qobject/qbool.o
  CC      qobject/qlit.o
  CC      qobject/qjson.o
  CC      qobject/qobject.o
  CC      qobject/json-lexer.o
  CC      qobject/json-streamer.o
  CC      qobject/json-parser.o
  CC      trace/simple.o
  CC      trace/control.o
  CC      trace/qmp.o
  CC      util/osdep.o
  CC      util/cutils.o
  CC      util/unicode.o
  CC      util/qemu-timer-common.o
  CC      util/bufferiszero.o
  CC      util/lockcnt.o
  CC      util/aiocb.o
  CC      util/async.o
  CC      util/aio-wait.o
  CC      util/thread-pool.o
  CC      util/qemu-timer.o
  CC      util/main-loop.o
  CC      util/iohandler.o
  CC      util/aio-win32.o
  CC      util/event_notifier-win32.o
  CC      util/oslib-win32.o
  CC      util/qemu-thread-win32.o
  CC      util/envlist.o
  CC      util/path.o
  CC      util/module.o
  CC      util/host-utils.o
  CC      util/bitmap.o
  CC      util/bitops.o
  CC      util/hbitmap.o
  CC      util/fifo8.o
  CC      util/acl.o
  CC      util/cacheinfo.o
  CC      util/error.o
  CC      util/qemu-error.o
  CC      util/id.o
  CC      util/iov.o
  CC      util/qemu-config.o
  CC      util/qemu-sockets.o
  CC      util/uri.o
  CC      util/notify.o
  CC      util/qemu-option.o
  CC      util/qemu-progress.o
  CC      util/keyval.o
  CC      util/hexdump.o
  CC      util/crc32c.o
  CC      util/uuid.o
  CC      util/throttle.o
  CC      util/getauxval.o
  CC      util/readline.o
  CC      util/rcu.o
  CC      util/qemu-coroutine.o
  CC      util/qemu-coroutine-lock.o
  CC      util/qemu-coroutine-io.o
  CC      util/qemu-coroutine-sleep.o
  CC      util/coroutine-win32.o
  CC      util/buffer.o
  CC      util/timed-average.o
  CC      util/base64.o
  CC      util/log.o
  CC      util/pagesize.o
  CC      util/qdist.o
  CC      util/qht.o
  CC      util/range.o
  CC      util/stats64.o
  CC      util/systemd.o
  CC      trace-root.o
  CC      util/trace.o
  CC      crypto/trace.o
  CC      io/trace.o
  CC      migration/trace.o
  CC      block/trace.o
  CC      chardev/trace.o
  CC      hw/block/trace.o
  CC      hw/block/dataplane/trace.o
  CC      hw/char/trace.o
  CC      hw/intc/trace.o
  CC      hw/net/trace.o
  CC      hw/rdma/trace.o
  CC      hw/rdma/vmw/trace.o
  CC      hw/audio/trace.o
  CC      hw/virtio/trace.o
  CC      hw/misc/trace.o
  CC      hw/misc/macio/trace.o
  CC      hw/usb/trace.o
  CC      hw/scsi/trace.o
  CC      hw/nvram/trace.o
  CC      hw/display/trace.o
  CC      hw/input/trace.o
  CC      hw/timer/trace.o
  CC      hw/dma/trace.o
  CC      hw/sparc/trace.o
  CC      hw/sparc64/trace.o
  CC      hw/sd/trace.o
  CC      hw/isa/trace.o
  CC      hw/mem/trace.o
  CC      hw/i386/trace.o
  CC      hw/i386/xen/trace.o
  CC      hw/9pfs/trace.o
  CC      hw/ppc/trace.o
  CC      hw/pci/trace.o
  CC      hw/pci-host/trace.o
  CC      hw/s390x/trace.o
  CC      hw/vfio/trace.o
  CC      hw/acpi/trace.o
  CC      hw/arm/trace.o
  CC      hw/alpha/trace.o
  CC      hw/hppa/trace.o
  CC      hw/xen/trace.o
  CC      hw/ide/trace.o
  CC      hw/tpm/trace.o
  CC      ui/trace.o
  CC      audio/trace.o
  CC      net/trace.o
  CC      target/arm/trace.o
  CC      target/i386/trace.o
  CC      target/mips/trace.o
  CC      target/sparc/trace.o
  CC      target/s390x/trace.o
  CC      target/ppc/trace.o
  CC      qom/trace.o
  CC      linux-user/trace.o
  CC      qapi/trace.o
  CC      accel/tcg/trace.o
  CC      accel/kvm/trace.o
  CC      nbd/trace.o
  CC      scsi/trace.o
  CC      crypto/pbkdf-stub.o
  CC      stubs/arch-query-cpu-def.o
  CC      stubs/arch-query-cpu-model-expansion.o
  CC      stubs/arch-query-cpu-model-comparison.o
  CC      stubs/arch-query-cpu-model-baseline.o
  CC      stubs/bdrv-next-monitor-owned.o
  CC      stubs/blk-commit-all.o
  CC      stubs/blockdev-close-all-bdrv-states.o
  CC      stubs/clock-warp.o
  CC      stubs/cpu-get-clock.o
  CC      stubs/cpu-get-icount.o
  CC      stubs/dump.o
  CC      stubs/error-printf.o
  CC      stubs/fdset.o
  CC      stubs/gdbstub.o
  CC      stubs/get-vm-name.o
  CC      stubs/iothread.o
  CC      stubs/iothread-lock.o
  CC      stubs/is-daemonized.o
  CC      stubs/machine-init-done.o
  CC      stubs/migr-blocker.o
  CC      stubs/change-state-handler.o
  CC      stubs/monitor.o
  CC      stubs/notify-event.o
  CC      stubs/qtest.o
  CC      stubs/replay.o
  CC      stubs/runstate-check.o
  CC      stubs/set-fd-handler.o
  CC      stubs/slirp.o
  CC      stubs/sysbus.o
  CC      stubs/tpm.o
  CC      stubs/trace-control.o
  CC      stubs/uuid.o
  CC      stubs/vm-stop.o
  CC      stubs/vmstate.o
  CC      stubs/fd-register.o
  CC      stubs/qmp_pc_dimm.o
  CC      stubs/target-monitor-defs.o
  CC      stubs/target-get-monitor-def.o
  CC      stubs/pc_madt_cpu_entry.o
  CC      stubs/vmgenid.o
  CC      stubs/xen-common.o
  CC      stubs/xen-hvm.o
  CC      stubs/pci-host-piix.o
  CC      stubs/ram-block.o
  GEN     qemu-img-cmds.h
  CC      block.o
  CC      blockjob.o
  CC      qemu-io-cmds.o
  CC      replication.o
  CC      block/raw-format.o
  CC      block/qcow.o
  CC      block/vdi.o
  CC      block/vmdk.o
  CC      block/cloop.o
  CC      block/bochs.o
  CC      block/vpc.o
  CC      block/vvfat.o
  CC      block/dmg.o
  CC      block/qcow2.o
  CC      block/qcow2-refcount.o
  CC      block/qcow2-cluster.o
  CC      block/qcow2-snapshot.o
  CC      block/qcow2-cache.o
  CC      block/qcow2-bitmap.o
  CC      block/qed.o
  CC      block/qed-l2-cache.o
  CC      block/qed-table.o
  CC      block/qed-cluster.o
  CC      block/qed-check.o
  CC      block/vhdx.o
  CC      block/vhdx-endian.o
  CC      block/vhdx-log.o
  CC      block/quorum.o
  CC      block/parallels.o
  CC      block/blkdebug.o
  CC      block/blkverify.o
  CC      block/blkreplay.o
  CC      block/block-backend.o
  CC      block/snapshot.o
  CC      block/qapi.o
  CC      block/file-win32.o
  CC      block/win32-aio.o
  CC      block/null.o
  CC      block/mirror.o
  CC      block/commit.o
  CC      block/io.o
  CC      block/create.o
  CC      block/throttle-groups.o
  CC      block/nbd.o
  CC      block/nbd-client.o
  CC      block/sheepdog.o
  CC      block/accounting.o
  CC      block/dirty-bitmap.o
  CC      block/write-threshold.o
  CC      block/backup.o
  CC      block/replication.o
  CC      block/throttle.o
  CC      block/crypto.o
  CC      nbd/server.o
  CC      nbd/client.o
  CC      nbd/common.o
  CC      scsi/utils.o
  CC      block/curl.o
  CC      block/ssh.o
  CC      block/dmg-bz2.o
  CC      crypto/init.o
  CC      crypto/hash.o
  CC      crypto/hash-nettle.o
  CC      crypto/hmac.o
  CC      crypto/hmac-nettle.o
  CC      crypto/aes.o
  CC      crypto/desrfb.o
  CC      crypto/cipher.o
  CC      crypto/tlscreds.o
  CC      crypto/tlscredsanon.o
  CC      crypto/tlscredsx509.o
  CC      crypto/tlssession.o
  CC      crypto/secret.o
  CC      crypto/random-gnutls.o
  CC      crypto/pbkdf.o
  CC      crypto/pbkdf-nettle.o
  CC      crypto/ivgen.o
  CC      crypto/ivgen-essiv.o
  CC      crypto/ivgen-plain.o
  CC      crypto/ivgen-plain64.o
  CC      crypto/afsplit.o
  CC      crypto/xts.o
  CC      crypto/block.o
  CC      crypto/block-qcow.o
  CC      crypto/block-luks.o
  CC      io/channel.o
  CC      io/channel-buffer.o
  CC      io/channel-command.o
  CC      io/channel-file.o
  CC      io/channel-socket.o
  CC      io/channel-tls.o
  CC      io/channel-watch.o
  CC      io/channel-websock.o
  CC      io/channel-util.o
  CC      io/dns-resolver.o
  CC      io/net-listener.o
  CC      io/task.o
  CC      qom/object.o
  CC      qom/container.o
  CC      qom/qom-qobject.o
  CC      qom/object_interfaces.o
  CC      qemu-io.o
  CC      blockdev.o
  CC      blockdev-nbd.o
  CC      bootdevice.o
  CC      iothread.o
  CC      qdev-monitor.o
  CC      device-hotplug.o
  CC      os-win32.o
  CC      bt-host.o
  CC      bt-vhci.o
  CC      dma-helpers.o
  CC      vl.o
  CC      tpm.o
  CC      device_tree.o
  CC      qapi/qapi-commands.o
  CC      qapi/qapi-commands-block-core.o
  CC      qapi/qapi-commands-block.o
  CC      qapi/qapi-commands-char.o
  CC      qapi/qapi-commands-common.o
  CC      qapi/qapi-commands-crypto.o
  CC      qapi/qapi-commands-introspect.o
  CC      qapi/qapi-commands-migration.o
  CC      qapi/qapi-commands-misc.o
  CC      qapi/qapi-commands-net.o
  CC      qapi/qapi-commands-rocker.o
  CC      qapi/qapi-commands-run-state.o
  CC      qapi/qapi-commands-sockets.o
  CC      qapi/qapi-commands-tpm.o
  CC      qapi/qapi-commands-trace.o
  CC      qapi/qapi-commands-transaction.o
  CC      qapi/qapi-commands-ui.o
  CC      qmp.o
  CC      hmp.o
  CC      cpus-common.o
  CC      audio/audio.o
  CC      audio/noaudio.o
  CC      audio/wavaudio.o
  CC      audio/mixeng.o
  CC      audio/dsoundaudio.o
  CC      audio/audio_win_int.o
  CC      audio/wavcapture.o
  CC      backends/rng.o
  CC      backends/rng-egd.o
  CC      backends/tpm.o
  CC      backends/hostmem.o
  CC      backends/hostmem-ram.o
  CC      backends/cryptodev.o
  CC      backends/cryptodev-builtin.o
  CC      backends/cryptodev-vhost.o
  CC      block/stream.o
  CC      chardev/msmouse.o
  CC      chardev/wctablet.o
  CC      chardev/testdev.o
  CC      disas/arm.o
  CXX     disas/arm-a64.o
  CC      disas/i386.o
  CXX     disas/libvixl/vixl/utils.o
  CXX     disas/libvixl/vixl/compiler-intrinsics.o
  CXX     disas/libvixl/vixl/a64/instructions-a64.o
  CXX     disas/libvixl/vixl/a64/decoder-a64.o
  CXX     disas/libvixl/vixl/a64/disasm-a64.o
  CC      hw/acpi/core.o
  CC      hw/acpi/piix4.o
  CC      hw/acpi/pcihp.o
  CC      hw/acpi/ich9.o
  CC      hw/acpi/tco.o
  CC      hw/acpi/cpu_hotplug.o
  CC      hw/acpi/memory_hotplug.o
  CC      hw/acpi/cpu.o
  CC      hw/acpi/nvdimm.o
  CC      hw/acpi/vmgenid.o
  CC      hw/acpi/acpi_interface.o
  CC      hw/acpi/bios-linker-loader.o
  CC      hw/acpi/aml-build.o
  CC      hw/acpi/ipmi.o
  CC      hw/acpi/acpi-stub.o
  CC      hw/acpi/ipmi-stub.o
  CC      hw/audio/sb16.o
  CC      hw/audio/es1370.o
  CC      hw/audio/ac97.o
  CC      hw/audio/fmopl.o
  CC      hw/audio/adlib.o
  CC      hw/audio/gus.o
  CC      hw/audio/gusemu_hal.o
  CC      hw/audio/gusemu_mixer.o
  CC      hw/audio/cs4231a.o
  CC      hw/audio/intel-hda.o
  CC      hw/audio/hda-codec.o
  CC      hw/audio/pcspk.o
  CC      hw/audio/wm8750.o
  CC      hw/audio/pl041.o
  CC      hw/audio/lm4549.o
  CC      hw/audio/marvell_88w8618.o
  CC      hw/audio/soundhw.o
  CC      hw/block/block.o
  CC      hw/block/cdrom.o
  CC      hw/block/hd-geometry.o
  CC      hw/block/fdc.o
  CC      hw/block/m25p80.o
  CC      hw/block/nand.o
  CC      hw/block/pflash_cfi01.o
  CC      hw/block/pflash_cfi02.o
  CC      hw/block/ecc.o
  CC      hw/block/onenand.o
  CC      hw/block/nvme.o
  CC      hw/bt/core.o
  CC      hw/bt/l2cap.o
  CC      hw/bt/sdp.o
  CC      hw/bt/hci.o
  CC      hw/bt/hid.o
  CC      hw/bt/hci-csr.o
  CC      hw/char/ipoctal232.o
  CC      hw/char/parallel.o
  CC      hw/char/parallel-isa.o
  CC      hw/char/pl011.o
  CC      hw/char/serial.o
  CC      hw/char/serial-isa.o
  CC      hw/char/serial-pci.o
  CC      hw/char/virtio-console.o
  CC      hw/char/cadence_uart.o
  CC      hw/char/cmsdk-apb-uart.o
  CC      hw/char/debugcon.o
  CC      hw/char/imx_serial.o
  CC      hw/core/qdev.o
  CC      hw/core/qdev-properties.o
  CC      hw/core/bus.o
  CC      hw/core/reset.o
  CC      hw/core/qdev-fw.o
  CC      hw/core/fw-path-provider.o
  CC      hw/core/irq.o
  CC      hw/core/hotplug.o
  CC      hw/core/nmi.o
  CC      hw/core/stream.o
  CC      hw/core/ptimer.o
  CC      hw/core/sysbus.o
  CC      hw/core/machine.o
  CC      hw/core/loader.o
  CC      hw/core/qdev-properties-system.o
  CC      hw/core/register.o
  CC      hw/core/or-irq.o
  CC      hw/core/split-irq.o
  CC      hw/core/platform-bus.o
  CC      hw/cpu/core.o
  CC      hw/display/ads7846.o
  CC      hw/display/cirrus_vga.o
  CC      hw/display/pl110.o
  CC      hw/display/sii9022.o
  CC      hw/display/ssd0303.o
  CC      hw/display/ssd0323.o
  CC      hw/display/vga-pci.o
  CC      hw/display/vga-isa.o
  CC      hw/display/vmware_vga.o
  CC      hw/display/blizzard.o
  CC      hw/display/exynos4210_fimd.o
  CC      hw/display/framebuffer.o
  CC      hw/display/tc6393xb.o
  CC      hw/dma/pl080.o
  CC      hw/dma/pl330.o
  CC      hw/dma/i8257.o
  CC      hw/dma/xilinx_axidma.o
  CC      hw/dma/xlnx-zynq-devcfg.o
  CC      hw/gpio/max7310.o
  CC      hw/gpio/pl061.o
  CC      hw/gpio/zaurus.o
  CC      hw/i2c/core.o
  CC      hw/gpio/gpio_key.o
  CC      hw/i2c/smbus.o
  CC      hw/i2c/smbus_eeprom.o
  CC      hw/i2c/i2c-ddc.o
  CC      hw/i2c/versatile_i2c.o
  CC      hw/i2c/smbus_ich9.o
  CC      hw/i2c/pm_smbus.o
  CC      hw/i2c/bitbang_i2c.o
  CC      hw/i2c/exynos4210_i2c.o
  CC      hw/i2c/imx_i2c.o
  CC      hw/i2c/aspeed_i2c.o
  CC      hw/ide/core.o
  CC      hw/ide/atapi.o
  CC      hw/ide/qdev.o
  CC      hw/ide/pci.o
  CC      hw/ide/isa.o
  CC      hw/ide/piix.o
  CC      hw/ide/microdrive.o
  CC      hw/ide/ahci.o
  CC      hw/ide/ich.o
  CC      hw/input/hid.o
  CC      hw/ide/ahci-allwinner.o
  CC      hw/input/lm832x.o
  CC      hw/input/pckbd.o
  CC      hw/input/pl050.o
  CC      hw/input/ps2.o
  CC      hw/input/stellaris_input.o
  CC      hw/input/tsc2005.o
  CC      hw/input/virtio-input.o
  CC      hw/input/virtio-input-hid.o
  CC      hw/intc/i8259_common.o
  CC      hw/intc/i8259.o
  CC      hw/intc/pl190.o
  CC      hw/intc/xlnx-pmu-iomod-intc.o
  CC      hw/intc/xlnx-zynqmp-ipi.o
  CC      hw/intc/imx_gpcv2.o
  CC      hw/intc/imx_avic.o
  CC      hw/intc/realview_gic.o
  CC      hw/intc/ioapic_common.o
  CC      hw/intc/arm_gic_common.o
  CC      hw/intc/arm_gic.o
  CC      hw/intc/arm_gicv2m.o
  CC      hw/intc/arm_gicv3_common.o
  CC      hw/intc/arm_gicv3.o
  CC      hw/intc/arm_gicv3_dist.o
  CC      hw/intc/arm_gicv3_redist.o
  CC      hw/intc/arm_gicv3_its_common.o
  CC      hw/intc/intc.o
  CC      hw/ipack/ipack.o
  CC      hw/ipack/tpci200.o
  CC      hw/ipmi/ipmi.o
  CC      hw/ipmi/ipmi_bmc_sim.o
  CC      hw/ipmi/ipmi_bmc_extern.o
  CC      hw/ipmi/isa_ipmi_kcs.o
  CC      hw/ipmi/isa_ipmi_bt.o
  CC      hw/isa/isa-bus.o
  CC      hw/isa/isa-superio.o
  CC      hw/isa/smc37c669-superio.o
  CC      hw/isa/apm.o
  CC      hw/mem/pc-dimm.o
  CC      hw/mem/nvdimm.o
  CC      hw/misc/applesmc.o
  CC      hw/misc/max111x.o
  CC      hw/misc/tmp105.o
  CC      hw/misc/tmp421.o
  CC      hw/misc/debugexit.o
  CC      hw/misc/sga.o
  CC      hw/misc/pc-testdev.o
  CC      hw/misc/pci-testdev.o
  CC      hw/misc/edu.o
  CC      hw/misc/unimp.o
  CC      hw/misc/vmcoreinfo.o
  CC      hw/misc/arm_l2x0.o
  CC      hw/misc/arm_integrator_debug.o
  CC      hw/misc/a9scu.o
  CC      hw/misc/arm11scu.o
  CC      hw/net/ne2000.o
  CC      hw/net/eepro100.o
  CC      hw/net/pcnet-pci.o
  CC      hw/net/pcnet.o
  CC      hw/net/e1000.o
  CC      hw/net/e1000x_common.o
  CC      hw/net/net_tx_pkt.o
  CC      hw/net/net_rx_pkt.o
  CC      hw/net/e1000e.o
  CC      hw/net/e1000e_core.o
  CC      hw/net/rtl8139.o
  CC      hw/net/vmxnet3.o
  CC      hw/net/smc91c111.o
  CC      hw/net/lan9118.o
  CC      hw/net/ne2000-isa.o
  CC      hw/net/xgmac.o
  CC      hw/net/xilinx_axienet.o
  CC      hw/net/allwinner_emac.o
  CC      hw/net/imx_fec.o
  CC      hw/net/cadence_gem.o
  CC      hw/net/stellaris_enet.o
  CC      hw/net/ftgmac100.o
  CC      hw/net/rocker/rocker.o
  CC      hw/net/rocker/rocker_fp.o
  CC      hw/net/rocker/rocker_desc.o
  CC      hw/net/rocker/rocker_world.o
  CC      hw/net/rocker/rocker_of_dpa.o
  CC      hw/net/can/can_sja1000.o
  CC      hw/net/can/can_kvaser_pci.o
  CC      hw/net/can/can_pcm3680_pci.o
  CC      hw/net/can/can_mioe3680_pci.o
  CC      hw/nvram/eeprom93xx.o
  CC      hw/nvram/eeprom_at24c.o
  CC      hw/nvram/fw_cfg.o
  CC      hw/nvram/chrp_nvram.o
  CC      hw/pci-bridge/pci_bridge_dev.o
  CC      hw/pci-bridge/pcie_root_port.o
  CC      hw/pci-bridge/gen_pcie_root_port.o
  CC      hw/pci-bridge/pcie_pci_bridge.o
  CC      hw/pci-bridge/pci_expander_bridge.o
  CC      hw/pci-bridge/xio3130_upstream.o
  CC      hw/pci-bridge/xio3130_downstream.o
  CC      hw/pci-bridge/ioh3420.o
  CC      hw/pci-bridge/i82801b11.o
  CC      hw/pci-host/pam.o
  CC      hw/pci-host/versatile.o
  CC      hw/pci-host/piix.o
  CC      hw/pci-host/q35.o
  CC      hw/pci-host/gpex.o
  CC      hw/pci-host/designware.o
  CC      hw/pci/pci.o
  CC      hw/pci/pci_bridge.o
  CC      hw/pci/msix.o
  CC      hw/pci/msi.o
  CC      hw/pci/shpc.o
  CC      hw/pci/slotid_cap.o
  CC      hw/pci/pci_host.o
  CC      hw/pci/pcie_host.o
  CC      hw/pci/pcie.o
  CC      hw/pci/pcie_aer.o
  CC      hw/pci/pcie_port.o
  CC      hw/pci/pci-stub.o
  CC      hw/pcmcia/pcmcia.o
  CC      hw/scsi/scsi-disk.o
  CC      hw/scsi/scsi-generic.o
  CC      hw/scsi/scsi-bus.o
  CC      hw/scsi/lsi53c895a.o
  CC      hw/scsi/mptsas.o
  CC      hw/scsi/mptconfig.o
  CC      hw/scsi/mptendian.o
  CC      hw/scsi/megasas.o
  CC      hw/scsi/vmw_pvscsi.o
  CC      hw/scsi/esp.o
  CC      hw/scsi/esp-pci.o
  CC      hw/sd/pl181.o
  CC      hw/sd/ssi-sd.o
  CC      hw/sd/sd.o
  CC      hw/sd/sdmmc-internal.o
  CC      hw/sd/core.o
  CC      hw/sd/sdhci.o
  CC      hw/smbios/smbios.o
  CC      hw/smbios/smbios_type_38.o
  CC      hw/smbios/smbios-stub.o
  CC      hw/smbios/smbios_type_38-stub.o
  CC      hw/ssi/pl022.o
  CC      hw/ssi/ssi.o
  CC      hw/ssi/xilinx_spips.o
  CC      hw/ssi/aspeed_smc.o
  CC      hw/ssi/stm32f2xx_spi.o
  CC      hw/ssi/mss-spi.o
  CC      hw/timer/arm_timer.o
  CC      hw/timer/arm_mptimer.o
  CC      hw/timer/armv7m_systick.o
  CC      hw/timer/a9gtimer.o
  CC      hw/timer/cadence_ttc.o
  CC      hw/timer/ds1338.o
  CC      hw/timer/hpet.o
  CC      hw/timer/i8254_common.o
  CC      hw/timer/i8254.o
  CC      hw/timer/pl031.o
  CC      hw/timer/twl92230.o
  CC      hw/timer/imx_epit.o
  CC      hw/timer/imx_gpt.o
  CC      hw/timer/xlnx-zynqmp-rtc.o
  CC      hw/timer/stm32f2xx_timer.o
  CC      hw/timer/aspeed_timer.o
  CC      hw/timer/cmsdk-apb-timer.o
  CC      hw/timer/mss-timer.o
  CC      hw/tpm/tpm_util.o
  CC      hw/tpm/tpm_tis.o
  CC      hw/tpm/tpm_crb.o
  CC      hw/usb/core.o
  CC      hw/usb/combined-packet.o
  CC      hw/usb/bus.o
  CC      hw/usb/libhw.o
  CC      hw/usb/desc.o
  CC      hw/usb/desc-msos.o
  CC      hw/usb/hcd-uhci.o
  CC      hw/usb/hcd-ohci.o
  CC      hw/usb/hcd-ehci.o
  CC      hw/usb/hcd-ehci-pci.o
  CC      hw/usb/hcd-ehci-sysbus.o
  CC      hw/usb/hcd-xhci.o
  CC      hw/usb/hcd-xhci-nec.o
  CC      hw/usb/hcd-musb.o
  CC      hw/usb/dev-hub.o
  CC      hw/usb/dev-hid.o
  CC      hw/usb/dev-wacom.o
  CC      hw/usb/dev-storage.o
  CC      hw/usb/dev-uas.o
  CC      hw/usb/dev-audio.o
  CC      hw/usb/dev-serial.o
  CC      hw/usb/dev-network.o
  CC      hw/usb/dev-bluetooth.o
  CC      hw/usb/dev-smartcard-reader.o
  CC      hw/usb/host-stub.o
  CC      hw/virtio/virtio-rng.o
  CC      hw/virtio/virtio-pci.o
  CC      hw/virtio/virtio-bus.o
  CC      hw/virtio/virtio-mmio.o
  CC      hw/virtio/vhost-stub.o
  CC      hw/watchdog/watchdog.o
  CC      hw/watchdog/wdt_i6300esb.o
  CC      hw/watchdog/wdt_ib700.o
  CC      hw/watchdog/wdt_aspeed.o
  CC      migration/migration.o
  CC      migration/socket.o
  CC      migration/fd.o
  CC      migration/exec.o
  CC      migration/tls.o
  CC      migration/channel.o
  CC      migration/savevm.o
  CC      migration/colo-comm.o
  CC      migration/colo.o
  CC      migration/colo-failover.o
  CC      migration/vmstate.o
  CC      migration/vmstate-types.o
  CC      migration/page_cache.o
  CC      migration/qemu-file.o
  CC      migration/global_state.o
  CC      migration/qemu-file-channel.o
  CC      migration/xbzrle.o
  CC      migration/postcopy-ram.o
  CC      migration/qjson.o
  CC      migration/block-dirty-bitmap.o
  CC      migration/block.o
  CC      net/net.o
  CC      net/queue.o
  CC      net/checksum.o
  CC      net/util.o
  CC      net/hub.o
  CC      net/socket.o
  CC      net/dump.o
  CC      net/eth.o
  CC      net/slirp.o
  CC      net/filter.o
  CC      net/filter-buffer.o
  CC      net/filter-mirror.o
  CC      net/colo-compare.o
  CC      net/colo.o
  CC      net/filter-rewriter.o
  CC      net/filter-replay.o
  CC      net/tap-win32.o
  CC      net/can/can_core.o
  CC      net/can/can_host.o
  CC      qom/cpu.o
  CC      replay/replay.o
  CC      replay/replay-internal.o
  CC      replay/replay-events.o
  CC      replay/replay-time.o
  CC      replay/replay-input.o
  CC      replay/replay-char.o
  CC      replay/replay-snapshot.o
  CC      replay/replay-net.o
  CC      replay/replay-audio.o
  CC      slirp/cksum.o
  CC      slirp/if.o
  CC      slirp/ip_icmp.o
  CC      slirp/ip6_icmp.o
  CC      slirp/ip6_input.o
  CC      slirp/ip6_output.o
  CC      slirp/ip_input.o
  CC      slirp/ip_output.o
  CC      slirp/dnssearch.o
  CC      slirp/dhcpv6.o
  CC      slirp/slirp.o
  CC      slirp/mbuf.o
  CC      slirp/misc.o
  CC      slirp/sbuf.o
  CC      slirp/socket.o
  CC      slirp/tcp_input.o
  CC      slirp/tcp_output.o
  CC      slirp/tcp_subr.o
  CC      slirp/tcp_timer.o
  CC      slirp/udp.o
  CC      slirp/udp6.o
  CC      slirp/bootp.o
  CC      slirp/tftp.o
  CC      slirp/arp_table.o
  CC      slirp/ndp_table.o
  CC      slirp/ncsi.o
  CC      ui/keymaps.o
  CC      ui/console.o
  CC      ui/cursor.o
  CC      ui/qemu-pixman.o
  CC      ui/input.o
  CC      ui/input-keymap.o
  CC      ui/input-legacy.o
  CC      ui/vnc.o
  CC      ui/vnc-enc-zlib.o
  CC      ui/vnc-enc-hextile.o
  CC      ui/vnc-enc-tight.o
  CC      ui/vnc-palette.o
  CC      ui/vnc-enc-zrle.o
  CC      ui/vnc-auth-vencrypt.o
  CC      ui/vnc-ws.o
  CC      ui/vnc-jobs.o
  CC      ui/sdl.o
  CC      ui/sdl_zoom.o
  CC      ui/gtk.o
  CC      chardev/char.o
  CC      chardev/char-console.o
  CC      chardev/char-fe.o
  CC      chardev/char-file.o
  CC      chardev/char-io.o
  CC      chardev/char-mux.o
  CC      chardev/char-null.o
  CC      chardev/char-pipe.o
  CC      chardev/char-ringbuf.o
  CC      chardev/char-serial.o
  CC      chardev/char-socket.o
  CC      chardev/char-stdio.o
  CC      chardev/char-udp.o
  CC      chardev/char-win.o
  CC      chardev/char-win-stdio.o
  CC      qga/commands.o
  CC      qga/guest-agent-command-state.o
  CC      qga/main.o
  CC      qga/commands-win32.o
  AS      optionrom/multiboot.o
  AS      optionrom/linuxboot.o
  CC      optionrom/linuxboot_dma.o
  AS      optionrom/kvmvapic.o
  BUILD   optionrom/multiboot.img
  BUILD   optionrom/linuxboot.img
  BUILD   optionrom/linuxboot_dma.img
  BUILD   optionrom/kvmvapic.img
  BUILD   optionrom/multiboot.raw
  BUILD   optionrom/linuxboot.raw
  CC      qga/channel-win32.o
  BUILD   optionrom/linuxboot_dma.raw
  BUILD   optionrom/kvmvapic.raw
  SIGN    optionrom/multiboot.bin
  CC      qga/service-win32.o
  CC      qga/vss-win32.o
  SIGN    optionrom/linuxboot.bin
  SIGN    optionrom/linuxboot_dma.bin
  SIGN    optionrom/kvmvapic.bin
  CC      qga/qapi-generated/qga-qapi-types.o
  CC      qga/qapi-generated/qga-qapi-visit.o
  CC      qga/qapi-generated/qga-qapi-commands.o
  AR      libqemuutil.a
  CC      qemu-img.o
  LINK    qemu-io.exe
  LINK    qemu-img.exe
  LINK    qemu-ga.exe
  GEN     x86_64-softmmu/config-target.h
  GEN     x86_64-softmmu/hmp-commands-info.h
  GEN     x86_64-softmmu/hmp-commands.h
  GEN     aarch64-softmmu/hmp-commands.h
  GEN     aarch64-softmmu/config-target.h
  GEN     aarch64-softmmu/hmp-commands-info.h
  CC      x86_64-softmmu/exec.o
  CC      x86_64-softmmu/tcg/tcg.o
  CC      x86_64-softmmu/tcg/tcg-op.o
  CC      x86_64-softmmu/tcg/tcg-common.o
  CC      x86_64-softmmu/tcg/tcg-op-vec.o
  CC      x86_64-softmmu/tcg/tcg-op-gvec.o
  CC      x86_64-softmmu/tcg/optimize.o
  CC      aarch64-softmmu/exec.o
  CC      x86_64-softmmu/fpu/softfloat.o
  CC      x86_64-softmmu/disas.o
  CC      aarch64-softmmu/tcg/tcg.o
  GEN     x86_64-softmmu/gdbstub-xml.c
  CC      x86_64-softmmu/arch_init.o
  CC      x86_64-softmmu/cpus.o
  CC      x86_64-softmmu/monitor.o
  CC      x86_64-softmmu/gdbstub.o
  CC      aarch64-softmmu/tcg/tcg-op.o
  CC      x86_64-softmmu/balloon.o
  CC      aarch64-softmmu/tcg/tcg-op-vec.o
  CC      x86_64-softmmu/ioport.o
  CC      x86_64-softmmu/numa.o
  CC      x86_64-softmmu/qtest.o
  CC      x86_64-softmmu/memory_mapping.o
  CC      x86_64-softmmu/memory.o
  CC      aarch64-softmmu/tcg/tcg-op-gvec.o
  CC      x86_64-softmmu/dump.o
  CC      x86_64-softmmu/migration/ram.o
  CC      x86_64-softmmu/accel/accel.o
  CC      x86_64-softmmu/accel/stubs/hvf-stub.o
  CC      aarch64-softmmu/tcg/tcg-common.o
  CC      aarch64-softmmu/tcg/optimize.o
  CC      x86_64-softmmu/accel/stubs/whpx-stub.o
  CC      x86_64-softmmu/accel/stubs/kvm-stub.o
  CC      aarch64-softmmu/fpu/softfloat.o
  CC      aarch64-softmmu/disas.o
  CC      x86_64-softmmu/accel/tcg/tcg-all.o
  CC      x86_64-softmmu/accel/tcg/cputlb.o
  CC      x86_64-softmmu/accel/tcg/tcg-runtime.o
  GEN     aarch64-softmmu/gdbstub-xml.c
  CC      aarch64-softmmu/arch_init.o
  CC      aarch64-softmmu/cpus.o
  CC      aarch64-softmmu/monitor.o
  CC      aarch64-softmmu/gdbstub.o
  CC      x86_64-softmmu/accel/tcg/cpu-exec-common.o
  CC      x86_64-softmmu/accel/tcg/cpu-exec.o
  CC      x86_64-softmmu/accel/tcg/tcg-runtime-gvec.o
  CC      aarch64-softmmu/balloon.o
  CC      x86_64-softmmu/accel/tcg/translate-all.o
  CC      aarch64-softmmu/ioport.o
  CC      x86_64-softmmu/accel/tcg/translator.o
  CC      x86_64-softmmu/hw/block/virtio-blk.o
  CC      x86_64-softmmu/hw/block/dataplane/virtio-blk.o
  CC      aarch64-softmmu/numa.o
  CC      x86_64-softmmu/hw/char/virtio-serial-bus.o
  CC      x86_64-softmmu/hw/core/generic-loader.o
  CC      x86_64-softmmu/hw/core/null-machine.o
  CC      x86_64-softmmu/hw/display/vga.o
  CC      x86_64-softmmu/hw/display/virtio-gpu.o
  CC      x86_64-softmmu/hw/display/virtio-gpu-3d.o
  CC      x86_64-softmmu/hw/display/virtio-gpu-pci.o
  CC      aarch64-softmmu/memory_mapping.o
  CC      aarch64-softmmu/qtest.o
  CC      aarch64-softmmu/dump.o
  CC      x86_64-softmmu/hw/display/virtio-vga.o
  CC      aarch64-softmmu/memory.o
  CC      aarch64-softmmu/migration/ram.o
  CC      x86_64-softmmu/hw/intc/apic.o
  CC      aarch64-softmmu/accel/accel.o
  CC      x86_64-softmmu/hw/intc/apic_common.o
  CC      aarch64-softmmu/accel/stubs/hax-stub.o
  CC      aarch64-softmmu/accel/stubs/hvf-stub.o
  CC      aarch64-softmmu/accel/stubs/whpx-stub.o
  CC      aarch64-softmmu/accel/stubs/kvm-stub.o
  CC      aarch64-softmmu/accel/tcg/tcg-all.o
  CC      aarch64-softmmu/accel/tcg/cputlb.o
  CC      x86_64-softmmu/hw/intc/ioapic.o
  CC      aarch64-softmmu/accel/tcg/tcg-runtime.o
  CC      aarch64-softmmu/accel/tcg/tcg-runtime-gvec.o
  CC      aarch64-softmmu/accel/tcg/cpu-exec.o
  CC      aarch64-softmmu/accel/tcg/cpu-exec-common.o
  CC      aarch64-softmmu/accel/tcg/translate-all.o
  CC      x86_64-softmmu/hw/isa/lpc_ich9.o
  CC      aarch64-softmmu/accel/tcg/translator.o
  CC      aarch64-softmmu/hw/adc/stm32f2xx_adc.o
  CC      aarch64-softmmu/hw/block/virtio-blk.o
  CC      aarch64-softmmu/hw/block/dataplane/virtio-blk.o
  CC      aarch64-softmmu/hw/char/exynos4210_uart.o
  CC      aarch64-softmmu/hw/char/omap_uart.o
  CC      aarch64-softmmu/hw/char/digic-uart.o
  CC      aarch64-softmmu/hw/char/stm32f2xx_usart.o
  CC      aarch64-softmmu/hw/char/bcm2835_aux.o
  CC      aarch64-softmmu/hw/char/virtio-serial-bus.o
  CC      x86_64-softmmu/hw/misc/pvpanic.o
  CC      aarch64-softmmu/hw/core/generic-loader.o
  CC      aarch64-softmmu/hw/core/null-machine.o
  CC      x86_64-softmmu/hw/misc/mmio_interface.o
  CC      aarch64-softmmu/hw/cpu/arm11mpcore.o
  CC      aarch64-softmmu/hw/cpu/realview_mpcore.o
  CC      aarch64-softmmu/hw/cpu/a9mpcore.o
  CC      aarch64-softmmu/hw/cpu/a15mpcore.o
  CC      x86_64-softmmu/hw/net/virtio-net.o
  CC      x86_64-softmmu/hw/net/vhost_net.o
  CC      aarch64-softmmu/hw/display/omap_dss.o
  CC      aarch64-softmmu/hw/display/omap_lcdc.o
  CC      aarch64-softmmu/hw/display/pxa2xx_lcd.o
  CC      aarch64-softmmu/hw/display/bcm2835_fb.o
  CC      aarch64-softmmu/hw/display/vga.o
  CC      aarch64-softmmu/hw/display/virtio-gpu.o
  CC      aarch64-softmmu/hw/display/virtio-gpu-3d.o
  CC      aarch64-softmmu/hw/display/virtio-gpu-pci.o
  CC      aarch64-softmmu/hw/display/dpcd.o
  CC      x86_64-softmmu/hw/scsi/virtio-scsi.o
  CC      aarch64-softmmu/hw/display/xlnx_dp.o
  CC      x86_64-softmmu/hw/scsi/virtio-scsi-dataplane.o
  CC      aarch64-softmmu/hw/dma/xlnx_dpdma.o
  CC      x86_64-softmmu/hw/timer/mc146818rtc.o
  CC      aarch64-softmmu/hw/dma/omap_dma.o
  CC      aarch64-softmmu/hw/dma/soc_dma.o
  CC      aarch64-softmmu/hw/dma/pxa2xx_dma.o
  CC      x86_64-softmmu/hw/virtio/virtio.o
  CC      x86_64-softmmu/hw/virtio/virtio-balloon.o
  CC      aarch64-softmmu/hw/dma/bcm2835_dma.o
  CC      x86_64-softmmu/hw/virtio/virtio-crypto.o
  CC      aarch64-softmmu/hw/gpio/omap_gpio.o
  CC      x86_64-softmmu/hw/virtio/virtio-crypto-pci.o
  CC      x86_64-softmmu/hw/i386/multiboot.o
  CC      x86_64-softmmu/hw/i386/pc.o
  CC      x86_64-softmmu/hw/i386/pc_piix.o
  CC      x86_64-softmmu/hw/i386/pc_q35.o
  CC      x86_64-softmmu/hw/i386/x86-iommu.o
  CC      x86_64-softmmu/hw/i386/pc_sysfw.o
  CC      x86_64-softmmu/hw/i386/intel_iommu.o
  CC      x86_64-softmmu/hw/i386/amd_iommu.o
  CC      x86_64-softmmu/hw/i386/vmport.o
  CC      x86_64-softmmu/hw/i386/vmmouse.o
  CC      x86_64-softmmu/hw/i386/kvmvapic.o
  CC      x86_64-softmmu/hw/i386/acpi-build.o
  CC      x86_64-softmmu/target/i386/helper.o
  CC      x86_64-softmmu/target/i386/cpu.o
  CC      x86_64-softmmu/target/i386/gdbstub.o
  CC      x86_64-softmmu/target/i386/xsave_helper.o
  CC      x86_64-softmmu/target/i386/translate.o
  CC      x86_64-softmmu/target/i386/bpt_helper.o
  CC      x86_64-softmmu/target/i386/cc_helper.o
  CC      x86_64-softmmu/target/i386/excp_helper.o
  CC      x86_64-softmmu/target/i386/fpu_helper.o
  CC      x86_64-softmmu/target/i386/int_helper.o
  CC      x86_64-softmmu/target/i386/mem_helper.o
  CC      x86_64-softmmu/target/i386/misc_helper.o
  CC      x86_64-softmmu/target/i386/mpx_helper.o
  CC      x86_64-softmmu/target/i386/seg_helper.o
  CC      aarch64-softmmu/hw/gpio/imx_gpio.o
  CC      aarch64-softmmu/hw/gpio/bcm2835_gpio.o
  CC      x86_64-softmmu/target/i386/smm_helper.o
  CC      aarch64-softmmu/hw/i2c/omap_i2c.o
  CC      x86_64-softmmu/target/i386/svm_helper.o
  CC      x86_64-softmmu/target/i386/machine.o
  CC      x86_64-softmmu/target/i386/arch_memory_mapping.o
  CC      x86_64-softmmu/target/i386/arch_dump.o
  CC      x86_64-softmmu/target/i386/monitor.o
  CC      x86_64-softmmu/target/i386/kvm-stub.o
  CC      x86_64-softmmu/target/i386/sev-stub.o
  CC      aarch64-softmmu/hw/input/pxa2xx_keypad.o
  CC      x86_64-softmmu/target/i386/hax-all.o
  CC      x86_64-softmmu/target/i386/hax-mem.o
  CC      x86_64-softmmu/target/i386/hax-windows.o
  CC      aarch64-softmmu/hw/intc/armv7m_nvic.o
  CC      x86_64-softmmu/trace/control-target.o
  CC      aarch64-softmmu/hw/input/tsc210x.o
  GEN     trace/generated-helpers.c
  CC      aarch64-softmmu/hw/intc/exynos4210_gic.o
  CC      aarch64-softmmu/hw/intc/exynos4210_combiner.o
  CC      aarch64-softmmu/hw/intc/omap_intc.o
  CC      x86_64-softmmu/gdbstub-xml.o
  CC      aarch64-softmmu/hw/intc/bcm2835_ic.o
  CC      x86_64-softmmu/trace/generated-helpers.o
  CC      aarch64-softmmu/hw/intc/bcm2836_control.o
  CC      aarch64-softmmu/hw/intc/allwinner-a10-pic.o
  LINK    x86_64-softmmu/qemu-system-x86_64w.exe
  CC      aarch64-softmmu/hw/intc/aspeed_vic.o
  CC      aarch64-softmmu/hw/intc/arm_gicv3_cpuif.o
  CC      aarch64-softmmu/hw/misc/arm_sysctl.o
  CC      aarch64-softmmu/hw/misc/cbus.o
  CC      aarch64-softmmu/hw/misc/exynos4210_pmu.o
  CC      aarch64-softmmu/hw/misc/exynos4210_clk.o
  CC      aarch64-softmmu/hw/misc/exynos4210_rng.o
  CC      aarch64-softmmu/hw/misc/imx_ccm.o
  CC      aarch64-softmmu/hw/misc/imx31_ccm.o
  CC      aarch64-softmmu/hw/misc/imx25_ccm.o
  CC      aarch64-softmmu/hw/misc/imx6_ccm.o
  CC      aarch64-softmmu/hw/misc/imx6_src.o
  CC      aarch64-softmmu/hw/misc/imx7_ccm.o
  CC      aarch64-softmmu/hw/misc/imx2_wdt.o
  CC      aarch64-softmmu/hw/misc/imx7_snvs.o
  GEN     x86_64-softmmu/qemu-system-x86_64.exe
  CC      aarch64-softmmu/hw/misc/imx7_gpr.o
  CC      aarch64-softmmu/hw/misc/mst_fpga.o
  CC      aarch64-softmmu/hw/misc/omap_clk.o
  CC      aarch64-softmmu/hw/misc/omap_gpmc.o
  CC      aarch64-softmmu/hw/misc/omap_l4.o
  CC      aarch64-softmmu/hw/misc/omap_sdrc.o
  CC      aarch64-softmmu/hw/misc/omap_tap.o
  CC      aarch64-softmmu/hw/misc/bcm2835_mbox.o
  CC      aarch64-softmmu/hw/misc/bcm2835_property.o
  CC      aarch64-softmmu/hw/misc/bcm2835_rng.o
  CC      aarch64-softmmu/hw/misc/zynq_slcr.o
  CC      aarch64-softmmu/hw/misc/zynq-xadc.o
  CC      aarch64-softmmu/hw/misc/stm32f2xx_syscfg.o
  CC      aarch64-softmmu/hw/misc/mps2-fpgaio.o
  CC      aarch64-softmmu/hw/misc/mps2-scc.o
  CC      aarch64-softmmu/hw/misc/tz-ppc.o
  CC      aarch64-softmmu/hw/misc/iotkit-secctl.o
  CC      aarch64-softmmu/hw/misc/auxbus.o
  CC      aarch64-softmmu/hw/misc/aspeed_scu.o
  CC      aarch64-softmmu/hw/misc/aspeed_sdmc.o
  CC      aarch64-softmmu/hw/misc/mmio_interface.o
  CC      aarch64-softmmu/hw/misc/msf2-sysreg.o
  CC      aarch64-softmmu/hw/net/virtio-net.o
  CC      aarch64-softmmu/hw/net/vhost_net.o
  CC      aarch64-softmmu/hw/pcmcia/pxa2xx.o
  CC      aarch64-softmmu/hw/scsi/virtio-scsi.o
  CC      aarch64-softmmu/hw/sd/omap_mmc.o
  CC      aarch64-softmmu/hw/sd/pxa2xx_mmci.o
  CC      aarch64-softmmu/hw/scsi/virtio-scsi-dataplane.o
  CC      aarch64-softmmu/hw/sd/bcm2835_sdhost.o
  CC      aarch64-softmmu/hw/timer/exynos4210_rtc.o
  CC      aarch64-softmmu/hw/ssi/imx_spi.o
  CC      aarch64-softmmu/hw/timer/exynos4210_mct.o
  CC      aarch64-softmmu/hw/timer/exynos4210_pwm.o
  CC      aarch64-softmmu/hw/ssi/omap_spi.o
  CC      aarch64-softmmu/hw/timer/omap_gptimer.o
  CC      aarch64-softmmu/hw/timer/omap_synctimer.o
  CC      aarch64-softmmu/hw/timer/pxa2xx_timer.o
  CC      aarch64-softmmu/hw/timer/digic-timer.o
  CC      aarch64-softmmu/hw/timer/allwinner-a10-pit.o
  CC      aarch64-softmmu/hw/usb/tusb6010.o
  CC      aarch64-softmmu/hw/usb/chipidea.o
  CC      aarch64-softmmu/hw/virtio/virtio.o
  CC      aarch64-softmmu/hw/virtio/virtio-balloon.o
  CC      aarch64-softmmu/hw/virtio/virtio-crypto.o
  CC      aarch64-softmmu/hw/virtio/virtio-crypto-pci.o
  CC      aarch64-softmmu/hw/arm/boot.o
  CC      aarch64-softmmu/hw/arm/virt.o
  CC      aarch64-softmmu/hw/arm/sysbus-fdt.o
  CC      aarch64-softmmu/hw/arm/virt-acpi-build.o
  CC      aarch64-softmmu/hw/arm/digic_boards.o
  CC      aarch64-softmmu/hw/arm/exynos4_boards.o
  CC      aarch64-softmmu/hw/arm/highbank.o
  CC      aarch64-softmmu/hw/arm/integratorcp.o
  CC      aarch64-softmmu/hw/arm/mainstone.o
  CC      aarch64-softmmu/hw/arm/musicpal.o
  CC      aarch64-softmmu/hw/arm/netduino2.o
  CC      aarch64-softmmu/hw/arm/nseries.o
  CC      aarch64-softmmu/hw/arm/omap_sx1.o
  CC      aarch64-softmmu/hw/arm/palm.o
  CC      aarch64-softmmu/hw/arm/gumstix.o
  CC      aarch64-softmmu/hw/arm/spitz.o
  CC      aarch64-softmmu/hw/arm/tosa.o
  CC      aarch64-softmmu/hw/arm/z2.o
  CC      aarch64-softmmu/hw/arm/realview.o
  CC      aarch64-softmmu/hw/arm/stellaris.o
  CC      aarch64-softmmu/hw/arm/collie.o
  CC      aarch64-softmmu/hw/arm/vexpress.o
  CC      aarch64-softmmu/hw/arm/versatilepb.o
  CC      aarch64-softmmu/hw/arm/xilinx_zynq.o
  CC      aarch64-softmmu/hw/arm/armv7m.o
  CC      aarch64-softmmu/hw/arm/exynos4210.o
  CC      aarch64-softmmu/hw/arm/pxa2xx.o
  CC      aarch64-softmmu/hw/arm/pxa2xx_gpio.o
  CC      aarch64-softmmu/hw/arm/pxa2xx_pic.o
  CC      aarch64-softmmu/hw/arm/digic.o
  CC      aarch64-softmmu/hw/arm/omap1.o
  CC      aarch64-softmmu/hw/arm/omap2.o
  CC      aarch64-softmmu/hw/arm/strongarm.o
  CC      aarch64-softmmu/hw/arm/allwinner-a10.o
  CC      aarch64-softmmu/hw/arm/cubieboard.o
  CC      aarch64-softmmu/hw/arm/bcm2835_peripherals.o
  CC      aarch64-softmmu/hw/arm/bcm2836.o
  CC      aarch64-softmmu/hw/arm/raspi.o
  CC      aarch64-softmmu/hw/arm/stm32f205_soc.o
  CC      aarch64-softmmu/hw/arm/xlnx-zynqmp.o
  CC      aarch64-softmmu/hw/arm/xlnx-zcu102.o
  CC      aarch64-softmmu/hw/arm/fsl-imx25.o
  CC      aarch64-softmmu/hw/arm/imx25_pdk.o
  CC      aarch64-softmmu/hw/arm/fsl-imx31.o
  CC      aarch64-softmmu/hw/arm/kzm.o
  CC      aarch64-softmmu/hw/arm/fsl-imx6.o
  CC      aarch64-softmmu/hw/arm/sabrelite.o
  CC      aarch64-softmmu/hw/arm/aspeed_soc.o
  CC      aarch64-softmmu/hw/arm/aspeed.o
  CC      aarch64-softmmu/hw/arm/mps2.o
  CC      aarch64-softmmu/hw/arm/mps2-tz.o
  CC      aarch64-softmmu/hw/arm/msf2-soc.o
  CC      aarch64-softmmu/hw/arm/msf2-som.o
  CC      aarch64-softmmu/hw/arm/iotkit.o
  CC      aarch64-softmmu/hw/arm/fsl-imx7.o
  CC      aarch64-softmmu/hw/arm/mcimx7d-sabre.o
  CC      aarch64-softmmu/target/arm/arm-semi.o
  CC      aarch64-softmmu/target/arm/machine.o
  CC      aarch64-softmmu/target/arm/psci.o
  CC      aarch64-softmmu/target/arm/arch_dump.o
  CC      aarch64-softmmu/target/arm/monitor.o
  CC      aarch64-softmmu/target/arm/kvm-stub.o
  CC      aarch64-softmmu/target/arm/translate.o
  CC      aarch64-softmmu/target/arm/op_helper.o
  CC      aarch64-softmmu/target/arm/helper.o
  CC      aarch64-softmmu/target/arm/cpu.o
  CC      aarch64-softmmu/target/arm/neon_helper.o
  CC      aarch64-softmmu/target/arm/iwmmxt_helper.o
  CC      aarch64-softmmu/target/arm/vec_helper.o
  CC      aarch64-softmmu/target/arm/gdbstub.o
  CC      aarch64-softmmu/target/arm/cpu64.o
  CC      aarch64-softmmu/target/arm/translate-a64.o
  CC      aarch64-softmmu/target/arm/helper-a64.o
  CC      aarch64-softmmu/target/arm/gdbstub64.o
  CC      aarch64-softmmu/target/arm/crypto_helper.o
  CC      aarch64-softmmu/target/arm/arm-powerctl.o
  GEN     trace/generated-helpers.c
  CC      aarch64-softmmu/trace/control-target.o
  CC      aarch64-softmmu/gdbstub-xml.o
  CC      aarch64-softmmu/trace/generated-helpers.o
  LINK    aarch64-softmmu/qemu-system-aarch64w.exe
  GEN     aarch64-softmmu/qemu-system-aarch64.exe
mkdir -p dtc/libfdt
mkdir -p dtc/tests
install -d -m 0755 "/tmp/qemu-test/build/=destdir/tmp/qemu-test/install"
install -d -m 0755 "/tmp/qemu-test/build/=destdir/tmp/qemu-test/install"
install -c -m 0755 qemu-ga.exe qemu-img.exe qemu-io.exe  "/tmp/qemu-test/build/=destdir/tmp/qemu-test/install"
x86_64-w64-mingw32-strip "/tmp/qemu-test/build/=destdir/tmp/qemu-test/install/qemu-ga.exe" "/tmp/qemu-test/build/=destdir/tmp/qemu-test/install/qemu-img.exe" "/tmp/qemu-test/build/=destdir/tmp/qemu-test/install/qemu-io.exe"
set -e; for x in bios.bin bios-256k.bin sgabios.bin vgabios.bin vgabios-cirrus.bin vgabios-stdvga.bin vgabios-vmware.bin vgabios-qxl.bin vgabios-virtio.bin ppc_rom.bin openbios-sparc32 openbios-sparc64 openbios-ppc QEMU,tcx.bin QEMU,cgthree.bin pxe-e1000.rom pxe-eepro100.rom pxe-ne2k_pci.rom pxe-pcnet.rom pxe-rtl8139.rom pxe-virtio.rom efi-e1000.rom efi-eepro100.rom efi-ne2k_pci.rom efi-pcnet.rom efi-rtl8139.rom efi-virtio.rom efi-e1000e.rom efi-vmxnet3.rom qemu-icon.bmp qemu_logo_no_text.svg bamboo.dtb canyonlands.dtb petalogix-s3adsp1800.dtb petalogix-ml605.dtb multiboot.bin linuxboot.bin linuxboot_dma.bin kvmvapic.bin s390-ccw.img s390-netboot.img spapr-rtas.bin slof.bin skiboot.lid palcode-clipper u-boot.e500 u-boot-sam460-20100605.bin qemu_vga.ndrv hppa-firmware.img; do \
	install -c -m 0644 /tmp/qemu-test/src/pc-bios/$x "/tmp/qemu-test/build/=destdir/tmp/qemu-test/install"; \
done
make -C po install
make[1]: Entering directory '/tmp/qemu-test/build/po'
  GEN     hu.mo
  GEN     tr.mo
  GEN     it.mo
  GEN     fr_FR.mo
  GEN     zh_CN.mo
  GEN     bg.mo
  GEN     de_DE.mo
for obj in hu.mo tr.mo it.mo bg.mo fr_FR.mo zh_CN.mo de_DE.mo; do \
    base=`basename $obj .mo`; \
    install -d /tmp/qemu-test/build/=destdir/tmp/qemu-test/install/share/locale/$base/LC_MESSAGES; \
    install -m644 $obj /tmp/qemu-test/build/=destdir/tmp/qemu-test/install/share/locale/$base/LC_MESSAGES/qemu.mo; \
done
make[1]: Leaving directory '/tmp/qemu-test/build/po'
install -d -m 0755 "/tmp/qemu-test/build/=destdir/tmp/qemu-test/install/keymaps"
set -e; for x in da     en-gb  et  fr     fr-ch  is  lt  modifiers  no  pt-br  sv ar      de     en-us  fi  fr-be  hr     it  lv  nl         pl  ru     th common  de-ch  es     fo  fr-ca  hu     ja  mk  nl-be      pt  sl     tr bepo    cz; do \
	install -c -m 0644 /tmp/qemu-test/src/pc-bios/keymaps/$x "/tmp/qemu-test/build/=destdir/tmp/qemu-test/install/keymaps"; \
done
install -c -m 0644 /tmp/qemu-test/build/trace-events-all "/tmp/qemu-test/build/=destdir/tmp/qemu-test/install/trace-events-all"
for d in x86_64-softmmu aarch64-softmmu; do \
make --no-print-directory --quiet BUILD_DIR=/tmp/qemu-test/build TARGET_DIR=$d/ -C $d install || exit 1 ; \
        done
mkdir -p dtc/libfdt
mkdir -p dtc/tests
rm -f *.timestamp
make -C tests/tcg clean
make[1]: Entering directory '/tmp/qemu-test/build/tests/tcg'
rm -f *.timestamp
rm -f *~ *.o test-i386.out test-i386.ref \
           test-x86_64.log test-x86_64.ref qruncom test_path hello-i386 linux-test testthread sha1-i386 test-i386 test-i386-fprem test-mmap  run-test-x86_64
make[1]: Leaving directory '/tmp/qemu-test/build/tests/tcg'
rm -rf tests/check-qdict.exe tests/test-char.exe tests/check-qnum.exe tests/check-qstring.exe tests/check-qlist.exe tests/check-qnull.exe tests/check-qobject.exe tests/check-qjson.exe tests/check-qlit.exe tests/test-qobject-output-visitor.exe tests/test-clone-visitor.exe tests/test-qobject-input-visitor.exe tests/test-qmp-cmds.exe tests/test-string-input-visitor.exe tests/test-string-output-visitor.exe tests/test-qmp-event.exe tests/test-opts-visitor.exe tests/test-coroutine.exe tests/test-visitor-serialization.exe tests/test-iov.exe tests/test-aio.exe tests/test-aio-multithread.exe tests/test-throttle.exe tests/test-thread-pool.exe tests/test-hbitmap.exe tests/test-bdrv-drain.exe tests/test-blockjob.exe tests/test-blockjob-txn.exe tests/test-block-backend.exe tests/test-x86-cpuid.exe tests/test-xbzrle.exe tests/test-cutils.exe tests/test-shift128.exe tests/test-mul64.exe tests/test-int128.exe tests/rcutorture.exe tests/test-rcu-list.exe tests/test-qdist.exe tests/test-qht.exe tests/test-qht-par.exe tests/test-bitops.exe tests/test-bitcnt.exe tests/test-qdev-global-props.exe tests/check-qom-interface.exe tests/check-qom-proplist.exe tests/test-qemu-opts.exe tests/test-keyval.exe tests/test-write-threshold.exe tests/test-crypto-hash.exe tests/test-crypto-hmac.exe tests/test-crypto-cipher.exe tests/test-crypto-secret.exe tests/test-crypto-tlscredsx509.exe tests/test-crypto-tlssession.exe tests/test-timed-average.exe tests/test-util-sockets.exe tests/test-io-task.exe tests/test-io-channel-socket.exe tests/test-io-channel-file.exe tests/test-io-channel-tls.exe tests/test-io-channel-command.exe tests/test-io-channel-buffer.exe tests/test-base64.exe tests/test-crypto-pbkdf.exe tests/test-crypto-ivgen.exe tests/test-crypto-afsplit.exe tests/test-crypto-xts.exe tests/test-crypto-block.exe tests/test-logging.exe tests/test-replication.exe tests/test-bufferiszero.exe tests/test-uuid.exe tests/ptimer-test.exe tests/test-qapi-util.exe tests/*.o 
rm -rf tests/ac97-test.exe tests/ahci-test.exe tests/bios-tables-test.exe tests/boot-order-test.exe tests/boot-serial-test.exe tests/cpu-plug-test.exe tests/device-introspect-test.exe tests/display-vga-test.exe tests/drive_del-test.exe tests/ds1338-test.exe tests/e1000-test.exe tests/e1000e-test.exe tests/eepro100-test.exe tests/endianness-test.exe tests/es1370-test.exe tests/fdc-test.exe tests/fw_cfg-test.exe tests/hd-geo-test.exe tests/i440fx-test.exe tests/i82801b11-test.exe tests/ide-test.exe tests/intel-hda-test.exe tests/ioh3420-test.exe tests/ipmi-bt-test.exe tests/ipmi-kcs-test.exe tests/ipoctal232-test.exe tests/m25p80-test.exe tests/m48t59-test.exe tests/machine-none-test.exe tests/megasas-test.exe tests/migration-test.exe tests/ne2000-test.exe tests/numa-test.exe tests/nvme-test.exe tests/pcnet-test.exe tests/pnv-xscom-test.exe tests/prom-env-test.exe tests/pvpanic-test.exe tests/pxe-test.exe tests/q35-test.exe tests/qmp-test.exe tests/qom-test.exe tests/rtas-test.exe tests/rtc-test.exe tests/rtl8139-test.exe tests/sdhci-test.exe tests/spapr-phb-test.exe tests/tco-test.exe tests/test-arm-mptimer.exe tests/test-hmp.exe tests/test-netfilter.exe tests/test-x86-cpuid-compat.exe tests/tmp105-test.exe tests/tpci200-test.exe tests/tpm-crb-test.exe tests/tpm-tis-test.exe tests/usb-hcd-ehci-test.exe tests/usb-hcd-ohci-test.exe tests/usb-hcd-uhci-test.exe tests/usb-hcd-xhci-test.exe tests/virtio-balloon-test.exe tests/virtio-blk-test.exe tests/virtio-console-test.exe tests/virtio-net-test.exe tests/virtio-rng-test.exe tests/virtio-scsi-test.exe tests/virtio-serial-test.exe tests/vmgenid-test.exe tests/vmxnet3-test.exe tests/wdt_ib700-test.exe
rm -f tests/test-qapi-gen-timestamp
rm -f config.mak op-i386.h opc-i386.h gen-op-i386.h op-arm.h opc-arm.h gen-op-arm.h
rm -f qemu-options.def
rm -f *.msi
find . \( -name '*.so' -o -name '*.dll' -o -name '*.mo' -o -name '*.[oda]' \) -type f -exec rm {} +
rm -f qemu-ga qemu-img.exe qemu-io.exe  qemu-ga TAGS cscope.* *.pod *~ */*~
rm -f fsdev/*.pod scsi/*.pod
rm -f qemu-img-cmds.h
rm -f ui/shader/*-vert.h ui/shader/*-frag.h
rm -f trace/generated-tracers-dtrace.dtrace*
rm -f trace/generated-tracers-dtrace.h*
rm -f qemu-version.h qemu-version.h-timestamp config-host.h config-host.h-timestamp qemu-options.def qemu-options.def-timestamp qapi/qapi-builtin-types.h qapi/qapi-builtin-types.h-timestamp qapi/qapi-builtin-types.c qapi/qapi-builtin-types.c-timestamp qapi/qapi-types.h qapi/qapi-types.h-timestamp qapi/qapi-types.c qapi/qapi-types.c-timestamp qapi/qapi-types-block-core.h qapi/qapi-types-block-core.h-timestamp qapi/qapi-types-block-core.c qapi/qapi-types-block-core.c-timestamp qapi/qapi-types-block.h qapi/qapi-types-block.h-timestamp qapi/qapi-types-block.c qapi/qapi-types-block.c-timestamp qapi/qapi-types-char.h qapi/qapi-types-char.h-timestamp qapi/qapi-types-char.c qapi/qapi-types-char.c-timestamp qapi/qapi-types-common.h qapi/qapi-types-common.h-timestamp qapi/qapi-types-common.c qapi/qapi-types-common.c-timestamp qapi/qapi-types-crypto.h qapi/qapi-types-crypto.h-timestamp qapi/qapi-types-crypto.c qapi/qapi-types-crypto.c-timestamp qapi/qapi-types-introspect.h qapi/qapi-types-introspect.h-timestamp qapi/qapi-types-introspect.c qapi/qapi-types-introspect.c-timestamp qapi/qapi-types-migration.h qapi/qapi-types-migration.h-timestamp qapi/qapi-types-migration.c qapi/qapi-types-migration.c-timestamp qapi/qapi-types-misc.h qapi/qapi-types-misc.h-timestamp qapi/qapi-types-misc.c qapi/qapi-types-misc.c-timestamp qapi/qapi-types-net.h qapi/qapi-types-net.h-timestamp qapi/qapi-types-net.c qapi/qapi-types-net.c-timestamp qapi/qapi-types-rocker.h qapi/qapi-types-rocker.h-timestamp qapi/qapi-types-rocker.c qapi/qapi-types-rocker.c-timestamp qapi/qapi-types-run-state.h qapi/qapi-types-run-state.h-timestamp qapi/qapi-types-run-state.c qapi/qapi-types-run-state.c-timestamp qapi/qapi-types-sockets.h qapi/qapi-types-sockets.h-timestamp qapi/qapi-types-sockets.c qapi/qapi-types-sockets.c-timestamp qapi/qapi-types-tpm.h qapi/qapi-types-tpm.h-timestamp qapi/qapi-types-tpm.c qapi/qapi-types-tpm.c-timestamp qapi/qapi-types-trace.h qapi/qapi-types-trace.h-timestamp qapi/qapi-types-trace.c qapi/qapi-types-trace.c-timestamp qapi/qapi-types-transaction.h qapi/qapi-types-transaction.h-timestamp qapi/qapi-types-transaction.c qapi/qapi-types-transaction.c-timestamp qapi/qapi-types-ui.h qapi/qapi-types-ui.h-timestamp qapi/qapi-types-ui.c qapi/qapi-types-ui.c-timestamp qapi/qapi-builtin-visit.h qapi/qapi-builtin-visit.h-timestamp qapi/qapi-builtin-visit.c qapi/qapi-builtin-visit.c-timestamp qapi/qapi-visit.h qapi/qapi-visit.h-timestamp qapi/qapi-visit.c qapi/qapi-visit.c-timestamp qapi/qapi-visit-block-core.h qapi/qapi-visit-block-core.h-timestamp qapi/qapi-visit-block-core.c qapi/qapi-visit-block-core.c-timestamp qapi/qapi-visit-block.h qapi/qapi-visit-block.h-timestamp qapi/qapi-visit-block.c qapi/qapi-visit-block.c-timestamp qapi/qapi-visit-char.h qapi/qapi-visit-char.h-timestamp qapi/qapi-visit-char.c qapi/qapi-visit-char.c-timestamp qapi/qapi-visit-common.h qapi/qapi-visit-common.h-timestamp qapi/qapi-visit-common.c qapi/qapi-visit-common.c-timestamp qapi/qapi-visit-crypto.h qapi/qapi-visit-crypto.h-timestamp qapi/qapi-visit-crypto.c qapi/qapi-visit-crypto.c-timestamp qapi/qapi-visit-introspect.h qapi/qapi-visit-introspect.h-timestamp qapi/qapi-visit-introspect.c qapi/qapi-visit-introspect.c-timestamp qapi/qapi-visit-migration.h qapi/qapi-visit-migration.h-timestamp qapi/qapi-visit-migration.c qapi/qapi-visit-migration.c-timestamp qapi/qapi-visit-misc.h qapi/qapi-visit-misc.h-timestamp qapi/qapi-visit-misc.c qapi/qapi-visit-misc.c-timestamp qapi/qapi-visit-net.h qapi/qapi-visit-net.h-timestamp qapi/qapi-visit-net.c qapi/qapi-visit-net.c-timestamp qapi/qapi-visit-rocker.h qapi/qapi-visit-rocker.h-timestamp qapi/qapi-visit-rocker.c qapi/qapi-visit-rocker.c-timestamp qapi/qapi-visit-run-state.h qapi/qapi-visit-run-state.h-timestamp qapi/qapi-visit-run-state.c qapi/qapi-visit-run-state.c-timestamp qapi/qapi-visit-sockets.h qapi/qapi-visit-sockets.h-timestamp qapi/qapi-visit-sockets.c qapi/qapi-visit-sockets.c-timestamp qapi/qapi-visit-tpm.h qapi/qapi-visit-tpm.h-timestamp qapi/qapi-visit-tpm.c qapi/qapi-visit-tpm.c-timestamp qapi/qapi-visit-trace.h qapi/qapi-visit-trace.h-timestamp qapi/qapi-visit-trace.c qapi/qapi-visit-trace.c-timestamp qapi/qapi-visit-transaction.h qapi/qapi-visit-transaction.h-timestamp qapi/qapi-visit-transaction.c qapi/qapi-visit-transaction.c-timestamp qapi/qapi-visit-ui.h qapi/qapi-visit-ui.h-timestamp qapi/qapi-visit-ui.c qapi/qapi-visit-ui.c-timestamp qapi/qapi-commands.h qapi/qapi-commands.h-timestamp qapi/qapi-commands.c qapi/qapi-commands.c-timestamp qapi/qapi-commands-block-core.h qapi/qapi-commands-block-core.h-timestamp qapi/qapi-commands-block-core.c qapi/qapi-commands-block-core.c-timestamp qapi/qapi-commands-block.h qapi/qapi-commands-block.h-timestamp qapi/qapi-commands-block.c qapi/qapi-commands-block.c-timestamp qapi/qapi-commands-char.h qapi/qapi-commands-char.h-timestamp qapi/qapi-commands-char.c qapi/qapi-commands-char.c-timestamp qapi/qapi-commands-common.h qapi/qapi-commands-common.h-timestamp qapi/qapi-commands-common.c qapi/qapi-commands-common.c-timestamp qapi/qapi-commands-crypto.h qapi/qapi-commands-crypto.h-timestamp qapi/qapi-commands-crypto.c qapi/qapi-commands-crypto.c-timestamp qapi/qapi-commands-introspect.h qapi/qapi-commands-introspect.h-timestamp qapi/qapi-commands-introspect.c qapi/qapi-commands-introspect.c-timestamp qapi/qapi-commands-migration.h qapi/qapi-commands-migration.h-timestamp qapi/qapi-commands-migration.c qapi/qapi-commands-migration.c-timestamp qapi/qapi-commands-misc.h qapi/qapi-commands-misc.h-timestamp qapi/qapi-commands-misc.c qapi/qapi-commands-misc.c-timestamp qapi/qapi-commands-net.h qapi/qapi-commands-net.h-timestamp qapi/qapi-commands-net.c qapi/qapi-commands-net.c-timestamp qapi/qapi-commands-rocker.h qapi/qapi-commands-rocker.h-timestamp qapi/qapi-commands-rocker.c qapi/qapi-commands-rocker.c-timestamp qapi/qapi-commands-run-state.h qapi/qapi-commands-run-state.h-timestamp qapi/qapi-commands-run-state.c qapi/qapi-commands-run-state.c-timestamp qapi/qapi-commands-sockets.h qapi/qapi-commands-sockets.h-timestamp qapi/qapi-commands-sockets.c qapi/qapi-commands-sockets.c-timestamp qapi/qapi-commands-tpm.h qapi/qapi-commands-tpm.h-timestamp qapi/qapi-commands-tpm.c qapi/qapi-commands-tpm.c-timestamp qapi/qapi-commands-trace.h qapi/qapi-commands-trace.h-timestamp qapi/qapi-commands-trace.c qapi/qapi-commands-trace.c-timestamp qapi/qapi-commands-transaction.h qapi/qapi-commands-transaction.h-timestamp qapi/qapi-commands-transaction.c qapi/qapi-commands-transaction.c-timestamp qapi/qapi-commands-ui.h qapi/qapi-commands-ui.h-timestamp qapi/qapi-commands-ui.c qapi/qapi-commands-ui.c-timestamp qapi/qapi-events.h qapi/qapi-events.h-timestamp qapi/qapi-events.c qapi/qapi-events.c-timestamp qapi/qapi-events-block-core.h qapi/qapi-events-block-core.h-timestamp qapi/qapi-events-block-core.c qapi/qapi-events-block-core.c-timestamp qapi/qapi-events-block.h qapi/qapi-events-block.h-timestamp qapi/qapi-events-block.c qapi/qapi-events-block.c-timestamp qapi/qapi-events-char.h qapi/qapi-events-char.h-timestamp qapi/qapi-events-char.c qapi/qapi-events-char.c-timestamp qapi/qapi-events-common.h qapi/qapi-events-common.h-timestamp qapi/qapi-events-common.c qapi/qapi-events-common.c-timestamp qapi/qapi-events-crypto.h qapi/qapi-events-crypto.h-timestamp qapi/qapi-events-crypto.c qapi/qapi-events-crypto.c-timestamp qapi/qapi-events-introspect.h qapi/qapi-events-introspect.h-timestamp qapi/qapi-events-introspect.c qapi/qapi-events-introspect.c-timestamp qapi/qapi-events-migration.h qapi/qapi-events-migration.h-timestamp qapi/qapi-events-migration.c qapi/qapi-events-migration.c-timestamp qapi/qapi-events-misc.h qapi/qapi-events-misc.h-timestamp qapi/qapi-events-misc.c qapi/qapi-events-misc.c-timestamp qapi/qapi-events-net.h qapi/qapi-events-net.h-timestamp qapi/qapi-events-net.c qapi/qapi-events-net.c-timestamp qapi/qapi-events-rocker.h qapi/qapi-events-rocker.h-timestamp qapi/qapi-events-rocker.c qapi/qapi-events-rocker.c-timestamp qapi/qapi-events-run-state.h qapi/qapi-events-run-state.h-timestamp qapi/qapi-events-run-state.c qapi/qapi-events-run-state.c-timestamp qapi/qapi-events-sockets.h qapi/qapi-events-sockets.h-timestamp qapi/qapi-events-sockets.c qapi/qapi-events-sockets.c-timestamp qapi/qapi-events-tpm.h qapi/qapi-events-tpm.h-timestamp qapi/qapi-events-tpm.c qapi/qapi-events-tpm.c-timestamp qapi/qapi-events-trace.h qapi/qapi-events-trace.h-timestamp qapi/qapi-events-trace.c qapi/qapi-events-trace.c-timestamp qapi/qapi-events-transaction.h qapi/qapi-events-transaction.h-timestamp qapi/qapi-events-transaction.c qapi/qapi-events-transaction.c-timestamp qapi/qapi-events-ui.h qapi/qapi-events-ui.h-timestamp qapi/qapi-events-ui.c qapi/qapi-events-ui.c-timestamp qapi/qapi-introspect.c qapi/qapi-introspect.c-timestamp qapi/qapi-introspect.h qapi/qapi-introspect.h-timestamp qapi/qapi-doc.texi qapi/qapi-doc.texi-timestamp trace/generated-tcg-tracers.h trace/generated-tcg-tracers.h-timestamp trace/generated-helpers-wrappers.h trace/generated-helpers-wrappers.h-timestamp trace/generated-helpers.h trace/generated-helpers.h-timestamp trace/generated-helpers.c trace/generated-helpers.c-timestamp module_block.h module_block.h-timestamp trace-root.h trace-root.h-timestamp util/trace.h util/trace.h-timestamp crypto/trace.h crypto/trace.h-timestamp io/trace.h io/trace.h-timestamp migration/trace.h migration/trace.h-timestamp block/trace.h block/trace.h-timestamp chardev/trace.h chardev/trace.h-timestamp hw/block/trace.h hw/block/trace.h-timestamp hw/block/dataplane/trace.h hw/block/dataplane/trace.h-timestamp hw/char/trace.h hw/char/trace.h-timestamp hw/intc/trace.h hw/intc/trace.h-timestamp hw/net/trace.h hw/net/trace.h-timestamp hw/rdma/trace.h hw/rdma/trace.h-timestamp hw/rdma/vmw/trace.h hw/rdma/vmw/trace.h-timestamp hw/virtio/trace.h hw/virtio/trace.h-timestamp hw/audio/trace.h hw/audio/trace.h-timestamp hw/misc/trace.h hw/misc/trace.h-timestamp hw/misc/macio/trace.h hw/misc/macio/trace.h-timestamp hw/usb/trace.h hw/usb/trace.h-timestamp hw/scsi/trace.h hw/scsi/trace.h-timestamp hw/nvram/trace.h hw/nvram/trace.h-timestamp hw/display/trace.h hw/display/trace.h-timestamp hw/input/trace.h hw/input/trace.h-timestamp hw/timer/trace.h hw/timer/trace.h-timestamp hw/dma/trace.h hw/dma/trace.h-timestamp hw/sparc/trace.h hw/sparc/trace.h-timestamp hw/sparc64/trace.h hw/sparc64/trace.h-timestamp hw/sd/trace.h hw/sd/trace.h-timestamp hw/isa/trace.h hw/isa/trace.h-timestamp hw/mem/trace.h hw/mem/trace.h-timestamp hw/i386/trace.h hw/i386/trace.h-timestamp hw/i386/xen/trace.h hw/i386/xen/trace.h-timestamp hw/9pfs/trace.h hw/9pfs/trace.h-timestamp hw/ppc/trace.h hw/ppc/trace.h-timestamp hw/pci/trace.h hw/pci/trace.h-timestamp hw/pci-host/trace.h hw/pci-host/trace.h-timestamp hw/s390x/trace.h hw/s390x/trace.h-timestamp hw/vfio/trace.h hw/vfio/trace.h-timestamp hw/acpi/trace.h hw/acpi/trace.h-timestamp hw/arm/trace.h hw/arm/trace.h-timestamp hw/alpha/trace.h hw/alpha/trace.h-timestamp hw/hppa/trace.h hw/hppa/trace.h-timestamp hw/xen/trace.h hw/xen/trace.h-timestamp hw/ide/trace.h hw/ide/trace.h-timestamp hw/tpm/trace.h hw/tpm/trace.h-timestamp ui/trace.h ui/trace.h-timestamp audio/trace.h audio/trace.h-timestamp net/trace.h net/trace.h-timestamp target/arm/trace.h target/arm/trace.h-timestamp target/i386/trace.h target/i386/trace.h-timestamp target/mips/trace.h target/mips/trace.h-timestamp target/sparc/trace.h target/sparc/trace.h-timestamp target/s390x/trace.h target/s390x/trace.h-timestamp target/ppc/trace.h target/ppc/trace.h-timestamp qom/trace.h qom/trace.h-timestamp linux-user/trace.h linux-user/trace.h-timestamp qapi/trace.h qapi/trace.h-timestamp accel/tcg/trace.h accel/tcg/trace.h-timestamp accel/kvm/trace.h accel/kvm/trace.h-timestamp nbd/trace.h nbd/trace.h-timestamp scsi/trace.h scsi/trace.h-timestamp trace-root.c trace-root.c-timestamp util/trace.c util/trace.c-timestamp crypto/trace.c crypto/trace.c-timestamp io/trace.c io/trace.c-timestamp migration/trace.c migration/trace.c-timestamp block/trace.c block/trace.c-timestamp chardev/trace.c chardev/trace.c-timestamp hw/block/trace.c hw/block/trace.c-timestamp hw/block/dataplane/trace.c hw/block/dataplane/trace.c-timestamp hw/char/trace.c hw/char/trace.c-timestamp hw/intc/trace.c hw/intc/trace.c-timestamp hw/net/trace.c hw/net/trace.c-timestamp hw/rdma/trace.c hw/rdma/trace.c-timestamp hw/rdma/vmw/trace.c hw/rdma/vmw/trace.c-timestamp hw/virtio/trace.c hw/virtio/trace.c-timestamp hw/audio/trace.c hw/audio/trace.c-timestamp hw/misc/trace.c hw/misc/trace.c-timestamp hw/misc/macio/trace.c hw/misc/macio/trace.c-timestamp hw/usb/trace.c hw/usb/trace.c-timestamp hw/scsi/trace.c hw/scsi/trace.c-timestamp hw/nvram/trace.c hw/nvram/trace.c-timestamp hw/display/trace.c hw/display/trace.c-timestamp hw/input/trace.c hw/input/trace.c-timestamp hw/timer/trace.c hw/timer/trace.c-timestamp hw/dma/trace.c hw/dma/trace.c-timestamp hw/sparc/trace.c hw/sparc/trace.c-timestamp hw/sparc64/trace.c hw/sparc64/trace.c-timestamp hw/sd/trace.c hw/sd/trace.c-timestamp hw/isa/trace.c hw/isa/trace.c-timestamp hw/mem/trace.c hw/mem/trace.c-timestamp hw/i386/trace.c hw/i386/trace.c-timestamp hw/i386/xen/trace.c hw/i386/xen/trace.c-timestamp hw/9pfs/trace.c hw/9pfs/trace.c-timestamp hw/ppc/trace.c hw/ppc/trace.c-timestamp hw/pci/trace.c hw/pci/trace.c-timestamp hw/pci-host/trace.c hw/pci-host/trace.c-timestamp hw/s390x/trace.c hw/s390x/trace.c-timestamp hw/vfio/trace.c hw/vfio/trace.c-timestamp hw/acpi/trace.c hw/acpi/trace.c-timestamp hw/arm/trace.c hw/arm/trace.c-timestamp hw/alpha/trace.c hw/alpha/trace.c-timestamp hw/hppa/trace.c hw/hppa/trace.c-timestamp hw/xen/trace.c hw/xen/trace.c-timestamp hw/ide/trace.c hw/ide/trace.c-timestamp hw/tpm/trace.c hw/tpm/trace.c-timestamp ui/trace.c ui/trace.c-timestamp audio/trace.c audio/trace.c-timestamp net/trace.c net/trace.c-timestamp target/arm/trace.c target/arm/trace.c-timestamp target/i386/trace.c target/i386/trace.c-timestamp target/mips/trace.c target/mips/trace.c-timestamp target/sparc/trace.c target/sparc/trace.c-timestamp target/s390x/trace.c target/s390x/trace.c-timestamp target/ppc/trace.c target/ppc/trace.c-timestamp qom/trace.c qom/trace.c-timestamp linux-user/trace.c linux-user/trace.c-timestamp qapi/trace.c qapi/trace.c-timestamp accel/tcg/trace.c accel/tcg/trace.c-timestamp accel/kvm/trace.c accel/kvm/trace.c-timestamp nbd/trace.c nbd/trace.c-timestamp scsi/trace.c scsi/trace.c-timestamp /tmp/qemu-test/build/trace-events-all /tmp/qemu-test/build/trace-events-all-timestamp .git-submodule-status .git-submodule-status-timestamp ui/input-keymap-atset1-to-qcode.c ui/input-keymap-atset1-to-qcode.c-timestamp ui/input-keymap-linux-to-qcode.c ui/input-keymap-linux-to-qcode.c-timestamp ui/input-keymap-qcode-to-atset1.c ui/input-keymap-qcode-to-atset1.c-timestamp ui/input-keymap-qcode-to-atset2.c ui/input-keymap-qcode-to-atset2.c-timestamp ui/input-keymap-qcode-to-atset3.c ui/input-keymap-qcode-to-atset3.c-timestamp ui/input-keymap-qcode-to-linux.c ui/input-keymap-qcode-to-linux.c-timestamp ui/input-keymap-qcode-to-qnum.c ui/input-keymap-qcode-to-qnum.c-timestamp ui/input-keymap-qcode-to-sun.c ui/input-keymap-qcode-to-sun.c-timestamp ui/input-keymap-qnum-to-qcode.c ui/input-keymap-qnum-to-qcode.c-timestamp ui/input-keymap-usb-to-qcode.c ui/input-keymap-usb-to-qcode.c-timestamp ui/input-keymap-win32-to-qcode.c ui/input-keymap-win32-to-qcode.c-timestamp ui/input-keymap-x11-to-qcode.c ui/input-keymap-x11-to-qcode.c-timestamp ui/input-keymap-xorgevdev-to-qcode.c ui/input-keymap-xorgevdev-to-qcode.c-timestamp ui/input-keymap-xorgkbd-to-qcode.c ui/input-keymap-xorgkbd-to-qcode.c-timestamp ui/input-keymap-xorgxquartz-to-qcode.c ui/input-keymap-xorgxquartz-to-qcode.c-timestamp ui/input-keymap-xorgxwin-to-qcode.c ui/input-keymap-xorgxwin-to-qcode.c-timestamp tests/test-qapi-types.h tests/test-qapi-types.h-timestamp tests/test-qapi-visit.h tests/test-qapi-visit.h-timestamp tests/test-qapi-commands.h tests/test-qapi-commands.h-timestamp tests/test-qapi-events.h tests/test-qapi-events.h-timestamp tests/test-qapi-introspect.h tests/test-qapi-introspect.h-timestamp
rm -f qapi-gen-timestamp
rm -rf qga/qapi-generated
for d in x86_64-softmmu aarch64-softmmu pc-bios/optionrom; do \
if test -d $d; then make -C $d clean || exit 1; fi; \
rm -f $d/qemu-options.def; \
        done
make[1]: Entering directory '/tmp/qemu-test/build/x86_64-softmmu'
rm -f *.timestamp
rm -f *.a *~ qemu-system-x86_64.exe qemu-system-x86_64w.exe
rm -f 
rm -f hmp-commands.h gdbstub-xml.c
make[1]: Leaving directory '/tmp/qemu-test/build/x86_64-softmmu'
make[1]: Entering directory '/tmp/qemu-test/build/aarch64-softmmu'
rm -f *.timestamp
rm -f *.a *~ qemu-system-aarch64.exe qemu-system-aarch64w.exe
rm -f 
rm -f hmp-commands.h gdbstub-xml.c
make[1]: Leaving directory '/tmp/qemu-test/build/aarch64-softmmu'
make[1]: Entering directory '/tmp/qemu-test/build/pc-bios/optionrom'
rm -f *.timestamp
rm -f *.o *.d *.raw *.img *.bin *~
make[1]: Leaving directory '/tmp/qemu-test/build/pc-bios/optionrom'
rm -f  x86_64-softmmu/config-devices.mak  aarch64-softmmu/config-devices.mak config-all-devices.mak
Configure options:
--enable-werror --target-list=x86_64-softmmu,aarch64-softmmu --prefix=/tmp/qemu-test/install --python=/usr/bin/python3 --cross-prefix=i686-w64-mingw32- --enable-trace-backends=simple --enable-gnutls --enable-nettle --enable-curl --enable-vnc --enable-bzip2 --enable-guest-agent --with-sdlabi=1.2 --with-gtkabi=2.0
Install prefix    /tmp/qemu-test/install
BIOS directory    /tmp/qemu-test/install
firmware path     /tmp/qemu-test/install/share/qemu-firmware
binary directory  /tmp/qemu-test/install
library directory /tmp/qemu-test/install/lib
module directory  /tmp/qemu-test/install/lib
libexec directory /tmp/qemu-test/install/libexec
include directory /tmp/qemu-test/install/include
config directory  /tmp/qemu-test/install
local state directory   queried at runtime
Windows SDK       no
Source path       /tmp/qemu-test/src
GIT binary        git
GIT submodules    
C compiler        i686-w64-mingw32-gcc
Host C compiler   cc
C++ compiler      i686-w64-mingw32-g++
Objective-C compiler clang
ARFLAGS           rv
CFLAGS            -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -g 
QEMU_CFLAGS       -I/usr/i686-w64-mingw32/sys-root/mingw/include/pixman-1  -I$(SRC_PATH)/dtc/libfdt -Werror -DHAS_LIBSSH2_SFTP_FSYNC -mms-bitfields -I/usr/i686-w64-mingw32/sys-root/mingw/include/glib-2.0 -I/usr/i686-w64-mingw32/sys-root/mingw/lib/glib-2.0/include -I/usr/i686-w64-mingw32/sys-root/mingw/include  -m32 -mthreads -D__USE_MINGW_ANSI_STDIO=1 -DWIN32_LEAN_AND_MEAN -DWINVER=0x501 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wall -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -fwrapv  -Wexpansion-to-defined -Wendif-labels -Wno-shift-negative-value -Wno-missing-include-dirs -Wempty-body -Wnested-externs -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wold-style-declaration -Wold-style-definition -Wtype-limits -fstack-protector-strong -I/usr/i686-w64-mingw32/sys-root/mingw/include -I/usr/i686-w64-mingw32/sys-root/mingw/include/p11-kit-1 -I/usr/i686-w64-mingw32/sys-root/mingw/include  -I/usr/i686-w64-mingw32/sys-root/mingw/include   -I/usr/i686-w64-mingw32/sys-root/mingw/include/libpng16 
LDFLAGS           -Wl,--nxcompat -Wl,--no-seh -Wl,--dynamicbase -Wl,--warn-common -m32 -g 
make              make
install           install
python            /usr/bin/python3 -B
smbd              /usr/sbin/smbd
module support    no
host CPU          i386
host big endian   no
target list       x86_64-softmmu aarch64-softmmu
gprof enabled     no
sparse enabled    no
strip binaries    yes
profiler          no
static build      no
SDL support       yes (1.2.15)
GTK support       yes (2.24.31)
GTK GL support    no
VTE support       no 
TLS priority      NORMAL
GNUTLS support    yes
GNUTLS rnd        yes
libgcrypt         no
libgcrypt kdf     no
nettle            yes (3.3)
nettle kdf        yes
libtasn1          yes
curses support    no
virgl support     no
curl support      yes
mingw32 support   yes
Audio drivers     dsound
Block whitelist (rw) 
Block whitelist (ro) 
VirtFS support    no
Multipath support no
VNC support       yes
VNC SASL support  no
VNC JPEG support  yes
VNC PNG support   yes
xen support       no
brlapi support    no
bluez  support    no
Documentation     no
PIE               no
vde support       no
netmap support    no
Linux AIO support no
ATTR/XATTR support no
Install blobs     yes
KVM support       no
HAX support       yes
HVF support       no
WHPX support      no
TCG support       yes
TCG debug enabled no
TCG interpreter   no
malloc trim support no
RDMA support      no
fdt support       yes
membarrier        no
preadv support    no
fdatasync         no
madvise           no
posix_madvise     no
posix_memalign    no
libcap-ng support no
vhost-net support no
vhost-crypto support no
vhost-scsi support no
vhost-vsock support no
vhost-user support no
Trace backends    simple
Trace output file trace-<pid>
spice support     no 
rbd support       no
xfsctl support    no
smartcard support no
libusb            no
usb net redir     no
OpenGL support    no
OpenGL dmabufs    no
libiscsi support  no
libnfs support    no
build guest agent yes
QGA VSS support   no
QGA w32 disk info yes
QGA MSI support   no
seccomp support   no
coroutine backend win32
coroutine pool    yes
debug stack usage no
crypto afalg      no
GlusterFS support no
gcov              gcov
gcov enabled      no
TPM support       yes
libssh2 support   yes
TPM passthrough   no
TPM emulator      no
QOM debugging     yes
Live block migration yes
lzo support       no
snappy support    no
bzip2 support     yes
NUMA host support no
libxml2           no
tcmalloc support  no
jemalloc support  no
avx2 optimization yes
replication support yes
VxHS block device no
capstone          no

WARNING: Use of GTK 2.0 is deprecated and will be removed in
WARNING: future releases. Please switch to using GTK 3.0

WARNING: Use of SDL 1.2 is deprecated and will be removed in
WARNING: future releases. Please switch to using SDL 2.0
  GEN     x86_64-softmmu/config-devices.mak.tmp
mkdir -p dtc/libfdt
mkdir -p dtc/tests
  GEN     aarch64-softmmu/config-devices.mak.tmp
  GEN     config-host.h
  GEN     qemu-options.def
  GEN     qapi-gen
  GEN     trace/generated-tcg-tracers.h
  GEN     trace/generated-helpers-wrappers.h
  GEN     trace/generated-helpers.h
  GEN     x86_64-softmmu/config-devices.mak
  GEN     aarch64-softmmu/config-devices.mak
  GEN     trace/generated-helpers.c
  GEN     module_block.h
  GEN     ui/input-keymap-atset1-to-qcode.c
  GEN     ui/input-keymap-linux-to-qcode.c
  GEN     ui/input-keymap-qcode-to-atset1.c
  GEN     ui/input-keymap-qcode-to-atset2.c
  GEN     ui/input-keymap-qcode-to-atset3.c
  GEN     ui/input-keymap-qcode-to-linux.c
  GEN     ui/input-keymap-qcode-to-qnum.c
  GEN     ui/input-keymap-qcode-to-sun.c
  GEN     ui/input-keymap-qnum-to-qcode.c
  GEN     ui/input-keymap-usb-to-qcode.c
  GEN     ui/input-keymap-win32-to-qcode.c
  GEN     ui/input-keymap-x11-to-qcode.c
  GEN     ui/input-keymap-xorgevdev-to-qcode.c
  GEN     ui/input-keymap-xorgkbd-to-qcode.c
  GEN     ui/input-keymap-xorgxquartz-to-qcode.c
  GEN     ui/input-keymap-xorgxwin-to-qcode.c
  GEN     tests/test-qapi-gen
  GEN     trace-root.h
  GEN     util/trace.h
  GEN     crypto/trace.h
  GEN     io/trace.h
  GEN     migration/trace.h
  GEN     block/trace.h
  GEN     chardev/trace.h
  GEN     hw/block/trace.h
  GEN     hw/block/dataplane/trace.h
  GEN     hw/char/trace.h
  GEN     hw/intc/trace.h
  GEN     hw/net/trace.h
  GEN     hw/rdma/trace.h
  GEN     hw/rdma/vmw/trace.h
  GEN     hw/virtio/trace.h
  GEN     hw/audio/trace.h
  GEN     hw/misc/trace.h
  GEN     hw/misc/macio/trace.h
  GEN     hw/usb/trace.h
  GEN     hw/scsi/trace.h
  GEN     hw/nvram/trace.h
  GEN     hw/display/trace.h
  GEN     hw/input/trace.h
  GEN     hw/timer/trace.h
  GEN     hw/dma/trace.h
  GEN     hw/sparc/trace.h
  GEN     hw/sparc64/trace.h
  GEN     hw/sd/trace.h
  GEN     hw/isa/trace.h
  GEN     hw/mem/trace.h
  GEN     hw/i386/trace.h
  GEN     hw/i386/xen/trace.h
  GEN     hw/9pfs/trace.h
  GEN     hw/ppc/trace.h
  GEN     hw/pci/trace.h
  GEN     hw/pci-host/trace.h
  GEN     hw/s390x/trace.h
  GEN     hw/vfio/trace.h
  GEN     hw/acpi/trace.h
  GEN     hw/arm/trace.h
  GEN     hw/alpha/trace.h
  GEN     hw/hppa/trace.h
  GEN     hw/xen/trace.h
  GEN     hw/ide/trace.h
  GEN     hw/tpm/trace.h
  GEN     ui/trace.h
  GEN     audio/trace.h
  GEN     net/trace.h
  GEN     target/arm/trace.h
  GEN     target/i386/trace.h
  GEN     target/mips/trace.h
  GEN     target/sparc/trace.h
  GEN     target/s390x/trace.h
  GEN     target/ppc/trace.h
  GEN     qom/trace.h
  GEN     linux-user/trace.h
  GEN     qapi/trace.h
  GEN     accel/tcg/trace.h
  GEN     accel/kvm/trace.h
  GEN     nbd/trace.h
  GEN     scsi/trace.h
  GEN     trace-root.c
  GEN     util/trace.c
  GEN     crypto/trace.c
  GEN     io/trace.c
  GEN     migration/trace.c
  GEN     block/trace.c
  GEN     chardev/trace.c
  GEN     hw/block/trace.c
  GEN     hw/block/dataplane/trace.c
  GEN     hw/char/trace.c
  GEN     hw/intc/trace.c
  GEN     hw/net/trace.c
  GEN     hw/rdma/trace.c
  GEN     hw/rdma/vmw/trace.c
  GEN     hw/virtio/trace.c
  GEN     hw/audio/trace.c
  GEN     hw/misc/trace.c
  GEN     hw/misc/macio/trace.c
  GEN     hw/usb/trace.c
  GEN     hw/scsi/trace.c
  GEN     hw/nvram/trace.c
  GEN     hw/display/trace.c
  GEN     hw/input/trace.c
  GEN     hw/timer/trace.c
  GEN     hw/dma/trace.c
  GEN     hw/sparc/trace.c
  GEN     hw/sparc64/trace.c
  GEN     hw/sd/trace.c
  GEN     hw/isa/trace.c
  GEN     hw/mem/trace.c
  GEN     hw/i386/trace.c
  GEN     hw/i386/xen/trace.c
  GEN     hw/9pfs/trace.c
  GEN     hw/ppc/trace.c
  GEN     hw/pci/trace.c
  GEN     hw/pci-host/trace.c
  GEN     hw/s390x/trace.c
  GEN     hw/vfio/trace.c
  GEN     hw/acpi/trace.c
  GEN     hw/arm/trace.c
  GEN     hw/alpha/trace.c
  GEN     hw/hppa/trace.c
  GEN     hw/xen/trace.c
  GEN     hw/ide/trace.c
  GEN     hw/tpm/trace.c
  GEN     ui/trace.c
  GEN     audio/trace.c
  GEN     net/trace.c
  GEN     target/arm/trace.c
  GEN     target/i386/trace.c
  GEN     target/mips/trace.c
  GEN     target/sparc/trace.c
  GEN     target/s390x/trace.c
  GEN     target/ppc/trace.c
  GEN     qom/trace.c
  GEN     linux-user/trace.c
  GEN     qapi/trace.c
  GEN     accel/tcg/trace.c
  GEN     accel/kvm/trace.c
  GEN     nbd/trace.c
  GEN     scsi/trace.c
  GEN     config-all-devices.mak
	 DEP /tmp/qemu-test/src/dtc/tests/dumptrees.c
	 DEP /tmp/qemu-test/src/dtc/tests/trees.S
	 DEP /tmp/qemu-test/src/dtc/tests/testutils.c
	 DEP /tmp/qemu-test/src/dtc/tests/value-labels.c
	 DEP /tmp/qemu-test/src/dtc/tests/asm_tree_dump.c
	 DEP /tmp/qemu-test/src/dtc/tests/truncated_property.c
	 DEP /tmp/qemu-test/src/dtc/tests/check_path.c
	 DEP /tmp/qemu-test/src/dtc/tests/overlay_bad_fixup.c
	 DEP /tmp/qemu-test/src/dtc/tests/overlay.c
	 DEP /tmp/qemu-test/src/dtc/tests/subnode_iterate.c
	 DEP /tmp/qemu-test/src/dtc/tests/property_iterate.c
	 DEP /tmp/qemu-test/src/dtc/tests/integer-expressions.c
	 DEP /tmp/qemu-test/src/dtc/tests/utilfdt_test.c
	 DEP /tmp/qemu-test/src/dtc/tests/path_offset_aliases.c
	 DEP /tmp/qemu-test/src/dtc/tests/add_subnode_with_nops.c
	 DEP /tmp/qemu-test/src/dtc/tests/dtbs_equal_unordered.c
	 DEP /tmp/qemu-test/src/dtc/tests/dtb_reverse.c
	 DEP /tmp/qemu-test/src/dtc/tests/dtbs_equal_ordered.c
	 DEP /tmp/qemu-test/src/dtc/tests/extra-terminating-null.c
	 DEP /tmp/qemu-test/src/dtc/tests/incbin.c
	 DEP /tmp/qemu-test/src/dtc/tests/boot-cpuid.c
	 DEP /tmp/qemu-test/src/dtc/tests/phandle_format.c
	 DEP /tmp/qemu-test/src/dtc/tests/path-references.c
	 DEP /tmp/qemu-test/src/dtc/tests/references.c
	 DEP /tmp/qemu-test/src/dtc/tests/string_escapes.c
	 DEP /tmp/qemu-test/src/dtc/tests/propname_escapes.c
	 DEP /tmp/qemu-test/src/dtc/tests/appendprop2.c
	 DEP /tmp/qemu-test/src/dtc/tests/appendprop1.c
	 DEP /tmp/qemu-test/src/dtc/tests/del_node.c
	 DEP /tmp/qemu-test/src/dtc/tests/del_property.c
	 DEP /tmp/qemu-test/src/dtc/tests/setprop.c
	 DEP /tmp/qemu-test/src/dtc/tests/set_name.c
	 DEP /tmp/qemu-test/src/dtc/tests/rw_tree1.c
	 DEP /tmp/qemu-test/src/dtc/tests/open_pack.c
	 DEP /tmp/qemu-test/src/dtc/tests/nopulate.c
	 DEP /tmp/qemu-test/src/dtc/tests/mangle-layout.c
	 DEP /tmp/qemu-test/src/dtc/tests/move_and_save.c
	 DEP /tmp/qemu-test/src/dtc/tests/sw_tree1.c
	 DEP /tmp/qemu-test/src/dtc/tests/nop_node.c
	 DEP /tmp/qemu-test/src/dtc/tests/nop_property.c
	 DEP /tmp/qemu-test/src/dtc/tests/setprop_inplace.c
	 DEP /tmp/qemu-test/src/dtc/tests/stringlist.c
	 DEP /tmp/qemu-test/src/dtc/tests/addr_size_cells.c
	 DEP /tmp/qemu-test/src/dtc/tests/notfound.c
	 DEP /tmp/qemu-test/src/dtc/tests/sized_cells.c
	 DEP /tmp/qemu-test/src/dtc/tests/char_literal.c
	 DEP /tmp/qemu-test/src/dtc/tests/get_alias.c
	 DEP /tmp/qemu-test/src/dtc/tests/node_offset_by_compatible.c
	 DEP /tmp/qemu-test/src/dtc/tests/node_check_compatible.c
	 DEP /tmp/qemu-test/src/dtc/tests/node_offset_by_phandle.c
	 DEP /tmp/qemu-test/src/dtc/tests/node_offset_by_prop_value.c
	 DEP /tmp/qemu-test/src/dtc/tests/parent_offset.c
	 DEP /tmp/qemu-test/src/dtc/tests/supernode_atdepth_offset.c
	 DEP /tmp/qemu-test/src/dtc/tests/get_path.c
	 DEP /tmp/qemu-test/src/dtc/tests/get_phandle.c
	 DEP /tmp/qemu-test/src/dtc/tests/getprop.c
	 DEP /tmp/qemu-test/src/dtc/tests/get_name.c
	 DEP /tmp/qemu-test/src/dtc/tests/path_offset.c
	 DEP /tmp/qemu-test/src/dtc/tests/subnode_offset.c
	 DEP /tmp/qemu-test/src/dtc/tests/find_property.c
	 DEP /tmp/qemu-test/src/dtc/tests/root_node.c
	 DEP /tmp/qemu-test/src/dtc/tests/get_mem_rsv.c
	 DEP /tmp/qemu-test/src/dtc/libfdt/fdt_overlay.c
	 DEP /tmp/qemu-test/src/dtc/libfdt/fdt_addresses.c
	 DEP /tmp/qemu-test/src/dtc/libfdt/fdt_empty_tree.c
	 DEP /tmp/qemu-test/src/dtc/libfdt/fdt_strerror.c
	 DEP /tmp/qemu-test/src/dtc/libfdt/fdt_rw.c
	 DEP /tmp/qemu-test/src/dtc/libfdt/fdt_sw.c
	 DEP /tmp/qemu-test/src/dtc/libfdt/fdt_wip.c
	 DEP /tmp/qemu-test/src/dtc/libfdt/fdt_ro.c
	 DEP /tmp/qemu-test/src/dtc/libfdt/fdt.c
	 DEP /tmp/qemu-test/src/dtc/util.c
	 DEP /tmp/qemu-test/src/dtc/fdtoverlay.c
	 DEP /tmp/qemu-test/src/dtc/fdtput.c
	 DEP /tmp/qemu-test/src/dtc/fdtget.c
	 DEP /tmp/qemu-test/src/dtc/fdtdump.c
	 DEP convert-dtsv0-lexer.lex.c
	 DEP /tmp/qemu-test/src/dtc/srcpos.c
	 DEP dtc-parser.tab.c
	 DEP dtc-lexer.lex.c
	 DEP /tmp/qemu-test/src/dtc/treesource.c
	 DEP /tmp/qemu-test/src/dtc/fstree.c
	 DEP /tmp/qemu-test/src/dtc/livetree.c
	 DEP /tmp/qemu-test/src/dtc/dtc.c
	 DEP /tmp/qemu-test/src/dtc/flattree.c
	 DEP /tmp/qemu-test/src/dtc/data.c
	 DEP /tmp/qemu-test/src/dtc/checks.c
	 CC libfdt/fdt.o
	 CC libfdt/fdt_ro.o
	 CC libfdt/fdt_wip.o
	 CC libfdt/fdt_sw.o
	 CC libfdt/fdt_rw.o
	 CC libfdt/fdt_strerror.o
	 CC libfdt/fdt_addresses.o
	 CC libfdt/fdt_empty_tree.o
	 CC libfdt/fdt_overlay.o
	 AR libfdt/libfdt.a
i686-w64-mingw32-ar: creating libfdt/libfdt.a
a - libfdt/fdt.o
a - libfdt/fdt_ro.o
a - libfdt/fdt_wip.o
a - libfdt/fdt_sw.o
a - libfdt/fdt_rw.o
a - libfdt/fdt_strerror.o
a - libfdt/fdt_empty_tree.o
a - libfdt/fdt_addresses.o
a - libfdt/fdt_overlay.o
  RC      version.o
mkdir -p dtc/libfdt
mkdir -p dtc/tests
  GEN     qga/qapi-generated/qapi-gen
  CC      qapi/qapi-types.o
  CC      qapi/qapi-builtin-types.o
  CC      qapi/qapi-types-char.o
  CC      qapi/qapi-types-block-core.o
  CC      qapi/qapi-types-common.o
  CC      qapi/qapi-types-block.o
  CC      qapi/qapi-types-crypto.o
  CC      qapi/qapi-types-introspect.o
  CC      qapi/qapi-types-migration.o
  CC      qapi/qapi-types-misc.o
  CC      qapi/qapi-types-net.o
  CC      qapi/qapi-types-rocker.o
  CC      qapi/qapi-types-run-state.o
  CC      qapi/qapi-types-sockets.o
  CC      qapi/qapi-types-tpm.o
  CC      qapi/qapi-types-trace.o
  CC      qapi/qapi-types-transaction.o
  CC      qapi/qapi-types-ui.o
  CC      qapi/qapi-builtin-visit.o
  CC      qapi/qapi-visit.o
  CC      qapi/qapi-visit-block-core.o
qapi/qapi-types-misc.h:654:20: error: expected identifier or '(' before numeric constant
         CpuInfoX86 i386;
                    ^
qapi/qapi-types-misc.h:749:22: error: expected identifier or '(' before numeric constant
         CpuInfoOther i386;
                      ^
make: *** [/tmp/qemu-test/src/rules.mak:66: qapi/qapi-types-misc.o] Error 1
make: *** Waiting for unfinished jobs....
qapi/qapi-types-misc.h:654:20: error: expected identifier or '(' before numeric constant
         CpuInfoX86 i386;
                    ^
qapi/qapi-types-misc.h:749:22: error: expected identifier or '(' before numeric constant
         CpuInfoOther i386;
                      ^
make: *** [/tmp/qemu-test/src/rules.mak:66: qapi/qapi-types.o] Error 1
qapi/qapi-types-misc.h:654:20: error: expected identifier or '(' before numeric constant
         CpuInfoX86 i386;
                    ^
qapi/qapi-types-misc.h:749:22: error: expected identifier or '(' before numeric constant
         CpuInfoOther i386;
                      ^
make: *** [/tmp/qemu-test/src/rules.mak:66: qapi/qapi-visit.o] Error 1
Traceback (most recent call last):
  File "./tests/docker/docker.py", line 407, in <module>
    sys.exit(main())
  File "./tests/docker/docker.py", line 404, in main
    return args.cmdobj.run(args, argv)
  File "./tests/docker/docker.py", line 261, in run
    return Docker().run(argv, args.keep, quiet=args.quiet)
  File "./tests/docker/docker.py", line 229, in run
    quiet=quiet)
  File "./tests/docker/docker.py", line 147, in _do_check
    return subprocess.check_call(self._command + cmd, **kwargs)
  File "/usr/lib64/python2.7/subprocess.py", line 186, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['docker', 'run', '--label', 'com.qemu.instance.uuid=4ea15d94480a11e8a5a052540069c830', '-u', '0', '--security-opt', 'seccomp=unconfined', '--rm', '--net=none', '-e', 'TARGET_LIST=', '-e', 'EXTRA_CONFIGURE_OPTS=', '-e', 'V=', '-e', 'J=8', '-e', 'DEBUG=', '-e', 'SHOW_ENV=1', '-e', 'CCACHE_DIR=/var/tmp/ccache', '-v', '/root/.cache/qemu-docker-ccache:/var/tmp/ccache:z', '-v', '/var/tmp/patchew-tester-tmp-0rhlqvqc/src/docker-src.2018-04-24-17.55.55.22859:/var/tmp/qemu:z,ro', 'qemu:fedora', '/var/tmp/qemu/run', 'test-mingw']' returned non-zero exit status 2
make[1]: *** [tests/docker/Makefile.include:129: docker-run] Error 1
make[1]: Leaving directory '/var/tmp/patchew-tester-tmp-0rhlqvqc/src'
make: *** [tests/docker/Makefile.include:163: docker-run-test-mingw@fedora] Error 2

real	7m22.792s
user	0m4.682s
sys	0m3.913s
=== OUTPUT END ===

Test command exited with code: 2


---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to patchew-devel@redhat.com

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [Qemu-devel] [PATCH 1/6] qapi: fill in CpuInfoFast.arch in query-cpus-fast
  2018-04-24 21:45 ` [Qemu-devel] [PATCH 1/6] qapi: fill in CpuInfoFast.arch in query-cpus-fast Laszlo Ersek
@ 2018-04-24 22:30   ` Eric Blake
  2018-04-25 12:30     ` Laszlo Ersek
  2018-04-25  6:39   ` Markus Armbruster
  2018-04-25  7:28   ` Cornelia Huck
  2 siblings, 1 reply; 46+ messages in thread
From: Eric Blake @ 2018-04-24 22:30 UTC (permalink / raw)
  To: Laszlo Ersek, qemu-devel
  Cc: Markus Armbruster, Paolo Bonzini, Peter Crosthwaite,
	Richard Henderson, qemu-stable

[-- Attachment #1: Type: text/plain, Size: 1485 bytes --]

On 04/24/2018 04:45 PM, Laszlo Ersek wrote:
> Commit ca230ff33f89 added added the @arch field to @CpuInfoFast, but it

s/added added/added/

> failed to set the new field in qmp_query_cpus_fast(), when TARGET_S390X
> was not defined. The updated @query-cpus-fast example in
> "qapi-schema.json" showed "arch":"x86" only because qmp_query_cpus_fast()
> calls g_malloc0() to allocate CpuInfoFast, and the CPU_INFO_ARCH_X86 enum
> constant is generated with value 0.
> 
> All @arch values other than @s390 implied the @CpuInfoOther sub-struct for
> @CpuInfoFast -- at the time of writing the patch --, thus no fields other
> than @arch needed to be set when TARGET_S390X was not defined. Set @arch
> now, by copying the corresponding assignments from qmp_query_cpus().

Perhaps worth mentioning that the riscv architecture shows up as 'other'
in this patch?  (But that gets cleaned up in the next one, so no big deal)

> 
> Cc: Eric Blake <eblake@redhat.com>
> Cc: Markus Armbruster <armbru@redhat.com>
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Cc: Peter Crosthwaite <crosthwaite.peter@gmail.com>
> Cc: Richard Henderson <rth@twiddle.net>
> Cc: qemu-stable@nongnu.org
> Fixes: ca230ff33f89bf7102cbfbc2328716da6750aaed
> Signed-off-by: Laszlo Ersek <lersek@redhat.com>
> ---
> 

Reviewed-by: Eric Blake <eblake@redhat.com>

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 619 bytes --]

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [Qemu-devel] [PATCH 2/6] qapi: handle the riscv CpuInfoArch in query-cpus-fast
  2018-04-24 21:45 ` [Qemu-devel] [PATCH 2/6] qapi: handle the riscv CpuInfoArch " Laszlo Ersek
@ 2018-04-24 22:32   ` Eric Blake
  2018-04-25 12:32     ` Laszlo Ersek
  2018-04-25  6:44   ` Markus Armbruster
  1 sibling, 1 reply; 46+ messages in thread
From: Eric Blake @ 2018-04-24 22:32 UTC (permalink / raw)
  To: Laszlo Ersek, qemu-devel
  Cc: Bastian Koppelmann, Laurent Vivier, Markus Armbruster,
	Michael Clark, Palmer Dabbelt, Paolo Bonzini, Peter Crosthwaite,
	Richard Henderson, Riku Voipio, Sagar Karandikar, qemu-stable

[-- Attachment #1: Type: text/plain, Size: 1552 bytes --]

On 04/24/2018 04:45 PM, Laszlo Ersek wrote:
> Commit 25fa194b7b11 added the @riscv enum constant to @CpuInfoArch (used
> in both @CpuInfo and @CpuInfoFast -- the return types of the @query-cpus
> and @query-cpus-fast commands, respectively), and assigned, in both return
> structures, the @CpuInfoRISCV sub-structure to the new enum value.
> 
> However, qmp_query_cpus_fast() would not populate either the @arch field
> or the @CpuInfoRISCV sub-structure, when TARGET_RISCV was defined; only
> qmp_query_cpus() would.
> 
> In theory, there are two ways to fix this:
> 
> (a) Fill in both the @arch field and the @CpuInfoRISCV sub-structure in
>     qmp_query_cpus_fast(), by copying the logic from qmp_query_cpus().
> 
> (b) Assign @CpuInfoOther to the @riscv enum constant in @CpuInfoFast, and
>     populate only the @arch field in qmp_query_cpus_fast().
> 
> Approach (b) seems more robust, because:
> 
> - clearly there has never been an attempt to get actual RISV CPU state
>   from qmp_query_cpus_fast(), so its lack of RISCV support is not actually
>   a problem,
> 
> - getting CPU state without interrupting KVM looks like an exceptional
>   thing to do (only S390X does it currently).
> 
...
> Cc: qemu-stable@nongnu.org
> Fixes: 25fa194b7b11901561532e435beb83d046899f7a
> Signed-off-by: Laszlo Ersek <lersek@redhat.com>
> ---
> 

Reviewed-by: Eric Blake <eblake@redhat.com>

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 619 bytes --]

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [Qemu-devel] [PATCH 3/6] qapi: add SysEmuTarget to "common.json"
  2018-04-24 21:45 ` [Qemu-devel] [PATCH 3/6] qapi: add SysEmuTarget to "common.json" Laszlo Ersek
@ 2018-04-24 23:11   ` Eric Blake
  2018-04-25 12:54     ` Daniel P. Berrangé
  0 siblings, 1 reply; 46+ messages in thread
From: Eric Blake @ 2018-04-24 23:11 UTC (permalink / raw)
  To: Laszlo Ersek, qemu-devel
  Cc: Daniel P. Berrange, David Gibson, Gerd Hoffmann,
	Kashyap Chamarthy, Markus Armbruster, Paolo Bonzini, Thomas Huth

[-- Attachment #1: Type: text/plain, Size: 1544 bytes --]

On 04/24/2018 04:45 PM, Laszlo Ersek wrote:
> We'll soon need an enumeration type that lists all the softmmu targets
> that QEMU (the project) supports. Introduce @SysEmuTarget to
> "common.json".
> 
> Cc: "Daniel P. Berrange" <berrange@redhat.com>
> Cc: David Gibson <dgibson@redhat.com>
> Cc: Eric Blake <eblake@redhat.com>
> Cc: Gerd Hoffmann <kraxel@redhat.com>
> Cc: Kashyap Chamarthy <kchamart@redhat.com>
> Cc: Markus Armbruster <armbru@redhat.com>
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Cc: Thomas Huth <thuth@redhat.com>
> Signed-off-by: Laszlo Ersek <lersek@redhat.com>
> Reviewed-by: Markus Armbruster <armbru@redhat.com>
> Reviewed-by: Kashyap Chamarthy <kchamart@redhat.com>
> ---
> 

> +##
> +{ 'enum' : 'SysEmuTarget',
> +  'data' : [ 'aarch64', 'alpha', 'arm', 'cris', 'hppa', 'i386', 'lm32',
> +             'm68k', 'microblaze', 'microblazeel', 'mips', 'mips64',
> +             'mips64el', 'mipsel', 'moxie', 'nios2', 'or1k', 'ppc',
> +             'ppc64', 'ppcemb', 'riscv32', 'riscv64', 's390x', 'sh4',
> +             'sh4eb', 'sparc', 'sparc64', 'tricore', 'unicore32',
> +             'x86_64', 'xtensa', 'xtensaeb' ] }

x86_64 doesn't match our typical conventions of preferring '-' over '_';
also, wikipedia mentions both spellings but under the page name
'x86-64'.  Is it worth switching that enum constant?

https://en.wikipedia.org/wiki/X86-64

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 619 bytes --]

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [Qemu-devel] [PATCH 1/6] qapi: fill in CpuInfoFast.arch in query-cpus-fast
  2018-04-24 21:45 ` [Qemu-devel] [PATCH 1/6] qapi: fill in CpuInfoFast.arch in query-cpus-fast Laszlo Ersek
  2018-04-24 22:30   ` Eric Blake
@ 2018-04-25  6:39   ` Markus Armbruster
  2018-04-25 12:30     ` Laszlo Ersek
  2018-04-25  7:28   ` Cornelia Huck
  2 siblings, 1 reply; 46+ messages in thread
From: Markus Armbruster @ 2018-04-25  6:39 UTC (permalink / raw)
  To: Laszlo Ersek
  Cc: qemu-devel, Peter Crosthwaite, qemu-stable, Paolo Bonzini,
	Richard Henderson

Laszlo Ersek <lersek@redhat.com> writes:

> Commit ca230ff33f89 added added the @arch field to @CpuInfoFast, but it
> failed to set the new field in qmp_query_cpus_fast(), when TARGET_S390X
> was not defined. The updated @query-cpus-fast example in
> "qapi-schema.json" showed "arch":"x86" only because qmp_query_cpus_fast()
> calls g_malloc0() to allocate CpuInfoFast, and the CPU_INFO_ARCH_X86 enum
> constant is generated with value 0.
>
> All @arch values other than @s390 implied the @CpuInfoOther sub-struct for
> @CpuInfoFast -- at the time of writing the patch --, thus no fields other
> than @arch needed to be set when TARGET_S390X was not defined. Set @arch
> now, by copying the corresponding assignments from qmp_query_cpus().

Now I'm confused.

In the schema, @arch "riscv" implies CpuInfoRISCV:

    { 'union': 'CpuInfoFast',
      'base': {'cpu-index': 'int', 'qom-path': 'str',
               'thread-id': 'int', '*props': 'CpuInstanceProperties',
               'arch': 'CpuInfoArch' },
      'discriminator': 'arch',
      'data': { 'x86': 'CpuInfoOther',
                'sparc': 'CpuInfoOther',
                'ppc': 'CpuInfoOther',
                'mips': 'CpuInfoOther',
                'tricore': 'CpuInfoOther',
                's390': 'CpuInfoS390',
                'riscv': 'CpuInfoRISCV',
                'other': 'CpuInfoOther' } }

In qmp_query_cpus_fast(), it can't imply anything, because can't occur.
That's a bug, and this patch fixes it.  Except it sets @arch to "other"
instead of "riscv" when defined(TARGET_RISCV).  Why?  Oh, I see, that
gets fixed in the next patch.  Please explain that in your commit
message, or squash the two patches.  The latter feels simpler, so that's
what I'd do.

>
> Cc: Eric Blake <eblake@redhat.com>
> Cc: Markus Armbruster <armbru@redhat.com>
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Cc: Peter Crosthwaite <crosthwaite.peter@gmail.com>
> Cc: Richard Henderson <rth@twiddle.net>
> Cc: qemu-stable@nongnu.org
> Fixes: ca230ff33f89bf7102cbfbc2328716da6750aaed
> Signed-off-by: Laszlo Ersek <lersek@redhat.com>

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [Qemu-devel] [PATCH 2/6] qapi: handle the riscv CpuInfoArch in query-cpus-fast
  2018-04-24 21:45 ` [Qemu-devel] [PATCH 2/6] qapi: handle the riscv CpuInfoArch " Laszlo Ersek
  2018-04-24 22:32   ` Eric Blake
@ 2018-04-25  6:44   ` Markus Armbruster
  2018-04-25  7:48     ` Cornelia Huck
  1 sibling, 1 reply; 46+ messages in thread
From: Markus Armbruster @ 2018-04-25  6:44 UTC (permalink / raw)
  To: Laszlo Ersek
  Cc: qemu-devel, Riku Voipio, Sagar Karandikar, Peter Crosthwaite,
	Bastian Koppelmann, qemu-stable, Palmer Dabbelt, Laurent Vivier,
	Michael Clark, Paolo Bonzini, Richard Henderson, Luiz Capitulino,
	Viktor Mihajlovski

Laszlo Ersek <lersek@redhat.com> writes:

> Commit 25fa194b7b11 added the @riscv enum constant to @CpuInfoArch (used
> in both @CpuInfo and @CpuInfoFast -- the return types of the @query-cpus
> and @query-cpus-fast commands, respectively), and assigned, in both return
> structures, the @CpuInfoRISCV sub-structure to the new enum value.
>
> However, qmp_query_cpus_fast() would not populate either the @arch field
> or the @CpuInfoRISCV sub-structure, when TARGET_RISCV was defined; only
> qmp_query_cpus() would.
>
> In theory, there are two ways to fix this:
>
> (a) Fill in both the @arch field and the @CpuInfoRISCV sub-structure in
>     qmp_query_cpus_fast(), by copying the logic from qmp_query_cpus().
>
> (b) Assign @CpuInfoOther to the @riscv enum constant in @CpuInfoFast, and
>     populate only the @arch field in qmp_query_cpus_fast().
>
> Approach (b) seems more robust, because:
>
> - clearly there has never been an attempt to get actual RISV CPU state
>   from qmp_query_cpus_fast(), so its lack of RISCV support is not actually
>   a problem,
>
> - getting CPU state without interrupting KVM looks like an exceptional
>   thing to do (only S390X does it currently).
>
> Cc: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
> Cc: Eric Blake <eblake@redhat.com>
> Cc: Laurent Vivier <laurent@vivier.eu>
> Cc: Markus Armbruster <armbru@redhat.com>
> Cc: Michael Clark <mjc@sifive.com>
> Cc: Palmer Dabbelt <palmer@sifive.com>
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Cc: Peter Crosthwaite <crosthwaite.peter@gmail.com>
> Cc: Richard Henderson <rth@twiddle.net>
> Cc: Riku Voipio <riku.voipio@iki.fi>
> Cc: Sagar Karandikar <sagark@eecs.berkeley.edu>
> Cc: qemu-stable@nongnu.org
> Fixes: 25fa194b7b11901561532e435beb83d046899f7a
> Signed-off-by: Laszlo Ersek <lersek@redhat.com>
> ---
>
> Notes:
>     PATCHv1:
>     
>     - new patch
>
>  qapi/misc.json | 2 +-
>  cpus.c         | 2 ++
>  2 files changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/qapi/misc.json b/qapi/misc.json
> index 5636f4a14997..104d013adba6 100644
> --- a/qapi/misc.json
> +++ b/qapi/misc.json
> @@ -565,23 +565,23 @@
>  { 'union': 'CpuInfoFast',
>    'base': {'cpu-index': 'int', 'qom-path': 'str',
>             'thread-id': 'int', '*props': 'CpuInstanceProperties',
>             'arch': 'CpuInfoArch' },
>    'discriminator': 'arch',
>    'data': { 'x86': 'CpuInfoOther',
>              'sparc': 'CpuInfoOther',
>              'ppc': 'CpuInfoOther',
>              'mips': 'CpuInfoOther',
>              'tricore': 'CpuInfoOther',
>              's390': 'CpuInfoS390',
> -            'riscv': 'CpuInfoRISCV',
> +            'riscv': 'CpuInfoOther',
>              'other': 'CpuInfoOther' } }

Why do CpuInfoFast's variants match CpuInfo's for s390, but not the
others?  Your commit message has an educated guess: "looks like an
exceptional thing to do (only S390X does it currently)".  But why guess
when we can ask authors of commit ce74ee3dea6?  Luiz and Victor, please
advise.

>  ##
>  # @query-cpus-fast:
>  #
>  # Returns information about all virtual CPUs. This command does not
>  # incur a performance penalty and should be used in production
>  # instead of query-cpus.
>  #
>  # Returns: list of @CpuInfoFast
>  #
> diff --git a/cpus.c b/cpus.c
> index 1a9a2edee1f2..60563a6d54ec 100644
> --- a/cpus.c
> +++ b/cpus.c
> @@ -2225,22 +2225,24 @@ CpuInfoFastList *qmp_query_cpus_fast(Error **errp)
>  #elif defined(TARGET_SPARC)
>          info->value->arch = CPU_INFO_ARCH_SPARC;
>  #elif defined(TARGET_MIPS)
>          info->value->arch = CPU_INFO_ARCH_MIPS;
>  #elif defined(TARGET_TRICORE)
>          info->value->arch = CPU_INFO_ARCH_TRICORE;
>  #elif defined(TARGET_S390X)
>          s390_cpu = S390_CPU(cpu);
>          env = &s390_cpu->env;
>          info->value->arch = CPU_INFO_ARCH_S390;
>          info->value->u.s390.cpu_state = env->cpu_state;
> +#elif defined(TARGET_RISCV)
> +        info->value->arch = CPU_INFO_ARCH_RISCV;
>  #else
>          info->value->arch = CPU_INFO_ARCH_OTHER;
>  #endif
>          if (!cur_item) {
>              head = cur_item = info;
>          } else {
>              cur_item->next = info;
>              cur_item = info;
>          }
>      }

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [Qemu-devel] [PATCH 4/6] qapi: change the type of TargetInfo.arch from string to enum SysEmuTarget
  2018-04-24 21:45 ` [Qemu-devel] [PATCH 4/6] qapi: change the type of TargetInfo.arch from string to enum SysEmuTarget Laszlo Ersek
@ 2018-04-25  6:48   ` Markus Armbruster
  2018-04-25 12:58     ` Laszlo Ersek
  0 siblings, 1 reply; 46+ messages in thread
From: Markus Armbruster @ 2018-04-25  6:48 UTC (permalink / raw)
  To: Laszlo Ersek
  Cc: qemu-devel, Thomas Huth, Kashyap Chamarthy, Gerd Hoffmann,
	Paolo Bonzini, David Gibson

Laszlo Ersek <lersek@redhat.com> writes:

> Now that we have @SysEmuTarget, it makes sense to restict
> @TargetInfo.@arch to valid sysemu targets at the schema level.
>
> Cc: "Daniel P. Berrange" <berrange@redhat.com>
> Cc: David Gibson <dgibson@redhat.com>
> Cc: Eric Blake <eblake@redhat.com>
> Cc: Gerd Hoffmann <kraxel@redhat.com>
> Cc: Kashyap Chamarthy <kchamart@redhat.com>
> Cc: Markus Armbruster <armbru@redhat.com>
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Cc: Thomas Huth <thuth@redhat.com>
> Signed-off-by: Laszlo Ersek <lersek@redhat.com>
> ---
>
> Notes:
>     PATCHv1:
>     
>     - qmp_query_target(): pass (-1) as fallback value [Markus]
>     - qmp_query_target(): catch lookup error with error_abort [Markus]
>     
>     RFCv3:
>     
>     - The patch is new in this version. [Markus]
>
>  qapi/misc.json |  6 ++++--
>  arch_init.c    | 10 +++++++++-
>  2 files changed, 13 insertions(+), 3 deletions(-)
>
> diff --git a/qapi/misc.json b/qapi/misc.json
> index 104d013adba6..460866cf542f 100644
> --- a/qapi/misc.json
> +++ b/qapi/misc.json
> @@ -1,18 +1,20 @@
>  # -*- Mode: Python -*-
>  #
>  
>  ##
>  # = Miscellanea
>  ##
>  
> +{ 'include': 'common.json' }
> +
>  ##
>  # @qmp_capabilities:
>  #
>  # Enable QMP capabilities.
>  #
>  # Arguments:
>  #
>  # @enable:   An optional list of QMPCapability values to enable.  The
>  #            client must not enable any capability that is not
>  #            mentioned in the QMP greeting message.  If the field is not
>  #            provided, it means no QMP capabilities will be enabled.
> @@ -2441,28 +2443,28 @@
>  #      ]
>  #    }
>  #
>  ##
>  { 'command': 'query-fdsets', 'returns': ['FdsetInfo'] }
>  
>  ##
>  # @TargetInfo:
>  #
>  # Information describing the QEMU target.
>  #
> -# @arch: the target architecture (eg "x86_64", "i386", etc)
> +# @arch: the target architecture
>  #
>  # Since: 1.2.0
>  ##
>  { 'struct': 'TargetInfo',
> -  'data': { 'arch': 'str' } }
> +  'data': { 'arch': 'SysEmuTarget' } }
>  
>  ##
>  # @query-target:
>  #
>  # Return information about the target for this QEMU
>  #
>  # Returns: TargetInfo
>  #
>  # Since: 1.2.0
>  ##
>  { 'command': 'query-target', 'returns': 'TargetInfo' }
> diff --git a/arch_init.c b/arch_init.c
> index 6ee07478bd11..ee3a57019000 100644
> --- a/arch_init.c
> +++ b/arch_init.c
> @@ -21,22 +21,23 @@
>   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
>   * THE SOFTWARE.
>   */
>  #include "qemu/osdep.h"
>  #include "qemu-common.h"
>  #include "cpu.h"
>  #include "sysemu/sysemu.h"
>  #include "sysemu/arch_init.h"
>  #include "hw/pci/pci.h"
>  #include "hw/audio/soundhw.h"
>  #include "qapi/qapi-commands-misc.h"
> +#include "qapi/error.h"
>  #include "qemu/config-file.h"
>  #include "qemu/error-report.h"
>  #include "hw/acpi/acpi.h"
>  #include "qemu/help_option.h"
>  
>  #ifdef TARGET_SPARC
>  int graphic_width = 1024;
>  int graphic_height = 768;
>  int graphic_depth = 8;
>  #else
>  int graphic_width = 800;
> @@ -104,15 +105,22 @@ int xen_available(void)
>      return 1;
>  #else
>      return 0;
>  #endif
>  }
>  
>  
>  TargetInfo *qmp_query_target(Error **errp)
>  {
>      TargetInfo *info = g_malloc0(sizeof(*info));
>  
> -    info->arch = g_strdup(TARGET_NAME);
> +    /*
> +     * The fallback enum value is irrelevant here (TARGET_NAME is a
> +     * macro and can never be NULL), so simply pass (-1). Also, the
> +     * lookup should never fail -- if it fails, then @SysEmuTarget needs
> +     * extending. Catch that with "error_abort".
> +     */
> +    info->arch = qapi_enum_parse(&SysEmuTarget_lookup, TARGET_NAME, -1,
> +                                 &error_abort);
>  
>      return info;
>  }

Not sure the comment is carrying its weight; for me, the use of -1 and
&error_abort feels obvious enough.  But my feelings are subjective and
could be off.

Reviewed-by: Markus Armbruster <armbru@redhat.com>

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [Qemu-devel] [PATCH 5/6] qapi: extract CpuInfoCommon to mitigate schema duplication
  2018-04-24 21:45 ` [Qemu-devel] [PATCH 5/6] qapi: extract CpuInfoCommon to mitigate schema duplication Laszlo Ersek
@ 2018-04-25  7:06   ` Markus Armbruster
  2018-04-25 13:20     ` Laszlo Ersek
  0 siblings, 1 reply; 46+ messages in thread
From: Markus Armbruster @ 2018-04-25  7:06 UTC (permalink / raw)
  To: Laszlo Ersek; +Cc: qemu-devel

Laszlo Ersek <lersek@redhat.com> writes:

> @CpuInfo and @CpuInfoFast duplicate the following four fields: @qom-path,
> @thread-id, @props and @arch. From these, extract the first three to a
> common structure called @CpuInfoCommon. (More on @arch later.)
>
> Introduce two new mid-layer structures, @CpuInfoBase and @CpuInfoFastBase,
> to soak up the union base struct fields on top of @CpuInfoCommon that are
> specific to @query-cpus and @query-cpus-fast, respectively. This is
> necessary because the base struct spec in union definitions does not let
> us mix named fields with a recursive base struct. (In other words, we
> couldn't directly use @CpuInfoCommon *plus* some other fields within
> @CpuInfo and @CpuInfoFast as base struct).

Yes, you can either specify a base type or inline common members.  If
"union's common members = base type plus additional inline members"
turns out to be desirable in more places, we can try to add the feature.
I'm not asking *you* to find out, let alone try :)

> @arch cannot be hoisted higher than to @CpuInfoBase and @CpuInfoFastBase
> because the union descriminator is only accepted from a direct base
> struct, not from an indirect one.

That's a bit of a blemish.  Again, I'm not asking you to do anything
about it.

> Cc: Eric Blake <eblake@redhat.com>
> Cc: Markus Armbruster <armbru@redhat.com>
> Signed-off-by: Laszlo Ersek <lersek@redhat.com>
> ---
>
> Notes:
>     PATCHv1:
>     
>     - new patch
>
>  qapi/misc.json                      | 94 +++++++++++++++++++++++++------------
>  qapi/qapi-schema.json               |  2 +-
>  tests/test-x86-cpuid-compat.c       |  2 +-
>  tests/migration/guestperf/engine.py |  2 +-
>  4 files changed, 68 insertions(+), 32 deletions(-)
>
> diff --git a/qapi/misc.json b/qapi/misc.json
> index 460866cf542f..d7b776a5af37 100644
> --- a/qapi/misc.json
> +++ b/qapi/misc.json
> @@ -348,52 +348,81 @@
>  #
>  # @s390: since 2.12
>  #
>  # @riscv: since 2.12
>  #
>  # Since: 2.6
>  ##
>  { 'enum': 'CpuInfoArch',
>    'data': ['x86', 'sparc', 'ppc', 'mips', 'tricore', 's390', 'riscv', 'other' ] }
>  
>  ##
> -# @CpuInfo:
> +# @CpuInfoCommon:
>  #
> -# Information about a virtual CPU
> +# Collects fields common to @CpuInfoBase and @CpuInfoFastBase; that is,
> +# fields that are shared by @query-cpus and @query-cpus-fast, and not
> +# specific to the target architecture.
> +#
> +# @qom-path: path to the CPU object in the QOM tree (since 2.4)
> +#
> +# @thread-id: ID of the underlying host thread
> +#
> +# @props: properties describing which node/socket/core/thread the
> +#         virtual CPU belongs to, if supported by the board (since 2.10)
> +#
> +# Since: 2.13
> +##
> +{ 'struct' : 'CpuInfoCommon',
> +  'data'   : { 'qom-path'  : 'str',
> +               'thread-id' : 'int',
> +               '*props'    : 'CpuInstanceProperties' } }
> +
> +##
> +# @CpuInfoBase:
> +#
> +# Extends @CpuInfoCommon with fields that are specific to the @query-cpus
> +# command, but not specific to the target architecture.
>  #
>  # @CPU: the index of the virtual CPU
>  #
>  # @current: this only exists for backwards compatibility and should be ignored
>  #
>  # @halted: true if the virtual CPU is in the halt state.  Halt usually refers
>  #          to a processor specific low power mode.
>  #
> -# @qom_path: path to the CPU object in the QOM tree (since 2.4)
> -#
> -# @thread_id: ID of the underlying host thread
> -#
> -# @props: properties describing to which node/socket/core/thread
> -#         virtual CPU belongs to, provided if supported by board (since 2.10)
> -#
>  # @arch: architecture of the cpu, which determines which additional fields
>  #        will be listed (since 2.6)
>  #
> -# Since: 0.14.0
> +# Since: 2.13
>  #
>  # Notes: @halted is a transient state that changes frequently.  By the time the
>  #        data is sent to the client, the guest may no longer be halted.
> +#        Moreover, @arch cannot be moved up to @CpuInfoCommon because
> +#        that would prevent its use as the discriminator in @CpuInfo.
> +##
> +{ 'struct' : 'CpuInfoBase',
> +  'base'   : 'CpuInfoCommon',
> +  'data'   : { 'CPU'     : 'int',
> +               'current' : 'bool',
> +               'halted'  : 'bool',
> +               'arch'    : 'CpuInfoArch' } }
> +
> +##
> +# @CpuInfo:
> +#
> +# Information about a virtual CPU
> +#
> +# Since: 0.14.0
>  ##
>  { 'union': 'CpuInfo',
> -  'base': {'CPU': 'int', 'current': 'bool', 'halted': 'bool',
> -           'qom_path': 'str', 'thread_id': 'int',
> -           '*props': 'CpuInstanceProperties', 'arch': 'CpuInfoArch' },
> +  'base': 'CpuInfoBase',
>    'discriminator': 'arch',
>    'data': { 'x86': 'CpuInfoX86',
>              'sparc': 'CpuInfoSPARC',
>              'ppc': 'CpuInfoPPC',
>              'mips': 'CpuInfoMIPS',
>              'tricore': 'CpuInfoTricore',
>              's390': 'CpuInfoS390',
>              'riscv': 'CpuInfoRISCV',
>              'other': 'CpuInfoOther' } }
>  
>  ##
> @@ -512,70 +541,77 @@
>  #
>  # Since: 0.14.0
>  #
>  # Example:
>  #
>  # -> { "execute": "query-cpus" }
>  # <- { "return": [
>  #          {
>  #             "CPU":0,
>  #             "current":true,
>  #             "halted":false,
> -#             "qom_path":"/machine/unattached/device[0]",
> +#             "qom-path":"/machine/unattached/device[0]",
>  #             "arch":"x86",
>  #             "pc":3227107138,
> -#             "thread_id":3134
> +#             "thread-id":3134
>  #          },
>  #          {
>  #             "CPU":1,
>  #             "current":false,
>  #             "halted":true,
> -#             "qom_path":"/machine/unattached/device[2]",
> +#             "qom-path":"/machine/unattached/device[2]",
>  #             "arch":"x86",
>  #             "pc":7108165,
> -#             "thread_id":3135
> +#             "thread-id":3135
>  #          }
>  #       ]
>  #    }

Compatibility break, whoops!

CpuInfo and CpuInfoFast do share qom-path and thread-id *values*, but
the keys differ in '_' vs. '-'.  Sad.

What now?  Is there enough common stuff left to justify the refactoring?

>  #
>  # Notes: This interface is deprecated (since 2.12.0), and it is strongly
>  #        recommended that you avoid using it. Use @query-cpus-fast to
>  #        obtain information about virtual CPUs.
>  #
>  ##
>  { 'command': 'query-cpus', 'returns': ['CpuInfo'] }
>  
>  ##
> -# @CpuInfoFast:
> +# @CpuInfoFastBase:
>  #
> -# Information about a virtual CPU
> +# Extends @CpuInfoCommon with fields that are specific to the
> +# @query-cpus-fast command, but not specific to the target architecture.
>  #
>  # @cpu-index: index of the virtual CPU
>  #
> -# @qom-path: path to the CPU object in the QOM tree
> -#
> -# @thread-id: ID of the underlying host thread
> -#
> -# @props: properties describing to which node/socket/core/thread
> -#         virtual CPU belongs to, provided if supported by board
> -#
>  # @arch: architecture of the cpu, which determines which additional fields
>  #        will be listed
>  #
> +# Since: 2.13
> +#
> +# Notes: @arch cannot be moved up to @CpuInfoCommon because that would
> +#        prevent its use as the discriminator in @CpuInfoFast.
> +##
> +{ 'struct' : 'CpuInfoFastBase',
> +  'base'   : 'CpuInfoCommon',
> +  'data'   : { 'cpu-index' : 'int',
> +               'arch'      : 'CpuInfoArch' } }
> +
> +##
> +# @CpuInfoFast:
> +#
> +# Information about a virtual CPU
> +#
>  # Since: 2.12
>  #
>  ##
>  { 'union': 'CpuInfoFast',
> -  'base': {'cpu-index': 'int', 'qom-path': 'str',
> -           'thread-id': 'int', '*props': 'CpuInstanceProperties',
> -           'arch': 'CpuInfoArch' },
> +  'base': 'CpuInfoFastBase',
>    'discriminator': 'arch',
>    'data': { 'x86': 'CpuInfoOther',
>              'sparc': 'CpuInfoOther',
>              'ppc': 'CpuInfoOther',
>              'mips': 'CpuInfoOther',
>              'tricore': 'CpuInfoOther',
>              's390': 'CpuInfoS390',
>              'riscv': 'CpuInfoOther',
>              'other': 'CpuInfoOther' } }
>  
>  ##
> diff --git a/qapi/qapi-schema.json b/qapi/qapi-schema.json
> index 25bce78352b8..5bfd2ef1dd3b 100644
> --- a/qapi/qapi-schema.json
> +++ b/qapi/qapi-schema.json
> @@ -61,23 +61,23 @@
>          'query-migrate-cache-size',
>          'query-tpm-models',
>          'query-tpm-types',
>          'ringbuf-read' ],
>      'name-case-whitelist': [
>          'ACPISlotType',         # DIMM, visible through query-acpi-ospm-status
>          'CpuInfoMIPS',          # PC, visible through query-cpu
>          'CpuInfoTricore',       # PC, visible through query-cpu
>          'QapiErrorClass',       # all members, visible through errors
>          'UuidInfo',             # UUID, visible through query-uuid
>          'X86CPURegister32',     # all members, visible indirectly through qom-get
> -        'q_obj_CpuInfo-base'    # CPU, visible through query-cpu
> +        'CpuInfoBase'           # CPU, visible through query-cpu

Let's update this to "visible through query-cpus, query-cpus-fast" while
there.

>      ] } }
>  
>  # Documentation generated with qapi-gen.py is in source order, with
>  # included sub-schemas inserted at the first include directive
>  # (subsequent include directives have no effect).  To get a sane and
>  # stable order, it's best to include each sub-schema just once, or
>  # include it first right here.
>  
>  { 'include': 'common.json' }
>  { 'include': 'sockets.json' }
>  { 'include': 'run-state.json' }
[...]

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [Qemu-devel] [PATCH 1/6] qapi: fill in CpuInfoFast.arch in query-cpus-fast
  2018-04-24 21:45 ` [Qemu-devel] [PATCH 1/6] qapi: fill in CpuInfoFast.arch in query-cpus-fast Laszlo Ersek
  2018-04-24 22:30   ` Eric Blake
  2018-04-25  6:39   ` Markus Armbruster
@ 2018-04-25  7:28   ` Cornelia Huck
  2 siblings, 0 replies; 46+ messages in thread
From: Cornelia Huck @ 2018-04-25  7:28 UTC (permalink / raw)
  To: Laszlo Ersek
  Cc: qemu-devel, Peter Crosthwaite, qemu-stable, Markus Armbruster,
	Paolo Bonzini, Richard Henderson

On Tue, 24 Apr 2018 23:45:45 +0200
Laszlo Ersek <lersek@redhat.com> wrote:

> Commit ca230ff33f89 added added the @arch field to @CpuInfoFast, but it
> failed to set the new field in qmp_query_cpus_fast(), when TARGET_S390X
> was not defined. The updated @query-cpus-fast example in
> "qapi-schema.json" showed "arch":"x86" only because qmp_query_cpus_fast()
> calls g_malloc0() to allocate CpuInfoFast, and the CPU_INFO_ARCH_X86 enum
> constant is generated with value 0.
> 
> All @arch values other than @s390 implied the @CpuInfoOther sub-struct for
> @CpuInfoFast -- at the time of writing the patch --, thus no fields other
> than @arch needed to be set when TARGET_S390X was not defined. Set @arch
> now, by copying the corresponding assignments from qmp_query_cpus().

I agree with others that this looks a bit odd for riscv, and merging
patch 2 would be an option. But this is fine as well.

> 
> Cc: Eric Blake <eblake@redhat.com>
> Cc: Markus Armbruster <armbru@redhat.com>
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Cc: Peter Crosthwaite <crosthwaite.peter@gmail.com>
> Cc: Richard Henderson <rth@twiddle.net>
> Cc: qemu-stable@nongnu.org
> Fixes: ca230ff33f89bf7102cbfbc2328716da6750aaed
> Signed-off-by: Laszlo Ersek <lersek@redhat.com>

Reviewed-by: Cornelia Huck <cohuck@redhat.com>

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [Qemu-devel] [PATCH 6/6] qapi: discriminate CpuInfo[Fast] on SysEmuTarget, not CpuInfoArch
  2018-04-24 21:45 ` [Qemu-devel] [PATCH 6/6] qapi: discriminate CpuInfo[Fast] on SysEmuTarget, not CpuInfoArch Laszlo Ersek
@ 2018-04-25  7:33   ` Markus Armbruster
  2018-04-25 13:47     ` Laszlo Ersek
  0 siblings, 1 reply; 46+ messages in thread
From: Markus Armbruster @ 2018-04-25  7:33 UTC (permalink / raw)
  To: Laszlo Ersek
  Cc: qemu-devel, Paolo Bonzini, Richard Henderson, Peter Crosthwaite

Laszlo Ersek <lersek@redhat.com> writes:

> Add a new field @target (of type @SysEmuTarget) to the outputs of the
> @query-cpus and @query-cpus-fast commands, which provides more information
> about the emulation target than the field @arch (of type @CpuInfoArch).
> Keep @arch for compatibility.
>
> Make @target the new discriminator for the @CpuInfo and @CpuInfoFast
> return structures. This lets us hoist @arch to @CpuInfoCommon, but it also
> requires some gymnastics in qmp_query_cpus() and qmp_query_cpus_fast().
>
> In particular, conditional compilation cannot be removed, because each
> pair of CPU base arch structures, such as X86CPU/CPUX86State,
> PowerPCCPU/CPUPPCState, SPARCCPU/CPUSPARCState, is only visible when
> building QEMU for a target that maps to that CPU base arch.
>
> Cc: Eric Blake <eblake@redhat.com>
> Cc: Markus Armbruster <armbru@redhat.com>
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Cc: Peter Crosthwaite <crosthwaite.peter@gmail.com>
> Cc: Richard Henderson <rth@twiddle.net>
> Signed-off-by: Laszlo Ersek <lersek@redhat.com>
> ---
>
> Notes:
>     PATCHv1:
>     
>     - new patch
>
>  qapi/misc.json | 118 ++++++++++++++++++-------
>  cpus.c         | 275 ++++++++++++++++++++++++++++++++++++++++++---------------
>  2 files changed, 291 insertions(+), 102 deletions(-)
>
> diff --git a/qapi/misc.json b/qapi/misc.json
> index d7b776a5af37..98c15880f9f0 100644
> --- a/qapi/misc.json
> +++ b/qapi/misc.json
> @@ -361,77 +361,105 @@
>  # Collects fields common to @CpuInfoBase and @CpuInfoFastBase; that is,
>  # fields that are shared by @query-cpus and @query-cpus-fast, and not
>  # specific to the target architecture.
>  #
>  # @qom-path: path to the CPU object in the QOM tree (since 2.4)
>  #
>  # @thread-id: ID of the underlying host thread
>  #
>  # @props: properties describing which node/socket/core/thread the
>  #         virtual CPU belongs to, if supported by the board (since 2.10)
>  #
> +# @arch: base architecture of the cpu (since 2.6)
> +#
>  # Since: 2.13
>  ##
>  { 'struct' : 'CpuInfoCommon',
>    'data'   : { 'qom-path'  : 'str',
>                 'thread-id' : 'int',
> -               '*props'    : 'CpuInstanceProperties' } }
> +               '*props'    : 'CpuInstanceProperties',
> +               'arch'      : 'CpuInfoArch' } }
>  
>  ##
>  # @CpuInfoBase:
>  #
>  # Extends @CpuInfoCommon with fields that are specific to the @query-cpus
>  # command, but not specific to the target architecture.
>  #
>  # @CPU: the index of the virtual CPU
>  #
>  # @current: this only exists for backwards compatibility and should be ignored
>  #
>  # @halted: true if the virtual CPU is in the halt state.  Halt usually refers
>  #          to a processor specific low power mode.
>  #
> -# @arch: architecture of the cpu, which determines which additional fields
> -#        will be listed (since 2.6)
> +# @target: the QEMU system emulation target, which is more specific than
> +#          @arch and determines which additional fields will be listed
> +#
>  #
>  # Since: 2.13
>  #
>  # Notes: @halted is a transient state that changes frequently.  By the time the
>  #        data is sent to the client, the guest may no longer be halted.
> -#        Moreover, @arch cannot be moved up to @CpuInfoCommon because
> +#        Moreover, @target cannot be moved up to @CpuInfoCommon because
>  #        that would prevent its use as the discriminator in @CpuInfo.
>  ##
>  { 'struct' : 'CpuInfoBase',
>    'base'   : 'CpuInfoCommon',
>    'data'   : { 'CPU'     : 'int',
>                 'current' : 'bool',
>                 'halted'  : 'bool',
> -               'arch'    : 'CpuInfoArch' } }
> +               'target'  : 'SysEmuTarget' } }
>  
>  ##
>  # @CpuInfo:
>  #
>  # Information about a virtual CPU
>  #
>  # Since: 0.14.0
>  ##
> -{ 'union': 'CpuInfo',
> -  'base': 'CpuInfoBase',
> -  'discriminator': 'arch',
> -  'data': { 'x86': 'CpuInfoX86',
> -            'sparc': 'CpuInfoSPARC',
> -            'ppc': 'CpuInfoPPC',
> -            'mips': 'CpuInfoMIPS',
> -            'tricore': 'CpuInfoTricore',
> -            's390': 'CpuInfoS390',
> -            'riscv': 'CpuInfoRISCV',
> -            'other': 'CpuInfoOther' } }
> +{ 'union'         : 'CpuInfo',
> +  'base'          : 'CpuInfoBase',
> +  'discriminator' : 'target',
> +  'data'          : { 'i386'         : 'CpuInfoX86',
> +                      'x86_64'       : 'CpuInfoX86',
> +                      'sparc'        : 'CpuInfoSPARC',
> +                      'sparc64'      : 'CpuInfoSPARC',
> +                      'ppc'          : 'CpuInfoPPC',
> +                      'ppcemb'       : 'CpuInfoPPC',
> +                      'ppc64'        : 'CpuInfoPPC',
> +                      'mips'         : 'CpuInfoMIPS',
> +                      'mipsel'       : 'CpuInfoMIPS',
> +                      'mips64'       : 'CpuInfoMIPS',
> +                      'mips64el'     : 'CpuInfoMIPS',
> +                      'tricore'      : 'CpuInfoTricore',
> +                      's390x'        : 'CpuInfoS390',
> +                      'riscv32'      : 'CpuInfoRISCV',
> +                      'riscv64'      : 'CpuInfoRISCV',
> +                      'aarch64'      : 'CpuInfoOther',
> +                      'alpha'        : 'CpuInfoOther',
> +                      'arm'          : 'CpuInfoOther',
> +                      'cris'         : 'CpuInfoOther',
> +                      'hppa'         : 'CpuInfoOther',
> +                      'lm32'         : 'CpuInfoOther',
> +                      'm68k'         : 'CpuInfoOther',
> +                      'microblaze'   : 'CpuInfoOther',
> +                      'microblazeel' : 'CpuInfoOther',
> +                      'moxie'        : 'CpuInfoOther',
> +                      'nios2'        : 'CpuInfoOther',
> +                      'or1k'         : 'CpuInfoOther',
> +                      'sh4'          : 'CpuInfoOther',
> +                      'sh4eb'        : 'CpuInfoOther',
> +                      'unicore32'    : 'CpuInfoOther',
> +                      'xtensa'       : 'CpuInfoOther',
> +                      'xtensaeb'     : 'CpuInfoOther' } }
>  
>  ##
>  # @CpuInfoX86:
>  #
>  # Additional information about a virtual i386 or x86_64 CPU
>  #
>  # @pc: the 64-bit instruction pointer
>  #
>  # Since: 2.6
>  ##
>  { 'struct': 'CpuInfoX86', 'data': { 'pc': 'int' } }
> @@ -543,84 +571,110 @@
>  #
>  # Example:
>  #
>  # -> { "execute": "query-cpus" }
>  # <- { "return": [
>  #          {
>  #             "CPU":0,
>  #             "current":true,
>  #             "halted":false,
>  #             "qom-path":"/machine/unattached/device[0]",
>  #             "arch":"x86",
> +#             "target":"x86_64",
>  #             "pc":3227107138,
>  #             "thread-id":3134
>  #          },
>  #          {
>  #             "CPU":1,
>  #             "current":false,
>  #             "halted":true,
>  #             "qom-path":"/machine/unattached/device[2]",
>  #             "arch":"x86",
> +#             "target":"x86_64",
>  #             "pc":7108165,
>  #             "thread-id":3135
>  #          }
>  #       ]
>  #    }
>  #
>  # Notes: This interface is deprecated (since 2.12.0), and it is strongly
>  #        recommended that you avoid using it. Use @query-cpus-fast to
>  #        obtain information about virtual CPUs.
>  #
>  ##
>  { 'command': 'query-cpus', 'returns': ['CpuInfo'] }
>  
>  ##
>  # @CpuInfoFastBase:
>  #
>  # Extends @CpuInfoCommon with fields that are specific to the
>  # @query-cpus-fast command, but not specific to the target architecture.
>  #
>  # @cpu-index: index of the virtual CPU
>  #
> -# @arch: architecture of the cpu, which determines which additional fields
> -#        will be listed
> +# @target: the QEMU system emulation target, which is more specific than
> +#          @arch and determines which additional fields will be listed
>  #
>  # Since: 2.13
>  #
> -# Notes: @arch cannot be moved up to @CpuInfoCommon because that would
> +# Notes: @target cannot be moved up to @CpuInfoCommon because that would
>  #        prevent its use as the discriminator in @CpuInfoFast.
>  ##
>  { 'struct' : 'CpuInfoFastBase',
>    'base'   : 'CpuInfoCommon',
>    'data'   : { 'cpu-index' : 'int',
> -               'arch'      : 'CpuInfoArch' } }
> +               'target'    : 'SysEmuTarget' } }
>  
>  ##
>  # @CpuInfoFast:
>  #
>  # Information about a virtual CPU
>  #
>  # Since: 2.12
>  #
>  ##
> -{ 'union': 'CpuInfoFast',
> -  'base': 'CpuInfoFastBase',
> -  'discriminator': 'arch',
> -  'data': { 'x86': 'CpuInfoOther',
> -            'sparc': 'CpuInfoOther',
> -            'ppc': 'CpuInfoOther',
> -            'mips': 'CpuInfoOther',
> -            'tricore': 'CpuInfoOther',
> -            's390': 'CpuInfoS390',
> -            'riscv': 'CpuInfoOther',
> -            'other': 'CpuInfoOther' } }
> +{ 'union'         : 'CpuInfoFast',
> +  'base'          : 'CpuInfoFastBase',
> +  'discriminator' : 'target',
> +  'data'          : { 'i386'         : 'CpuInfoOther',
> +                      'x86_64'       : 'CpuInfoOther',
> +                      'sparc'        : 'CpuInfoOther',
> +                      'sparc64'      : 'CpuInfoOther',
> +                      'ppc'          : 'CpuInfoOther',
> +                      'ppcemb'       : 'CpuInfoOther',
> +                      'ppc64'        : 'CpuInfoOther',
> +                      'mips'         : 'CpuInfoOther',
> +                      'mipsel'       : 'CpuInfoOther',
> +                      'mips64'       : 'CpuInfoOther',
> +                      'mips64el'     : 'CpuInfoOther',
> +                      'tricore'      : 'CpuInfoOther',
> +                      's390x'        : 'CpuInfoS390',
> +                      'riscv32'      : 'CpuInfoOther',
> +                      'riscv64'      : 'CpuInfoOther',
> +                      'aarch64'      : 'CpuInfoOther',
> +                      'alpha'        : 'CpuInfoOther',
> +                      'arm'          : 'CpuInfoOther',
> +                      'cris'         : 'CpuInfoOther',
> +                      'hppa'         : 'CpuInfoOther',
> +                      'lm32'         : 'CpuInfoOther',
> +                      'm68k'         : 'CpuInfoOther',
> +                      'microblaze'   : 'CpuInfoOther',
> +                      'microblazeel' : 'CpuInfoOther',
> +                      'moxie'        : 'CpuInfoOther',
> +                      'nios2'        : 'CpuInfoOther',
> +                      'or1k'         : 'CpuInfoOther',
> +                      'sh4'          : 'CpuInfoOther',
> +                      'sh4eb'        : 'CpuInfoOther',
> +                      'unicore32'    : 'CpuInfoOther',
> +                      'xtensa'       : 'CpuInfoOther',
> +                      'xtensaeb'     : 'CpuInfoOther' } }
>  
>  ##
>  # @query-cpus-fast:
>  #
>  # Returns information about all virtual CPUs. This command does not
>  # incur a performance penalty and should be used in production
>  # instead of query-cpus.
>  #
>  # Returns: list of @CpuInfoFast
>  #
>  # Since: 2.12
> @@ -630,33 +684,35 @@
>  # -> { "execute": "query-cpus-fast" }
>  # <- { "return": [
>  #         {
>  #             "thread-id": 25627,
>  #             "props": {
>  #                 "core-id": 0,
>  #                 "thread-id": 0,
>  #                 "socket-id": 0
>  #             },
>  #             "qom-path": "/machine/unattached/device[0]",
>  #             "arch":"x86",
> +#             "target":"x86_64",
>  #             "cpu-index": 0
>  #         },
>  #         {
>  #             "thread-id": 25628,
>  #             "props": {
>  #                 "core-id": 0,
>  #                 "thread-id": 0,
>  #                 "socket-id": 1
>  #             },
>  #             "qom-path": "/machine/unattached/device[2]",
>  #             "arch":"x86",
> +#             "target":"x86_64",
>  #             "cpu-index": 1
>  #         }
>  #     ]
>  # }
>  ##
>  { 'command': 'query-cpus-fast', 'returns': [ 'CpuInfoFast' ] }
>  
>  ##
>  # @IOThreadInfo:
>  #
>  # Information about an iothread
> diff --git a/cpus.c b/cpus.c
> index 60563a6d54ec..86eed0ffe796 100644
> --- a/cpus.c
> +++ b/cpus.c
> @@ -2093,88 +2093,235 @@ int vm_stop_force_state(RunState state)
>      }
>  }
>  
>  void list_cpus(FILE *f, fprintf_function cpu_fprintf, const char *optarg)
>  {
>      /* XXX: implement xxx_cpu_list for targets that still miss it */
>  #if defined(cpu_list)
>      cpu_list(f, cpu_fprintf);
>  #endif
>  }
>  
> +static CpuInfoArch sysemu_target_to_cpuinfo_arch(SysEmuTarget target)
> +{
> +    /*
> +     * The @SysEmuTarget -> @CpuInfoArch mapping below is based on the
> +     * TARGET_ARCH -> TARGET_BASE_ARCH mapping in the "configure" script.
> +     */
> +    switch (target) {
> +    case SYS_EMU_TARGET_I386:
> +    case SYS_EMU_TARGET_X86_64:
> +        return CPU_INFO_ARCH_X86;
> +
> +    case SYS_EMU_TARGET_PPC:
> +    case SYS_EMU_TARGET_PPCEMB:
> +    case SYS_EMU_TARGET_PPC64:
> +        return CPU_INFO_ARCH_PPC;
> +
> +    case SYS_EMU_TARGET_SPARC:
> +    case SYS_EMU_TARGET_SPARC64:
> +        return CPU_INFO_ARCH_SPARC;
> +
> +    case SYS_EMU_TARGET_MIPS:
> +    case SYS_EMU_TARGET_MIPSEL:
> +    case SYS_EMU_TARGET_MIPS64:
> +    case SYS_EMU_TARGET_MIPS64EL:
> +        return CPU_INFO_ARCH_MIPS;
> +
> +    case SYS_EMU_TARGET_TRICORE:
> +        return CPU_INFO_ARCH_TRICORE;
> +
> +    case SYS_EMU_TARGET_S390X:
> +        return CPU_INFO_ARCH_S390;
> +
> +    case SYS_EMU_TARGET_RISCV32:
> +    case SYS_EMU_TARGET_RISCV64:
> +        return CPU_INFO_ARCH_RISCV;
> +
> +    default:
> +        return CPU_INFO_ARCH_OTHER;
> +    }
> +}

Hmm.  Can we avoid duplicating configure's mapping here?  More on that
below.

> +
> +static void cpustate_to_cpuinfo_x86(CpuInfoX86 *info, const CPUState *cpu)
> +{
> +#ifdef TARGET_I386
> +    X86CPU *x86_cpu = X86_CPU(cpu);
> +    CPUX86State *env = &x86_cpu->env;
> +
> +    info->pc = env->eip + env->segs[R_CS].base;
> +#else
> +    abort();
> +#endif
> +}
> +
> +static void cpustate_to_cpuinfo_ppc(CpuInfoPPC *info, const CPUState *cpu)
> +{
> +#ifdef TARGET_PPC
> +    PowerPCCPU *ppc_cpu = POWERPC_CPU(cpu);
> +    CPUPPCState *env = &ppc_cpu->env;
> +
> +    info->nip = env->nip;
> +#else
> +    abort();
> +#endif
> +}
> +
> +static void cpustate_to_cpuinfo_sparc(CpuInfoSPARC *info, const CPUState *cpu)
> +{
> +#ifdef TARGET_SPARC
> +    SPARCCPU *sparc_cpu = SPARC_CPU(cpu);
> +    CPUSPARCState *env = &sparc_cpu->env;
> +
> +    info->pc = env->pc;
> +    info->npc = env->npc;
> +#else
> +    abort();
> +#endif
> +}
> +
> +static void cpustate_to_cpuinfo_mips(CpuInfoMIPS *info, const CPUState *cpu)
> +{
> +#ifdef TARGET_MIPS
> +    MIPSCPU *mips_cpu = MIPS_CPU(cpu);
> +    CPUMIPSState *env = &mips_cpu->env;
> +
> +    info->PC = env->active_tc.PC;
> +#else
> +    abort();
> +#endif
> +}
> +
> +static void cpustate_to_cpuinfo_tricore(CpuInfoTricore *info,
> +                                        const CPUState *cpu)
> +{
> +#ifdef TARGET_TRICORE
> +    TriCoreCPU *tricore_cpu = TRICORE_CPU(cpu);
> +    CPUTriCoreState *env = &tricore_cpu->env;
> +
> +    info->PC = env->PC;
> +#else
> +    abort();
> +#endif
> +}
> +
> +static void cpustate_to_cpuinfo_s390(CpuInfoS390 *info, const CPUState *cpu)
> +{
> +#ifdef TARGET_S390X
> +    S390CPU *s390_cpu = S390_CPU(cpu);
> +    CPUS390XState *env = &s390_cpu->env;
> +
> +    info->cpu_state = env->cpu_state;
> +#else
> +    abort();
> +#endif
> +}
> +
> +static void cpustate_to_cpuinfo_riscv(CpuInfoRISCV *info, const CPUState *cpu)
> +{
> +#ifdef TARGET_RISCV
> +    RISCVCPU *riscv_cpu = RISCV_CPU(cpu);
> +    CPURISCVState *env = &riscv_cpu->env;
> +
> +    info->pc = env->pc;
> +#else
> +    abort();
> +#endif
> +}
> +

To reduce #ifdeffery here, these helpers could be moved to suitable
files in target/*/, plus stubs, but I doubt it's worth the bother.

>  CpuInfoList *qmp_query_cpus(Error **errp)
>  {
>      MachineState *ms = MACHINE(qdev_get_machine());
>      MachineClass *mc = MACHINE_GET_CLASS(ms);
>      CpuInfoList *head = NULL, *cur_item = NULL;
> +    SysEmuTarget target = qapi_enum_parse(&SysEmuTarget_lookup, TARGET_NAME,
> +                                          -1, &error_abort);

Note how configure providing TARGET_NAME makes computing target easy.

Compare to how sysemu_target_to_cpuinfo_arch() computes arch.  Would it
make sense to have configure provide TARGET_BASE_NAME, so we can compute
arch the same way as target?

>      CPUState *cpu;
>  
>      CPU_FOREACH(cpu) {
>          CpuInfoList *info;
> -#if defined(TARGET_I386)
> -        X86CPU *x86_cpu = X86_CPU(cpu);
> -        CPUX86State *env = &x86_cpu->env;
> -#elif defined(TARGET_PPC)
> -        PowerPCCPU *ppc_cpu = POWERPC_CPU(cpu);
> -        CPUPPCState *env = &ppc_cpu->env;
> -#elif defined(TARGET_SPARC)
> -        SPARCCPU *sparc_cpu = SPARC_CPU(cpu);
> -        CPUSPARCState *env = &sparc_cpu->env;
> -#elif defined(TARGET_RISCV)
> -        RISCVCPU *riscv_cpu = RISCV_CPU(cpu);
> -        CPURISCVState *env = &riscv_cpu->env;
> -#elif defined(TARGET_MIPS)
> -        MIPSCPU *mips_cpu = MIPS_CPU(cpu);
> -        CPUMIPSState *env = &mips_cpu->env;
> -#elif defined(TARGET_TRICORE)
> -        TriCoreCPU *tricore_cpu = TRICORE_CPU(cpu);
> -        CPUTriCoreState *env = &tricore_cpu->env;
> -#elif defined(TARGET_S390X)
> -        S390CPU *s390_cpu = S390_CPU(cpu);
> -        CPUS390XState *env = &s390_cpu->env;
> -#endif
>  
>          cpu_synchronize_state(cpu);
>  
>          info = g_malloc0(sizeof(*info));
>          info->value = g_malloc0(sizeof(*info->value));
>          info->value->CPU = cpu->cpu_index;
>          info->value->current = (cpu == first_cpu);
>          info->value->halted = cpu->halted;
>          info->value->qom_path = object_get_canonical_path(OBJECT(cpu));
>          info->value->thread_id = cpu->thread_id;
> -#if defined(TARGET_I386)
> -        info->value->arch = CPU_INFO_ARCH_X86;
> -        info->value->u.x86.pc = env->eip + env->segs[R_CS].base;
> -#elif defined(TARGET_PPC)
> -        info->value->arch = CPU_INFO_ARCH_PPC;
> -        info->value->u.ppc.nip = env->nip;
> -#elif defined(TARGET_SPARC)
> -        info->value->arch = CPU_INFO_ARCH_SPARC;
> -        info->value->u.q_sparc.pc = env->pc;
> -        info->value->u.q_sparc.npc = env->npc;
> -#elif defined(TARGET_MIPS)
> -        info->value->arch = CPU_INFO_ARCH_MIPS;
> -        info->value->u.q_mips.PC = env->active_tc.PC;
> -#elif defined(TARGET_TRICORE)
> -        info->value->arch = CPU_INFO_ARCH_TRICORE;
> -        info->value->u.tricore.PC = env->PC;
> -#elif defined(TARGET_S390X)
> -        info->value->arch = CPU_INFO_ARCH_S390;
> -        info->value->u.s390.cpu_state = env->cpu_state;
> -#elif defined(TARGET_RISCV)
> -        info->value->arch = CPU_INFO_ARCH_RISCV;
> -        info->value->u.riscv.pc = env->pc;
> -#else
> -        info->value->arch = CPU_INFO_ARCH_OTHER;
> -#endif
> +        info->value->arch = sysemu_target_to_cpuinfo_arch(target);
> +        info->value->target = target;
> +
> +        /*
> +         * The @SysEmuTarget -> @CpuInfo mapping below is based on the
> +         * TARGET_ARCH -> TARGET_BASE_ARCH mapping in the "configure" script.
> +         */
> +        switch (target) {
> +        case SYS_EMU_TARGET_I386:
> +            cpustate_to_cpuinfo_x86(&info->value->u.i386, cpu);
> +            break;
> +        case SYS_EMU_TARGET_X86_64:
> +            cpustate_to_cpuinfo_x86(&info->value->u.x86_64, cpu);
> +            break;
> +
> +        case SYS_EMU_TARGET_PPC:
> +            cpustate_to_cpuinfo_ppc(&info->value->u.ppc, cpu);
> +            break;
> +        case SYS_EMU_TARGET_PPCEMB:
> +            cpustate_to_cpuinfo_ppc(&info->value->u.ppcemb, cpu);
> +            break;
> +        case SYS_EMU_TARGET_PPC64:
> +            cpustate_to_cpuinfo_ppc(&info->value->u.ppc64, cpu);
> +            break;
> +
> +        case SYS_EMU_TARGET_SPARC:
> +            cpustate_to_cpuinfo_sparc(&info->value->u.q_sparc, cpu);
> +            break;
> +        case SYS_EMU_TARGET_SPARC64:
> +            cpustate_to_cpuinfo_sparc(&info->value->u.sparc64, cpu);
> +            break;
> +
> +        case SYS_EMU_TARGET_MIPS:
> +            cpustate_to_cpuinfo_mips(&info->value->u.q_mips, cpu);
> +            break;
> +        case SYS_EMU_TARGET_MIPSEL:
> +            cpustate_to_cpuinfo_mips(&info->value->u.mipsel, cpu);
> +            break;
> +        case SYS_EMU_TARGET_MIPS64:
> +            cpustate_to_cpuinfo_mips(&info->value->u.mips64, cpu);
> +            break;
> +        case SYS_EMU_TARGET_MIPS64EL:
> +            cpustate_to_cpuinfo_mips(&info->value->u.mips64el, cpu);
> +            break;
> +
> +        case SYS_EMU_TARGET_TRICORE:
> +            cpustate_to_cpuinfo_tricore(&info->value->u.tricore, cpu);
> +            break;
> +
> +        case SYS_EMU_TARGET_S390X:
> +            cpustate_to_cpuinfo_s390(&info->value->u.s390x, cpu);
> +            break;
> +
> +        case SYS_EMU_TARGET_RISCV32:
> +            cpustate_to_cpuinfo_riscv(&info->value->u.riscv32, cpu);
> +            break;
> +        case SYS_EMU_TARGET_RISCV64:
> +            cpustate_to_cpuinfo_riscv(&info->value->u.riscv64, cpu);
> +            break;
> +
> +        default:
> +            /* do nothing for @CpuInfoOther */
> +            break;
> +        }
> +
>          info->value->has_props = !!mc->cpu_index_to_instance_props;
>          if (info->value->has_props) {
>              CpuInstanceProperties *props;
>              props = g_malloc0(sizeof(*props));
>              *props = mc->cpu_index_to_instance_props(ms, cpu->cpu_index);
>              info->value->props = props;
>          }
>  
>          /* XXX: waiting for the qapi to support GSList */
>          if (!cur_item) {
>              head = cur_item = info;
> @@ -2188,64 +2335,50 @@ CpuInfoList *qmp_query_cpus(Error **errp)
>  }
>  
>  /*
>   * fast means: we NEVER interrupt vCPU threads to retrieve
>   * information from KVM.
>   */
>  CpuInfoFastList *qmp_query_cpus_fast(Error **errp)
>  {
>      MachineState *ms = MACHINE(qdev_get_machine());
>      MachineClass *mc = MACHINE_GET_CLASS(ms);
>      CpuInfoFastList *head = NULL, *cur_item = NULL;
> +    SysEmuTarget target = qapi_enum_parse(&SysEmuTarget_lookup, TARGET_NAME,
> +                                          -1, &error_abort);
>      CPUState *cpu;
> -#if defined(TARGET_S390X)
> -    S390CPU *s390_cpu;
> -    CPUS390XState *env;
> -#endif
>  
>      CPU_FOREACH(cpu) {
>          CpuInfoFastList *info = g_malloc0(sizeof(*info));
>          info->value = g_malloc0(sizeof(*info->value));
>  
>          info->value->cpu_index = cpu->cpu_index;
>          info->value->qom_path = object_get_canonical_path(OBJECT(cpu));
>          info->value->thread_id = cpu->thread_id;
>  
>          info->value->has_props = !!mc->cpu_index_to_instance_props;
>          if (info->value->has_props) {
>              CpuInstanceProperties *props;
>              props = g_malloc0(sizeof(*props));
>              *props = mc->cpu_index_to_instance_props(ms, cpu->cpu_index);
>              info->value->props = props;
>          }
>  
> -#if defined(TARGET_I386)
> -        info->value->arch = CPU_INFO_ARCH_X86;
> -#elif defined(TARGET_PPC)
> -        info->value->arch = CPU_INFO_ARCH_PPC;
> -#elif defined(TARGET_SPARC)
> -        info->value->arch = CPU_INFO_ARCH_SPARC;
> -#elif defined(TARGET_MIPS)
> -        info->value->arch = CPU_INFO_ARCH_MIPS;
> -#elif defined(TARGET_TRICORE)
> -        info->value->arch = CPU_INFO_ARCH_TRICORE;
> -#elif defined(TARGET_S390X)
> -        s390_cpu = S390_CPU(cpu);
> -        env = &s390_cpu->env;
> -        info->value->arch = CPU_INFO_ARCH_S390;
> -        info->value->u.s390.cpu_state = env->cpu_state;
> -#elif defined(TARGET_RISCV)
> -        info->value->arch = CPU_INFO_ARCH_RISCV;
> -#else
> -        info->value->arch = CPU_INFO_ARCH_OTHER;
> -#endif
> +        info->value->arch = sysemu_target_to_cpuinfo_arch(target);
> +        info->value->target = target;
> +        if (target == SYS_EMU_TARGET_S390X) {
> +            cpustate_to_cpuinfo_s390(&info->value->u.s390x, cpu);
> +        } else {
> +            /* do nothing for @CpuInfoOther */
> +        }
> +
>          if (!cur_item) {
>              head = cur_item = info;
>          } else {
>              cur_item->next = info;
>              cur_item = info;
>          }
>      }
>  
>      return head;
>  }

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [Qemu-devel] [PATCH 2/6] qapi: handle the riscv CpuInfoArch in query-cpus-fast
  2018-04-25  6:44   ` Markus Armbruster
@ 2018-04-25  7:48     ` Cornelia Huck
  2018-04-25 12:38       ` Viktor VM Mihajlovski
  2018-04-25 12:43       ` Laszlo Ersek
  0 siblings, 2 replies; 46+ messages in thread
From: Cornelia Huck @ 2018-04-25  7:48 UTC (permalink / raw)
  To: Markus Armbruster
  Cc: Laszlo Ersek, Palmer Dabbelt, Sagar Karandikar,
	Peter Crosthwaite, Bastian Koppelmann, Viktor Mihajlovski,
	Riku Voipio, qemu-stable, qemu-devel, Michael Clark,
	Luiz Capitulino, Paolo Bonzini, Richard Henderson,
	Laurent Vivier

On Wed, 25 Apr 2018 08:44:15 +0200
Markus Armbruster <armbru@redhat.com> wrote:

> Laszlo Ersek <lersek@redhat.com> writes:
> 
> > Commit 25fa194b7b11 added the @riscv enum constant to @CpuInfoArch (used
> > in both @CpuInfo and @CpuInfoFast -- the return types of the @query-cpus
> > and @query-cpus-fast commands, respectively), and assigned, in both return
> > structures, the @CpuInfoRISCV sub-structure to the new enum value.
> >
> > However, qmp_query_cpus_fast() would not populate either the @arch field
> > or the @CpuInfoRISCV sub-structure, when TARGET_RISCV was defined; only
> > qmp_query_cpus() would.
> >
> > In theory, there are two ways to fix this:
> >
> > (a) Fill in both the @arch field and the @CpuInfoRISCV sub-structure in
> >     qmp_query_cpus_fast(), by copying the logic from qmp_query_cpus().
> >
> > (b) Assign @CpuInfoOther to the @riscv enum constant in @CpuInfoFast, and
> >     populate only the @arch field in qmp_query_cpus_fast().
> >
> > Approach (b) seems more robust, because:
> >
> > - clearly there has never been an attempt to get actual RISV CPU state
> >   from qmp_query_cpus_fast(), so its lack of RISCV support is not actually
> >   a problem,
> >
> > - getting CPU state without interrupting KVM looks like an exceptional
> >   thing to do (only S390X does it currently).
> >
> > Cc: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
> > Cc: Eric Blake <eblake@redhat.com>
> > Cc: Laurent Vivier <laurent@vivier.eu>
> > Cc: Markus Armbruster <armbru@redhat.com>
> > Cc: Michael Clark <mjc@sifive.com>
> > Cc: Palmer Dabbelt <palmer@sifive.com>
> > Cc: Paolo Bonzini <pbonzini@redhat.com>
> > Cc: Peter Crosthwaite <crosthwaite.peter@gmail.com>
> > Cc: Richard Henderson <rth@twiddle.net>
> > Cc: Riku Voipio <riku.voipio@iki.fi>
> > Cc: Sagar Karandikar <sagark@eecs.berkeley.edu>
> > Cc: qemu-stable@nongnu.org
> > Fixes: 25fa194b7b11901561532e435beb83d046899f7a
> > Signed-off-by: Laszlo Ersek <lersek@redhat.com>
> > ---
> >
> > Notes:
> >     PATCHv1:
> >     
> >     - new patch
> >
> >  qapi/misc.json | 2 +-
> >  cpus.c         | 2 ++
> >  2 files changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/qapi/misc.json b/qapi/misc.json
> > index 5636f4a14997..104d013adba6 100644
> > --- a/qapi/misc.json
> > +++ b/qapi/misc.json
> > @@ -565,23 +565,23 @@
> >  { 'union': 'CpuInfoFast',
> >    'base': {'cpu-index': 'int', 'qom-path': 'str',
> >             'thread-id': 'int', '*props': 'CpuInstanceProperties',
> >             'arch': 'CpuInfoArch' },
> >    'discriminator': 'arch',
> >    'data': { 'x86': 'CpuInfoOther',
> >              'sparc': 'CpuInfoOther',
> >              'ppc': 'CpuInfoOther',
> >              'mips': 'CpuInfoOther',
> >              'tricore': 'CpuInfoOther',
> >              's390': 'CpuInfoS390',
> > -            'riscv': 'CpuInfoRISCV',
> > +            'riscv': 'CpuInfoOther',
> >              'other': 'CpuInfoOther' } }  
> 
> Why do CpuInfoFast's variants match CpuInfo's for s390, but not the
> others?  Your commit message has an educated guess: "looks like an
> exceptional thing to do (only S390X does it currently)".  But why guess
> when we can ask authors of commit ce74ee3dea6?  Luiz and Victor, please
> advise.

I'm neither Luiz nor Viktor, but Laszlo's educated guess is correct. See
https://www.redhat.com/archives/libvir-list/2018-February/msg00121.html
for some background. So yes, s390x is exceptional in that it has state
in QEMU that is actually interesting for upper layers and can be
retrieved without performance penalty.

Might make sense to refer to the above.

> 
> >  ##
> >  # @query-cpus-fast:
> >  #
> >  # Returns information about all virtual CPUs. This command does not
> >  # incur a performance penalty and should be used in production
> >  # instead of query-cpus.
> >  #
> >  # Returns: list of @CpuInfoFast
> >  #
> > diff --git a/cpus.c b/cpus.c
> > index 1a9a2edee1f2..60563a6d54ec 100644
> > --- a/cpus.c
> > +++ b/cpus.c
> > @@ -2225,22 +2225,24 @@ CpuInfoFastList *qmp_query_cpus_fast(Error **errp)
> >  #elif defined(TARGET_SPARC)
> >          info->value->arch = CPU_INFO_ARCH_SPARC;
> >  #elif defined(TARGET_MIPS)
> >          info->value->arch = CPU_INFO_ARCH_MIPS;
> >  #elif defined(TARGET_TRICORE)
> >          info->value->arch = CPU_INFO_ARCH_TRICORE;
> >  #elif defined(TARGET_S390X)
> >          s390_cpu = S390_CPU(cpu);
> >          env = &s390_cpu->env;
> >          info->value->arch = CPU_INFO_ARCH_S390;
> >          info->value->u.s390.cpu_state = env->cpu_state;
> > +#elif defined(TARGET_RISCV)
> > +        info->value->arch = CPU_INFO_ARCH_RISCV;
> >  #else
> >          info->value->arch = CPU_INFO_ARCH_OTHER;
> >  #endif
> >          if (!cur_item) {
> >              head = cur_item = info;
> >          } else {
> >              cur_item->next = info;
> >              cur_item = info;
> >          }
> >      }  
> 

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [Qemu-devel] [PATCH 0/6] qapi: introduce the SysEmuTarget enumeration
  2018-04-24 22:03 ` [Qemu-devel] [PATCH 0/6] qapi: introduce the SysEmuTarget enumeration no-reply
@ 2018-04-25 12:26   ` Laszlo Ersek
  2018-04-25 14:37     ` Eric Blake
  0 siblings, 1 reply; 46+ messages in thread
From: Laszlo Ersek @ 2018-04-25 12:26 UTC (permalink / raw)
  To: qemu-devel
  Cc: famz, riku.voipio, crosthwaite.peter, sagark, kchamart, kbastian,
	palmer, laurent, armbru, mjc, kraxel, pbonzini, thuth, dgibson,
	rth

On 04/25/18 00:03, no-reply@patchew.org wrote:
> Hi,
> 
> This series failed docker-mingw@fedora build test. Please find the testing commands and
> their output below. If you have Docker installed, you can probably reproduce it
> locally.

[snip]

> qapi/qapi-types-misc.h:654:20: error: expected identifier or '(' before numeric constant
>          CpuInfoX86 i386;
>                     ^
> qapi/qapi-types-misc.h:749:22: error: expected identifier or '(' before numeric constant
>          CpuInfoOther i386;
>                       ^
> make: *** [/tmp/qemu-test/src/rules.mak:66: qapi/qapi-types-misc.o] Error 1
> make: *** Waiting for unfinished jobs....
> qapi/qapi-types-misc.h:654:20: error: expected identifier or '(' before numeric constant
>          CpuInfoX86 i386;
>                     ^
> qapi/qapi-types-misc.h:749:22: error: expected identifier or '(' before numeric constant
>          CpuInfoOther i386;
>                       ^
> make: *** [/tmp/qemu-test/src/rules.mak:66: qapi/qapi-types.o] Error 1
> qapi/qapi-types-misc.h:654:20: error: expected identifier or '(' before numeric constant
>          CpuInfoX86 i386;
>                     ^
> qapi/qapi-types-misc.h:749:22: error: expected identifier or '(' before numeric constant
>          CpuInfoOther i386;
>                       ^

Wow, is "i386" a macro on mingw, one that expands to a number? That is
incredibly st...range.

I do need this enum constant to be "i386" in the QAPI schema, because
that's what TARGET_NAME will map to.

Can I let the generator use the "q_" prefix here somehow?

Hmm, I think that trick is already happening for "sparc":

    641 struct CpuInfo {
    642     /* Members inherited from CpuInfoBase: */
    643     char *qom_path;
    644     int64_t thread_id;
    645     bool has_props;
    646     CpuInstanceProperties *props;
    647     CpuInfoArch arch;
    648     int64_t CPU;
    649     bool current;
    650     bool halted;
    651     SysEmuTarget target;
    652     /* Own members: */
    653     union { /* union tag is @target */
    654         CpuInfoX86 i386;
    655         CpuInfoX86 x86_64;
    656         CpuInfoSPARC q_sparc;    <----------------- here

Alright, I'll add "i386" to "polluted_words" in "scripts/qapi/common.py".

Sigh, what else is there already... I see Eric's commit 86ae191163d4 :(

Laszlo

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [Qemu-devel] [PATCH 1/6] qapi: fill in CpuInfoFast.arch in query-cpus-fast
  2018-04-25  6:39   ` Markus Armbruster
@ 2018-04-25 12:30     ` Laszlo Ersek
  0 siblings, 0 replies; 46+ messages in thread
From: Laszlo Ersek @ 2018-04-25 12:30 UTC (permalink / raw)
  To: Markus Armbruster
  Cc: qemu-devel, Peter Crosthwaite, qemu-stable, Paolo Bonzini,
	Richard Henderson

On 04/25/18 08:39, Markus Armbruster wrote:
> Laszlo Ersek <lersek@redhat.com> writes:
> 
>> Commit ca230ff33f89 added added the @arch field to @CpuInfoFast, but it
>> failed to set the new field in qmp_query_cpus_fast(), when TARGET_S390X
>> was not defined. The updated @query-cpus-fast example in
>> "qapi-schema.json" showed "arch":"x86" only because qmp_query_cpus_fast()
>> calls g_malloc0() to allocate CpuInfoFast, and the CPU_INFO_ARCH_X86 enum
>> constant is generated with value 0.
>>
>> All @arch values other than @s390 implied the @CpuInfoOther sub-struct for
>> @CpuInfoFast -- at the time of writing the patch --, thus no fields other
>> than @arch needed to be set when TARGET_S390X was not defined. Set @arch
>> now, by copying the corresponding assignments from qmp_query_cpus().
> 
> Now I'm confused.
> 
> In the schema, @arch "riscv" implies CpuInfoRISCV:
> 
>     { 'union': 'CpuInfoFast',
>       'base': {'cpu-index': 'int', 'qom-path': 'str',
>                'thread-id': 'int', '*props': 'CpuInstanceProperties',
>                'arch': 'CpuInfoArch' },
>       'discriminator': 'arch',
>       'data': { 'x86': 'CpuInfoOther',
>                 'sparc': 'CpuInfoOther',
>                 'ppc': 'CpuInfoOther',
>                 'mips': 'CpuInfoOther',
>                 'tricore': 'CpuInfoOther',
>                 's390': 'CpuInfoS390',
>                 'riscv': 'CpuInfoRISCV',
>                 'other': 'CpuInfoOther' } }
> 
> In qmp_query_cpus_fast(), it can't imply anything, because can't occur.
> That's a bug, and this patch fixes it.  Except it sets @arch to "other"
> instead of "riscv" when defined(TARGET_RISCV).  Why?  Oh, I see, that
> gets fixed in the next patch.  Please explain that in your commit
> message, or squash the two patches.  The latter feels simpler, so that's
> what I'd do.

I figured I'd keep one "Fixes:" tag per patch, but I see this separation
confused at least three reviewers, so I'll squash #1 and #2, and will
list two "Fixes:" tags.

Thanks!
Laszlo

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [Qemu-devel] [PATCH 1/6] qapi: fill in CpuInfoFast.arch in query-cpus-fast
  2018-04-24 22:30   ` Eric Blake
@ 2018-04-25 12:30     ` Laszlo Ersek
  0 siblings, 0 replies; 46+ messages in thread
From: Laszlo Ersek @ 2018-04-25 12:30 UTC (permalink / raw)
  To: Eric Blake, qemu-devel
  Cc: Markus Armbruster, Paolo Bonzini, Peter Crosthwaite,
	Richard Henderson, qemu-stable

On 04/25/18 00:30, Eric Blake wrote:
> On 04/24/2018 04:45 PM, Laszlo Ersek wrote:
>> Commit ca230ff33f89 added added the @arch field to @CpuInfoFast, but it
> 
> s/added added/added/

The more I edit commit messages, the more I mess them up :)

Thanks!
Laszlo

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [Qemu-devel] [PATCH 2/6] qapi: handle the riscv CpuInfoArch in query-cpus-fast
  2018-04-24 22:32   ` Eric Blake
@ 2018-04-25 12:32     ` Laszlo Ersek
  0 siblings, 0 replies; 46+ messages in thread
From: Laszlo Ersek @ 2018-04-25 12:32 UTC (permalink / raw)
  To: Eric Blake, qemu-devel
  Cc: Bastian Koppelmann, Laurent Vivier, Markus Armbruster,
	Michael Clark, Palmer Dabbelt, Paolo Bonzini, Peter Crosthwaite,
	Richard Henderson, Riku Voipio, Sagar Karandikar, qemu-stable

On 04/25/18 00:32, Eric Blake wrote:
> On 04/24/2018 04:45 PM, Laszlo Ersek wrote:
>> Commit 25fa194b7b11 added the @riscv enum constant to @CpuInfoArch (used
>> in both @CpuInfo and @CpuInfoFast -- the return types of the @query-cpus
>> and @query-cpus-fast commands, respectively), and assigned, in both return
>> structures, the @CpuInfoRISCV sub-structure to the new enum value.
>>
>> However, qmp_query_cpus_fast() would not populate either the @arch field
>> or the @CpuInfoRISCV sub-structure, when TARGET_RISCV was defined; only
>> qmp_query_cpus() would.
>>
>> In theory, there are two ways to fix this:
>>
>> (a) Fill in both the @arch field and the @CpuInfoRISCV sub-structure in
>>     qmp_query_cpus_fast(), by copying the logic from qmp_query_cpus().
>>
>> (b) Assign @CpuInfoOther to the @riscv enum constant in @CpuInfoFast, and
>>     populate only the @arch field in qmp_query_cpus_fast().
>>
>> Approach (b) seems more robust, because:
>>
>> - clearly there has never been an attempt to get actual RISV CPU state
>>   from qmp_query_cpus_fast(), so its lack of RISCV support is not actually
>>   a problem,
>>
>> - getting CPU state without interrupting KVM looks like an exceptional
>>   thing to do (only S390X does it currently).
>>
> ...
>> Cc: qemu-stable@nongnu.org
>> Fixes: 25fa194b7b11901561532e435beb83d046899f7a
>> Signed-off-by: Laszlo Ersek <lersek@redhat.com>
>> ---
>>
> 
> Reviewed-by: Eric Blake <eblake@redhat.com>
> 

Thanks Eric, I'll fuse your R-b's from #1 and #2 into one R-b for the
squashed variant. Hope that's OK. (Please do check the upcoming commit
message for more garblage.)

Thanks!
Laszlo

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [Qemu-devel] [PATCH 2/6] qapi: handle the riscv CpuInfoArch in query-cpus-fast
  2018-04-25  7:48     ` Cornelia Huck
@ 2018-04-25 12:38       ` Viktor VM Mihajlovski
  2018-04-25 12:43       ` Laszlo Ersek
  1 sibling, 0 replies; 46+ messages in thread
From: Viktor VM Mihajlovski @ 2018-04-25 12:38 UTC (permalink / raw)
  To: Cornelia Huck, Markus Armbruster
  Cc: Laszlo Ersek, Palmer Dabbelt, Sagar Karandikar,
	Peter Crosthwaite, Bastian Koppelmann, Riku Voipio, qemu-stable,
	qemu-devel, Michael Clark, Luiz Capitulino, Paolo Bonzini,
	Richard Henderson, Laurent Vivier

On 25.04.2018 09:48, Cornelia Huck wrote:
> On Wed, 25 Apr 2018 08:44:15 +0200
> Markus Armbruster <armbru@redhat.com> wrote:
> 
>> Laszlo Ersek <lersek@redhat.com> writes:
>>
>>> Commit 25fa194b7b11 added the @riscv enum constant to @CpuInfoArch (used
>>> in both @CpuInfo and @CpuInfoFast -- the return types of the @query-cpus
>>> and @query-cpus-fast commands, respectively), and assigned, in both return
>>> structures, the @CpuInfoRISCV sub-structure to the new enum value.
>>>
>>> However, qmp_query_cpus_fast() would not populate either the @arch field
>>> or the @CpuInfoRISCV sub-structure, when TARGET_RISCV was defined; only
>>> qmp_query_cpus() would.
>>>
>>> In theory, there are two ways to fix this:
>>>
>>> (a) Fill in both the @arch field and the @CpuInfoRISCV sub-structure in
>>>     qmp_query_cpus_fast(), by copying the logic from qmp_query_cpus().
>>>
>>> (b) Assign @CpuInfoOther to the @riscv enum constant in @CpuInfoFast, and
>>>     populate only the @arch field in qmp_query_cpus_fast().
>>>
>>> Approach (b) seems more robust, because:
>>>
>>> - clearly there has never been an attempt to get actual RISV CPU state
>>>   from qmp_query_cpus_fast(), so its lack of RISCV support is not actually
>>>   a problem,
>>>
>>> - getting CPU state without interrupting KVM looks like an exceptional
>>>   thing to do (only S390X does it currently).
>>>
>>> Cc: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
>>> Cc: Eric Blake <eblake@redhat.com>
>>> Cc: Laurent Vivier <laurent@vivier.eu>
>>> Cc: Markus Armbruster <armbru@redhat.com>
>>> Cc: Michael Clark <mjc@sifive.com>
>>> Cc: Palmer Dabbelt <palmer@sifive.com>
>>> Cc: Paolo Bonzini <pbonzini@redhat.com>
>>> Cc: Peter Crosthwaite <crosthwaite.peter@gmail.com>
>>> Cc: Richard Henderson <rth@twiddle.net>
>>> Cc: Riku Voipio <riku.voipio@iki.fi>
>>> Cc: Sagar Karandikar <sagark@eecs.berkeley.edu>
>>> Cc: qemu-stable@nongnu.org
>>> Fixes: 25fa194b7b11901561532e435beb83d046899f7a
>>> Signed-off-by: Laszlo Ersek <lersek@redhat.com>
>>> ---
>>>
>>> Notes:
>>>     PATCHv1:
>>>     
>>>     - new patch
>>>
>>>  qapi/misc.json | 2 +-
>>>  cpus.c         | 2 ++
>>>  2 files changed, 3 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/qapi/misc.json b/qapi/misc.json
>>> index 5636f4a14997..104d013adba6 100644
>>> --- a/qapi/misc.json
>>> +++ b/qapi/misc.json
>>> @@ -565,23 +565,23 @@
>>>  { 'union': 'CpuInfoFast',
>>>    'base': {'cpu-index': 'int', 'qom-path': 'str',
>>>             'thread-id': 'int', '*props': 'CpuInstanceProperties',
>>>             'arch': 'CpuInfoArch' },
>>>    'discriminator': 'arch',
>>>    'data': { 'x86': 'CpuInfoOther',
>>>              'sparc': 'CpuInfoOther',
>>>              'ppc': 'CpuInfoOther',
>>>              'mips': 'CpuInfoOther',
>>>              'tricore': 'CpuInfoOther',
>>>              's390': 'CpuInfoS390',
>>> -            'riscv': 'CpuInfoRISCV',
>>> +            'riscv': 'CpuInfoOther',
>>>              'other': 'CpuInfoOther' } }  
>>
>> Why do CpuInfoFast's variants match CpuInfo's for s390, but not the
>> others?  Your commit message has an educated guess: "looks like an
>> exceptional thing to do (only S390X does it currently)".  But why guess
>> when we can ask authors of commit ce74ee3dea6?  Luiz and Victor, please
>> advise.
> 
> I'm neither Luiz nor Viktor, but Laszlo's educated guess is correct. See
> https://www.redhat.com/archives/libvir-list/2018-February/msg00121.html
> for some background. So yes, s390x is exceptional in that it has state
> in QEMU that is actually interesting for upper layers and can be
> retrieved without performance penalty.
Right, the only 'upper layer' using this I'm aware of is libvirt and the
arch evaluation is only done for s390. Not pretty, but no harm done so far.
> 
> Might make sense to refer to the above.
> 
[...]

-- 
Regards,
  Viktor Mihajlovski

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [Qemu-devel] [PATCH 2/6] qapi: handle the riscv CpuInfoArch in query-cpus-fast
  2018-04-25  7:48     ` Cornelia Huck
  2018-04-25 12:38       ` Viktor VM Mihajlovski
@ 2018-04-25 12:43       ` Laszlo Ersek
  1 sibling, 0 replies; 46+ messages in thread
From: Laszlo Ersek @ 2018-04-25 12:43 UTC (permalink / raw)
  To: Cornelia Huck, Markus Armbruster
  Cc: Palmer Dabbelt, Sagar Karandikar, Peter Crosthwaite,
	Bastian Koppelmann, Viktor Mihajlovski, Riku Voipio, qemu-stable,
	qemu-devel, Michael Clark, Luiz Capitulino, Paolo Bonzini,
	Richard Henderson, Laurent Vivier

On 04/25/18 09:48, Cornelia Huck wrote:
> On Wed, 25 Apr 2018 08:44:15 +0200
> Markus Armbruster <armbru@redhat.com> wrote:
> 
>> Laszlo Ersek <lersek@redhat.com> writes:
>>
>>> Commit 25fa194b7b11 added the @riscv enum constant to @CpuInfoArch (used
>>> in both @CpuInfo and @CpuInfoFast -- the return types of the @query-cpus
>>> and @query-cpus-fast commands, respectively), and assigned, in both return
>>> structures, the @CpuInfoRISCV sub-structure to the new enum value.
>>>
>>> However, qmp_query_cpus_fast() would not populate either the @arch field
>>> or the @CpuInfoRISCV sub-structure, when TARGET_RISCV was defined; only
>>> qmp_query_cpus() would.
>>>
>>> In theory, there are two ways to fix this:
>>>
>>> (a) Fill in both the @arch field and the @CpuInfoRISCV sub-structure in
>>>     qmp_query_cpus_fast(), by copying the logic from qmp_query_cpus().
>>>
>>> (b) Assign @CpuInfoOther to the @riscv enum constant in @CpuInfoFast, and
>>>     populate only the @arch field in qmp_query_cpus_fast().
>>>
>>> Approach (b) seems more robust, because:
>>>
>>> - clearly there has never been an attempt to get actual RISV CPU state
>>>   from qmp_query_cpus_fast(), so its lack of RISCV support is not actually
>>>   a problem,
>>>
>>> - getting CPU state without interrupting KVM looks like an exceptional
>>>   thing to do (only S390X does it currently).
>>>
>>> Cc: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
>>> Cc: Eric Blake <eblake@redhat.com>
>>> Cc: Laurent Vivier <laurent@vivier.eu>
>>> Cc: Markus Armbruster <armbru@redhat.com>
>>> Cc: Michael Clark <mjc@sifive.com>
>>> Cc: Palmer Dabbelt <palmer@sifive.com>
>>> Cc: Paolo Bonzini <pbonzini@redhat.com>
>>> Cc: Peter Crosthwaite <crosthwaite.peter@gmail.com>
>>> Cc: Richard Henderson <rth@twiddle.net>
>>> Cc: Riku Voipio <riku.voipio@iki.fi>
>>> Cc: Sagar Karandikar <sagark@eecs.berkeley.edu>
>>> Cc: qemu-stable@nongnu.org
>>> Fixes: 25fa194b7b11901561532e435beb83d046899f7a
>>> Signed-off-by: Laszlo Ersek <lersek@redhat.com>
>>> ---
>>>
>>> Notes:
>>>     PATCHv1:
>>>     
>>>     - new patch
>>>
>>>  qapi/misc.json | 2 +-
>>>  cpus.c         | 2 ++
>>>  2 files changed, 3 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/qapi/misc.json b/qapi/misc.json
>>> index 5636f4a14997..104d013adba6 100644
>>> --- a/qapi/misc.json
>>> +++ b/qapi/misc.json
>>> @@ -565,23 +565,23 @@
>>>  { 'union': 'CpuInfoFast',
>>>    'base': {'cpu-index': 'int', 'qom-path': 'str',
>>>             'thread-id': 'int', '*props': 'CpuInstanceProperties',
>>>             'arch': 'CpuInfoArch' },
>>>    'discriminator': 'arch',
>>>    'data': { 'x86': 'CpuInfoOther',
>>>              'sparc': 'CpuInfoOther',
>>>              'ppc': 'CpuInfoOther',
>>>              'mips': 'CpuInfoOther',
>>>              'tricore': 'CpuInfoOther',
>>>              's390': 'CpuInfoS390',
>>> -            'riscv': 'CpuInfoRISCV',
>>> +            'riscv': 'CpuInfoOther',
>>>              'other': 'CpuInfoOther' } }  
>>
>> Why do CpuInfoFast's variants match CpuInfo's for s390, but not the
>> others?  Your commit message has an educated guess: "looks like an
>> exceptional thing to do (only S390X does it currently)".  But why guess
>> when we can ask authors of commit ce74ee3dea6?  Luiz and Victor, please
>> advise.
> 
> I'm neither Luiz nor Viktor, but Laszlo's educated guess is correct. See
> https://www.redhat.com/archives/libvir-list/2018-February/msg00121.html
> for some background. So yes, s390x is exceptional in that it has state
> in QEMU that is actually interesting for upper layers and can be
> retrieved without performance penalty.
> 
> Might make sense to refer to the above.

I'll plagiarize the living daylights [1] out of Cornelia's summary, and
insert the mailing list archive link too. (Viktor's detailed explanation
is likely best not corrupted by yours truly...)

[1] this expression itself was stolen :)

Thanks!
Laszlo

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [Qemu-devel] [PATCH 3/6] qapi: add SysEmuTarget to "common.json"
  2018-04-24 23:11   ` Eric Blake
@ 2018-04-25 12:54     ` Daniel P. Berrangé
  2018-04-25 19:05       ` Laszlo Ersek
  0 siblings, 1 reply; 46+ messages in thread
From: Daniel P. Berrangé @ 2018-04-25 12:54 UTC (permalink / raw)
  To: Eric Blake
  Cc: Laszlo Ersek, qemu-devel, David Gibson, Gerd Hoffmann,
	Kashyap Chamarthy, Markus Armbruster, Paolo Bonzini, Thomas Huth

On Tue, Apr 24, 2018 at 06:11:05PM -0500, Eric Blake wrote:
> On 04/24/2018 04:45 PM, Laszlo Ersek wrote:
> > We'll soon need an enumeration type that lists all the softmmu targets
> > that QEMU (the project) supports. Introduce @SysEmuTarget to
> > "common.json".
> > 
> > Cc: "Daniel P. Berrange" <berrange@redhat.com>
> > Cc: David Gibson <dgibson@redhat.com>
> > Cc: Eric Blake <eblake@redhat.com>
> > Cc: Gerd Hoffmann <kraxel@redhat.com>
> > Cc: Kashyap Chamarthy <kchamart@redhat.com>
> > Cc: Markus Armbruster <armbru@redhat.com>
> > Cc: Paolo Bonzini <pbonzini@redhat.com>
> > Cc: Thomas Huth <thuth@redhat.com>
> > Signed-off-by: Laszlo Ersek <lersek@redhat.com>
> > Reviewed-by: Markus Armbruster <armbru@redhat.com>
> > Reviewed-by: Kashyap Chamarthy <kchamart@redhat.com>
> > ---
> > 
> 
> > +##
> > +{ 'enum' : 'SysEmuTarget',
> > +  'data' : [ 'aarch64', 'alpha', 'arm', 'cris', 'hppa', 'i386', 'lm32',
> > +             'm68k', 'microblaze', 'microblazeel', 'mips', 'mips64',
> > +             'mips64el', 'mipsel', 'moxie', 'nios2', 'or1k', 'ppc',
> > +             'ppc64', 'ppcemb', 'riscv32', 'riscv64', 's390x', 'sh4',
> > +             'sh4eb', 'sparc', 'sparc64', 'tricore', 'unicore32',
> > +             'x86_64', 'xtensa', 'xtensaeb' ] }
> 
> x86_64 doesn't match our typical conventions of preferring '-' over '_';
> also, wikipedia mentions both spellings but under the page name
> 'x86-64'.  Is it worth switching that enum constant?
> 
> https://en.wikipedia.org/wiki/X86-64

I would not want that - SysEmuTarget is supposed to be correlated with
the qemu-system-$TARGET  binary names and we use qemu-system-x86_64
there.


Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [Qemu-devel] [PATCH 4/6] qapi: change the type of TargetInfo.arch from string to enum SysEmuTarget
  2018-04-25  6:48   ` Markus Armbruster
@ 2018-04-25 12:58     ` Laszlo Ersek
  0 siblings, 0 replies; 46+ messages in thread
From: Laszlo Ersek @ 2018-04-25 12:58 UTC (permalink / raw)
  To: Markus Armbruster
  Cc: qemu-devel, Thomas Huth, Kashyap Chamarthy, Gerd Hoffmann,
	Paolo Bonzini, David Gibson

On 04/25/18 08:48, Markus Armbruster wrote:
> Laszlo Ersek <lersek@redhat.com> writes:
> 
>> Now that we have @SysEmuTarget, it makes sense to restict
>> @TargetInfo.@arch to valid sysemu targets at the schema level.
>>
>> Cc: "Daniel P. Berrange" <berrange@redhat.com>
>> Cc: David Gibson <dgibson@redhat.com>
>> Cc: Eric Blake <eblake@redhat.com>
>> Cc: Gerd Hoffmann <kraxel@redhat.com>
>> Cc: Kashyap Chamarthy <kchamart@redhat.com>
>> Cc: Markus Armbruster <armbru@redhat.com>
>> Cc: Paolo Bonzini <pbonzini@redhat.com>
>> Cc: Thomas Huth <thuth@redhat.com>
>> Signed-off-by: Laszlo Ersek <lersek@redhat.com>
>> ---
>>
>> Notes:
>>     PATCHv1:
>>     
>>     - qmp_query_target(): pass (-1) as fallback value [Markus]
>>     - qmp_query_target(): catch lookup error with error_abort [Markus]
>>     
>>     RFCv3:
>>     
>>     - The patch is new in this version. [Markus]
>>
>>  qapi/misc.json |  6 ++++--
>>  arch_init.c    | 10 +++++++++-
>>  2 files changed, 13 insertions(+), 3 deletions(-)
>>
>> diff --git a/qapi/misc.json b/qapi/misc.json
>> index 104d013adba6..460866cf542f 100644
>> --- a/qapi/misc.json
>> +++ b/qapi/misc.json
>> @@ -1,18 +1,20 @@
>>  # -*- Mode: Python -*-
>>  #
>>  
>>  ##
>>  # = Miscellanea
>>  ##
>>  
>> +{ 'include': 'common.json' }
>> +
>>  ##
>>  # @qmp_capabilities:
>>  #
>>  # Enable QMP capabilities.
>>  #
>>  # Arguments:
>>  #
>>  # @enable:   An optional list of QMPCapability values to enable.  The
>>  #            client must not enable any capability that is not
>>  #            mentioned in the QMP greeting message.  If the field is not
>>  #            provided, it means no QMP capabilities will be enabled.
>> @@ -2441,28 +2443,28 @@
>>  #      ]
>>  #    }
>>  #
>>  ##
>>  { 'command': 'query-fdsets', 'returns': ['FdsetInfo'] }
>>  
>>  ##
>>  # @TargetInfo:
>>  #
>>  # Information describing the QEMU target.
>>  #
>> -# @arch: the target architecture (eg "x86_64", "i386", etc)
>> +# @arch: the target architecture
>>  #
>>  # Since: 1.2.0
>>  ##
>>  { 'struct': 'TargetInfo',
>> -  'data': { 'arch': 'str' } }
>> +  'data': { 'arch': 'SysEmuTarget' } }
>>  
>>  ##
>>  # @query-target:
>>  #
>>  # Return information about the target for this QEMU
>>  #
>>  # Returns: TargetInfo
>>  #
>>  # Since: 1.2.0
>>  ##
>>  { 'command': 'query-target', 'returns': 'TargetInfo' }
>> diff --git a/arch_init.c b/arch_init.c
>> index 6ee07478bd11..ee3a57019000 100644
>> --- a/arch_init.c
>> +++ b/arch_init.c
>> @@ -21,22 +21,23 @@
>>   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
>>   * THE SOFTWARE.
>>   */
>>  #include "qemu/osdep.h"
>>  #include "qemu-common.h"
>>  #include "cpu.h"
>>  #include "sysemu/sysemu.h"
>>  #include "sysemu/arch_init.h"
>>  #include "hw/pci/pci.h"
>>  #include "hw/audio/soundhw.h"
>>  #include "qapi/qapi-commands-misc.h"
>> +#include "qapi/error.h"
>>  #include "qemu/config-file.h"
>>  #include "qemu/error-report.h"
>>  #include "hw/acpi/acpi.h"
>>  #include "qemu/help_option.h"
>>  
>>  #ifdef TARGET_SPARC
>>  int graphic_width = 1024;
>>  int graphic_height = 768;
>>  int graphic_depth = 8;
>>  #else
>>  int graphic_width = 800;
>> @@ -104,15 +105,22 @@ int xen_available(void)
>>      return 1;
>>  #else
>>      return 0;
>>  #endif
>>  }
>>  
>>  
>>  TargetInfo *qmp_query_target(Error **errp)
>>  {
>>      TargetInfo *info = g_malloc0(sizeof(*info));
>>  
>> -    info->arch = g_strdup(TARGET_NAME);
>> +    /*
>> +     * The fallback enum value is irrelevant here (TARGET_NAME is a
>> +     * macro and can never be NULL), so simply pass (-1). Also, the
>> +     * lookup should never fail -- if it fails, then @SysEmuTarget needs
>> +     * extending. Catch that with "error_abort".
>> +     */
>> +    info->arch = qapi_enum_parse(&SysEmuTarget_lookup, TARGET_NAME, -1,
>> +                                 &error_abort);
>>  
>>      return info;
>>  }
> 
> Not sure the comment is carrying its weight; for me, the use of -1 and
> &error_abort feels obvious enough.  But my feelings are subjective and
> could be off.

No, you are right, I'll drop the comment. I had to explain the arguments
to myself at first, but in retrospect they're not complicated enough to
merit a comment.

> Reviewed-by: Markus Armbruster <armbru@redhat.com>
> 

Thanks!
Laszlo

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [Qemu-devel] [PATCH 5/6] qapi: extract CpuInfoCommon to mitigate schema duplication
  2018-04-25  7:06   ` Markus Armbruster
@ 2018-04-25 13:20     ` Laszlo Ersek
  2018-04-25 17:12       ` Markus Armbruster
  2018-04-25 19:12       ` Eric Blake
  0 siblings, 2 replies; 46+ messages in thread
From: Laszlo Ersek @ 2018-04-25 13:20 UTC (permalink / raw)
  To: Markus Armbruster; +Cc: qemu-devel

On 04/25/18 09:06, Markus Armbruster wrote:
> Laszlo Ersek <lersek@redhat.com> writes:
> 
>> @CpuInfo and @CpuInfoFast duplicate the following four fields: @qom-path,
>> @thread-id, @props and @arch. From these, extract the first three to a
>> common structure called @CpuInfoCommon. (More on @arch later.)
>>
>> Introduce two new mid-layer structures, @CpuInfoBase and @CpuInfoFastBase,
>> to soak up the union base struct fields on top of @CpuInfoCommon that are
>> specific to @query-cpus and @query-cpus-fast, respectively.

[[

>> This is
>> necessary because the base struct spec in union definitions does not let
>> us mix named fields with a recursive base struct. (In other words, we
>> couldn't directly use @CpuInfoCommon *plus* some other fields within
>> @CpuInfo and @CpuInfoFast as base struct).

]]

> 
> Yes, you can either specify a base type or inline common members.  If
> "union's common members = base type plus additional inline members"
> turns out to be desirable in more places, we can try to add the feature.
> I'm not asking *you* to find out, let alone try :)

[[

>> @arch cannot be hoisted higher than to @CpuInfoBase and @CpuInfoFastBase
>> because the union descriminator is only accepted from a direct base
>> struct, not from an indirect one.

]]

> That's a bit of a blemish.  Again, I'm not asking you to do anything
> about it.

If these characteristics of the generator are operating knowledge for
QAPI developers, I can trim the commit message -- those traits don't
bother me at all, I just felt that I needed to justify the code.

IOW, should I drop:
- the sentences marked with [[ ]] above,
- and/or the "Notes:" on @arch in the schema itself (which are updated
  to @target, in the next patch)
?

[snip]

>> @@ -512,70 +541,77 @@
>>  #
>>  # Since: 0.14.0
>>  #
>>  # Example:
>>  #
>>  # -> { "execute": "query-cpus" }
>>  # <- { "return": [
>>  #          {
>>  #             "CPU":0,
>>  #             "current":true,
>>  #             "halted":false,
>> -#             "qom_path":"/machine/unattached/device[0]",
>> +#             "qom-path":"/machine/unattached/device[0]",
>>  #             "arch":"x86",
>>  #             "pc":3227107138,
>> -#             "thread_id":3134
>> +#             "thread-id":3134
>>  #          },
>>  #          {
>>  #             "CPU":1,
>>  #             "current":false,
>>  #             "halted":true,
>> -#             "qom_path":"/machine/unattached/device[2]",
>> +#             "qom-path":"/machine/unattached/device[2]",
>>  #             "arch":"x86",
>>  #             "pc":7108165,
>> -#             "thread_id":3135
>> +#             "thread-id":3135
>>  #          }
>>  #       ]
>>  #    }
> 
> Compatibility break, whoops!

But, at least, I updated the example! :)

> 
> CpuInfo and CpuInfoFast do share qom-path and thread-id *values*, but
> the keys differ in '_' vs. '-'.  Sad.
> 
> What now?  Is there enough common stuff left to justify the refactoring?

While working on the schema changes, I saw the '_' vs. '-' difference
immediately, but I thought these two characters were treated
equivalently by all QAPI clients.

Later I found (in the test suite) that this wasn't the case, so I
thought my memories must have applied to libvirtd only. (Because,
libvirt does map "_" to "-", right?) Anyway, I figured the best way to
ask was to post the patch like this :)


So, if I drop @qom-path and @thread-id from CpuInfoCommon, then only
@props remains subject to hoisting, in this patch. In the next patch,
@arch joins @props.

I believe the refactoring is still worth doing, because otherwise, after
the addition of @target, we'd end up with:

{ 'union' : 'CpuInfo',
  'base'  : { 'CPU'       : 'int',
              'current'   : 'bool',
              'halted'    : 'bool',
              'qom_path'  : 'str',
              'thread_id' : 'int',
              '*props'    : 'CpuInstanceProperties',
              'arch'      : 'CpuInfoArch',
              'target'    : 'SysEmuTarget' },
...

{ 'union' : 'CpuInfoFast',
  'base'  : { 'cpu-index' : 'int',
              'qom-path'  : 'str',
              'thread-id' : 'int',
              '*props'    : 'CpuInstanceProperties',
              'arch'      : 'CpuInfoArch',
              'target'    : 'SysEmuTarget' },
...

and people would ask themselves ever after, "are there some common
fields in there that we could extract ... hmmm, @props and @arch, okay,
maybe, maybe not, grey area". Let's do it now and save them the thinking.

[snip]

>> diff --git a/qapi/qapi-schema.json b/qapi/qapi-schema.json
>> index 25bce78352b8..5bfd2ef1dd3b 100644
>> --- a/qapi/qapi-schema.json
>> +++ b/qapi/qapi-schema.json
>> @@ -61,23 +61,23 @@
>>          'query-migrate-cache-size',
>>          'query-tpm-models',
>>          'query-tpm-types',
>>          'ringbuf-read' ],
>>      'name-case-whitelist': [
>>          'ACPISlotType',         # DIMM, visible through query-acpi-ospm-status
>>          'CpuInfoMIPS',          # PC, visible through query-cpu
>>          'CpuInfoTricore',       # PC, visible through query-cpu
>>          'QapiErrorClass',       # all members, visible through errors
>>          'UuidInfo',             # UUID, visible through query-uuid
>>          'X86CPURegister32',     # all members, visible indirectly through qom-get
>> -        'q_obj_CpuInfo-base'    # CPU, visible through query-cpu
>> +        'CpuInfoBase'           # CPU, visible through query-cpu
> 
> Let's update this to "visible through query-cpus, query-cpus-fast" while
> there.

Right, I noticed the typo in the preexistent comment too late (and I
didn't notice the "query-cpus-fast" omission at all).

Thanks!
Laszlo

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [Qemu-devel] [PATCH 6/6] qapi: discriminate CpuInfo[Fast] on SysEmuTarget, not CpuInfoArch
  2018-04-25  7:33   ` Markus Armbruster
@ 2018-04-25 13:47     ` Laszlo Ersek
  2018-04-26  6:26       ` Markus Armbruster
  0 siblings, 1 reply; 46+ messages in thread
From: Laszlo Ersek @ 2018-04-25 13:47 UTC (permalink / raw)
  To: Markus Armbruster
  Cc: qemu-devel, Paolo Bonzini, Richard Henderson, Peter Crosthwaite

On 04/25/18 09:33, Markus Armbruster wrote:
> Laszlo Ersek <lersek@redhat.com> writes:

[snip]

>> +static CpuInfoArch sysemu_target_to_cpuinfo_arch(SysEmuTarget target)
>> +{
>> +    /*
>> +     * The @SysEmuTarget -> @CpuInfoArch mapping below is based on the
>> +     * TARGET_ARCH -> TARGET_BASE_ARCH mapping in the "configure" script.
>> +     */
>> +    switch (target) {
>> +    case SYS_EMU_TARGET_I386:
>> +    case SYS_EMU_TARGET_X86_64:
>> +        return CPU_INFO_ARCH_X86;
>> +
>> +    case SYS_EMU_TARGET_PPC:
>> +    case SYS_EMU_TARGET_PPCEMB:
>> +    case SYS_EMU_TARGET_PPC64:
>> +        return CPU_INFO_ARCH_PPC;
>> +
>> +    case SYS_EMU_TARGET_SPARC:
>> +    case SYS_EMU_TARGET_SPARC64:
>> +        return CPU_INFO_ARCH_SPARC;
>> +
>> +    case SYS_EMU_TARGET_MIPS:
>> +    case SYS_EMU_TARGET_MIPSEL:
>> +    case SYS_EMU_TARGET_MIPS64:
>> +    case SYS_EMU_TARGET_MIPS64EL:
>> +        return CPU_INFO_ARCH_MIPS;
>> +
>> +    case SYS_EMU_TARGET_TRICORE:
>> +        return CPU_INFO_ARCH_TRICORE;
>> +
>> +    case SYS_EMU_TARGET_S390X:
>> +        return CPU_INFO_ARCH_S390;
>> +
>> +    case SYS_EMU_TARGET_RISCV32:
>> +    case SYS_EMU_TARGET_RISCV64:
>> +        return CPU_INFO_ARCH_RISCV;
>> +
>> +    default:
>> +        return CPU_INFO_ARCH_OTHER;
>> +    }
>> +}
> 
> Hmm.  Can we avoid duplicating configure's mapping here?  More on that
> below.
> 
>> +
>> +static void cpustate_to_cpuinfo_x86(CpuInfoX86 *info, const CPUState *cpu)
>> +{
>> +#ifdef TARGET_I386
>> +    X86CPU *x86_cpu = X86_CPU(cpu);
>> +    CPUX86State *env = &x86_cpu->env;
>> +
>> +    info->pc = env->eip + env->segs[R_CS].base;
>> +#else
>> +    abort();
>> +#endif
>> +}
>> +
>> +static void cpustate_to_cpuinfo_ppc(CpuInfoPPC *info, const CPUState *cpu)
>> +{
>> +#ifdef TARGET_PPC
>> +    PowerPCCPU *ppc_cpu = POWERPC_CPU(cpu);
>> +    CPUPPCState *env = &ppc_cpu->env;
>> +
>> +    info->nip = env->nip;
>> +#else
>> +    abort();
>> +#endif
>> +}
>> +
>> +static void cpustate_to_cpuinfo_sparc(CpuInfoSPARC *info, const CPUState *cpu)
>> +{
>> +#ifdef TARGET_SPARC
>> +    SPARCCPU *sparc_cpu = SPARC_CPU(cpu);
>> +    CPUSPARCState *env = &sparc_cpu->env;
>> +
>> +    info->pc = env->pc;
>> +    info->npc = env->npc;
>> +#else
>> +    abort();
>> +#endif
>> +}
>> +
>> +static void cpustate_to_cpuinfo_mips(CpuInfoMIPS *info, const CPUState *cpu)
>> +{
>> +#ifdef TARGET_MIPS
>> +    MIPSCPU *mips_cpu = MIPS_CPU(cpu);
>> +    CPUMIPSState *env = &mips_cpu->env;
>> +
>> +    info->PC = env->active_tc.PC;
>> +#else
>> +    abort();
>> +#endif
>> +}
>> +
>> +static void cpustate_to_cpuinfo_tricore(CpuInfoTricore *info,
>> +                                        const CPUState *cpu)
>> +{
>> +#ifdef TARGET_TRICORE
>> +    TriCoreCPU *tricore_cpu = TRICORE_CPU(cpu);
>> +    CPUTriCoreState *env = &tricore_cpu->env;
>> +
>> +    info->PC = env->PC;
>> +#else
>> +    abort();
>> +#endif
>> +}
>> +
>> +static void cpustate_to_cpuinfo_s390(CpuInfoS390 *info, const CPUState *cpu)
>> +{
>> +#ifdef TARGET_S390X
>> +    S390CPU *s390_cpu = S390_CPU(cpu);
>> +    CPUS390XState *env = &s390_cpu->env;
>> +
>> +    info->cpu_state = env->cpu_state;
>> +#else
>> +    abort();
>> +#endif
>> +}
>> +
>> +static void cpustate_to_cpuinfo_riscv(CpuInfoRISCV *info, const CPUState *cpu)
>> +{
>> +#ifdef TARGET_RISCV
>> +    RISCVCPU *riscv_cpu = RISCV_CPU(cpu);
>> +    CPURISCVState *env = &riscv_cpu->env;
>> +
>> +    info->pc = env->pc;
>> +#else
>> +    abort();
>> +#endif
>> +}
>> +
> 
> To reduce #ifdeffery here, these helpers could be moved to suitable
> files in target/*/, plus stubs, but I doubt it's worth the bother.

Indeed. I did look for suitable recipient C files under target/*/, in
particular target/*/cpu.c, but my results weren't promising.

For example, "target/ppc/cpu.c" says "PowerPC CPU routines for qemu"
(and its actual contents agree), so quite inappropriate.

I wouldn't like to introduce new files for this, and if we're just
looking for a dumping ground for these functions, let's keep them here.

> 
>>  CpuInfoList *qmp_query_cpus(Error **errp)
>>  {
>>      MachineState *ms = MACHINE(qdev_get_machine());
>>      MachineClass *mc = MACHINE_GET_CLASS(ms);
>>      CpuInfoList *head = NULL, *cur_item = NULL;
>> +    SysEmuTarget target = qapi_enum_parse(&SysEmuTarget_lookup, TARGET_NAME,
>> +                                          -1, &error_abort);
> 
> Note how configure providing TARGET_NAME makes computing target easy.
> 
> Compare to how sysemu_target_to_cpuinfo_arch() computes arch.  Would it
> make sense to have configure provide TARGET_BASE_NAME, so we can compute
> arch the same way as target?

It would eliminate sysemu_target_to_cpuinfo_arch() entirely, yes.

However, the (quite more painful) mapping below would not be helped:

[snip]

>> +        /*
>> +         * The @SysEmuTarget -> @CpuInfo mapping below is based on the
>> +         * TARGET_ARCH -> TARGET_BASE_ARCH mapping in the "configure" script.
>> +         */
>> +        switch (target) {
>> +        case SYS_EMU_TARGET_I386:
>> +            cpustate_to_cpuinfo_x86(&info->value->u.i386, cpu);
>> +            break;
>> +        case SYS_EMU_TARGET_X86_64:
>> +            cpustate_to_cpuinfo_x86(&info->value->u.x86_64, cpu);
>> +            break;
>> +
>> +        case SYS_EMU_TARGET_PPC:
>> +            cpustate_to_cpuinfo_ppc(&info->value->u.ppc, cpu);
>> +            break;
>> +        case SYS_EMU_TARGET_PPCEMB:
>> +            cpustate_to_cpuinfo_ppc(&info->value->u.ppcemb, cpu);
>> +            break;
>> +        case SYS_EMU_TARGET_PPC64:
>> +            cpustate_to_cpuinfo_ppc(&info->value->u.ppc64, cpu);
>> +            break;
>> +
>> +        case SYS_EMU_TARGET_SPARC:
>> +            cpustate_to_cpuinfo_sparc(&info->value->u.q_sparc, cpu);
>> +            break;
>> +        case SYS_EMU_TARGET_SPARC64:
>> +            cpustate_to_cpuinfo_sparc(&info->value->u.sparc64, cpu);
>> +            break;
>> +
>> +        case SYS_EMU_TARGET_MIPS:
>> +            cpustate_to_cpuinfo_mips(&info->value->u.q_mips, cpu);
>> +            break;
>> +        case SYS_EMU_TARGET_MIPSEL:
>> +            cpustate_to_cpuinfo_mips(&info->value->u.mipsel, cpu);
>> +            break;
>> +        case SYS_EMU_TARGET_MIPS64:
>> +            cpustate_to_cpuinfo_mips(&info->value->u.mips64, cpu);
>> +            break;
>> +        case SYS_EMU_TARGET_MIPS64EL:
>> +            cpustate_to_cpuinfo_mips(&info->value->u.mips64el, cpu);
>> +            break;
>> +
>> +        case SYS_EMU_TARGET_TRICORE:
>> +            cpustate_to_cpuinfo_tricore(&info->value->u.tricore, cpu);
>> +            break;
>> +
>> +        case SYS_EMU_TARGET_S390X:
>> +            cpustate_to_cpuinfo_s390(&info->value->u.s390x, cpu);
>> +            break;
>> +
>> +        case SYS_EMU_TARGET_RISCV32:
>> +            cpustate_to_cpuinfo_riscv(&info->value->u.riscv32, cpu);
>> +            break;
>> +        case SYS_EMU_TARGET_RISCV64:
>> +            cpustate_to_cpuinfo_riscv(&info->value->u.riscv64, cpu);
>> +            break;
>> +
>> +        default:
>> +            /* do nothing for @CpuInfoOther */
>> +            break;
>> +        }
>> +

I don't know how this could be simplified. Even if the build system
provided some more macros, and we used token pasting here, we'd still
have to list all the case labels and the function calls one by one.

... I've also thought of fusing this switch statement with the one in
sysemu_target_to_cpuinfo_arch(), somehow, into a more generic helper
function. The idea would be to map the enums unconditionally, and map
the sub-structure only conditionally (e.g. if the "cpu" parameter were
not NULL). However, this helper function would not be reusable from
qmp_query_cpus_fast(): the helper cannot take a pointer *to the union*
called "u", because (a) that union has no *named* type, (b) even if it
had a type, that type differs between @CpuInfo and @CpuInfoFast.

In other words, it is impossible to write a C function that takes a
pointer to "some" union, and then fills the "s390x" member for *both*
qmp_query_cpus() and qmp_query_cpus_fast(). Those unions are genuinely
different, so the discrimination -- the identification of the
appropriate union member -- must occur separately in each. Once that's
done, we can call cpustate_to_cpuinfo_s390() from both places:

[snip]

>> +        info->value->arch = sysemu_target_to_cpuinfo_arch(target);
>> +        info->value->target = target;
>> +        if (target == SYS_EMU_TARGET_S390X) {
>> +            cpustate_to_cpuinfo_s390(&info->value->u.s390x, cpu);
>> +        } else {
>> +            /* do nothing for @CpuInfoOther */
>> +        }
>> +

In brief, I think extending configure / the build system would only help
with the less painful part of this (the scalar mapping), and so it's not
worth doing.

Thanks!
Laszlo

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [Qemu-devel] [PATCH 0/6] qapi: introduce the SysEmuTarget enumeration
  2018-04-25 12:26   ` Laszlo Ersek
@ 2018-04-25 14:37     ` Eric Blake
  0 siblings, 0 replies; 46+ messages in thread
From: Eric Blake @ 2018-04-25 14:37 UTC (permalink / raw)
  To: Laszlo Ersek, qemu-devel
  Cc: thuth, crosthwaite.peter, famz, sagark, kchamart, kbastian,
	riku.voipio, laurent, armbru, mjc, palmer, kraxel, dgibson,
	pbonzini, rth

[-- Attachment #1: Type: text/plain, Size: 1107 bytes --]

On 04/25/2018 07:26 AM, Laszlo Ersek wrote:
> On 04/25/18 00:03, no-reply@patchew.org wrote:
>> Hi,
>>
>> This series failed docker-mingw@fedora build test. Please find the testing commands and
>> their output below. If you have Docker installed, you can probably reproduce it
>> locally.
> 
> [snip]
> 
>> qapi/qapi-types-misc.h:654:20: error: expected identifier or '(' before numeric constant
>>          CpuInfoX86 i386;
>>                     ^

> Wow, is "i386" a macro on mingw, one that expands to a number? That is
> incredibly st...range.
> 
> I do need this enum constant to be "i386" in the QAPI schema, because
> that's what TARGET_NAME will map to.
> 
> Can I let the generator use the "q_" prefix here somehow?
> 

> Alright, I'll add "i386" to "polluted_words" in "scripts/qapi/common.py".
> 
> Sigh, what else is there already... I see Eric's commit 86ae191163d4 :(

Yep, that's the right fix for working around header pollution.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 619 bytes --]

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [Qemu-devel] [PATCH 5/6] qapi: extract CpuInfoCommon to mitigate schema duplication
  2018-04-25 13:20     ` Laszlo Ersek
@ 2018-04-25 17:12       ` Markus Armbruster
  2018-04-25 19:12       ` Eric Blake
  1 sibling, 0 replies; 46+ messages in thread
From: Markus Armbruster @ 2018-04-25 17:12 UTC (permalink / raw)
  To: Laszlo Ersek; +Cc: qemu-devel

Laszlo Ersek <lersek@redhat.com> writes:

> On 04/25/18 09:06, Markus Armbruster wrote:
>> Laszlo Ersek <lersek@redhat.com> writes:
>> 
>>> @CpuInfo and @CpuInfoFast duplicate the following four fields: @qom-path,
>>> @thread-id, @props and @arch. From these, extract the first three to a
>>> common structure called @CpuInfoCommon. (More on @arch later.)
>>>
>>> Introduce two new mid-layer structures, @CpuInfoBase and @CpuInfoFastBase,
>>> to soak up the union base struct fields on top of @CpuInfoCommon that are
>>> specific to @query-cpus and @query-cpus-fast, respectively.
>
> [[
>
>>> This is
>>> necessary because the base struct spec in union definitions does not let
>>> us mix named fields with a recursive base struct. (In other words, we
>>> couldn't directly use @CpuInfoCommon *plus* some other fields within
>>> @CpuInfo and @CpuInfoFast as base struct).
>
> ]]
>
>> 
>> Yes, you can either specify a base type or inline common members.  If
>> "union's common members = base type plus additional inline members"
>> turns out to be desirable in more places, we can try to add the feature.
>> I'm not asking *you* to find out, let alone try :)
>
> [[
>
>>> @arch cannot be hoisted higher than to @CpuInfoBase and @CpuInfoFastBase
>>> because the union descriminator is only accepted from a direct base
>>> struct, not from an indirect one.
>
> ]]
>
>> That's a bit of a blemish.  Again, I'm not asking you to do anything
>> about it.
>
> If these characteristics of the generator are operating knowledge for
> QAPI developers, I can trim the commit message -- those traits don't
> bother me at all, I just felt that I needed to justify the code.
>
> IOW, should I drop:
> - the sentences marked with [[ ]] above,
> - and/or the "Notes:" on @arch in the schema itself (which are updated
>   to @target, in the next patch)
> ?

Let's keep them.

>
> [snip]
>
>>> @@ -512,70 +541,77 @@
>>>  #
>>>  # Since: 0.14.0
>>>  #
>>>  # Example:
>>>  #
>>>  # -> { "execute": "query-cpus" }
>>>  # <- { "return": [
>>>  #          {
>>>  #             "CPU":0,
>>>  #             "current":true,
>>>  #             "halted":false,
>>> -#             "qom_path":"/machine/unattached/device[0]",
>>> +#             "qom-path":"/machine/unattached/device[0]",
>>>  #             "arch":"x86",
>>>  #             "pc":3227107138,
>>> -#             "thread_id":3134
>>> +#             "thread-id":3134
>>>  #          },
>>>  #          {
>>>  #             "CPU":1,
>>>  #             "current":false,
>>>  #             "halted":true,
>>> -#             "qom_path":"/machine/unattached/device[2]",
>>> +#             "qom-path":"/machine/unattached/device[2]",
>>>  #             "arch":"x86",
>>>  #             "pc":7108165,
>>> -#             "thread_id":3135
>>> +#             "thread-id":3135
>>>  #          }
>>>  #       ]
>>>  #    }
>> 
>> Compatibility break, whoops!
>
> But, at least, I updated the example! :)

Thanks :)

>> CpuInfo and CpuInfoFast do share qom-path and thread-id *values*, but
>> the keys differ in '_' vs. '-'.  Sad.
>> 
>> What now?  Is there enough common stuff left to justify the refactoring?
>
> While working on the schema changes, I saw the '_' vs. '-' difference
> immediately, but I thought these two characters were treated
> equivalently by all QAPI clients.

I wish...

QEMU could do that on QMP input.  We've talked about it, but no patches.

On QMP output, we're screwed.

Tolerating '_' was one of the dumber mistakes in QAPI.

> Later I found (in the test suite) that this wasn't the case, so I
> thought my memories must have applied to libvirtd only. (Because,
> libvirt does map "_" to "-", right?) Anyway, I figured the best way to
> ask was to post the patch like this :)

Heh.  I would've appreciated a hint in the commit message, though.

> So, if I drop @qom-path and @thread-id from CpuInfoCommon, then only
> @props remains subject to hoisting, in this patch. In the next patch,
> @arch joins @props.
>
> I believe the refactoring is still worth doing, because otherwise, after
> the addition of @target, we'd end up with:
>
> { 'union' : 'CpuInfo',
>   'base'  : { 'CPU'       : 'int',
>               'current'   : 'bool',
>               'halted'    : 'bool',
>               'qom_path'  : 'str',
>               'thread_id' : 'int',
>               '*props'    : 'CpuInstanceProperties',
>               'arch'      : 'CpuInfoArch',
>               'target'    : 'SysEmuTarget' },
> ...
>
> { 'union' : 'CpuInfoFast',
>   'base'  : { 'cpu-index' : 'int',
>               'qom-path'  : 'str',
>               'thread-id' : 'int',
>               '*props'    : 'CpuInstanceProperties',
>               'arch'      : 'CpuInfoArch',
>               'target'    : 'SysEmuTarget' },
> ...
>
> and people would ask themselves ever after, "are there some common
> fields in there that we could extract ... hmmm, @props and @arch, okay,
> maybe, maybe not, grey area". Let's do it now and save them the thinking.

Works for me.

> [snip]
>
>>> diff --git a/qapi/qapi-schema.json b/qapi/qapi-schema.json
>>> index 25bce78352b8..5bfd2ef1dd3b 100644
>>> --- a/qapi/qapi-schema.json
>>> +++ b/qapi/qapi-schema.json
>>> @@ -61,23 +61,23 @@
>>>          'query-migrate-cache-size',
>>>          'query-tpm-models',
>>>          'query-tpm-types',
>>>          'ringbuf-read' ],
>>>      'name-case-whitelist': [
>>>          'ACPISlotType',         # DIMM, visible through query-acpi-ospm-status
>>>          'CpuInfoMIPS',          # PC, visible through query-cpu
>>>          'CpuInfoTricore',       # PC, visible through query-cpu
>>>          'QapiErrorClass',       # all members, visible through errors
>>>          'UuidInfo',             # UUID, visible through query-uuid
>>>          'X86CPURegister32',     # all members, visible indirectly through qom-get
>>> -        'q_obj_CpuInfo-base'    # CPU, visible through query-cpu
>>> +        'CpuInfoBase'           # CPU, visible through query-cpu
>> 
>> Let's update this to "visible through query-cpus, query-cpus-fast" while
>> there.
>
> Right, I noticed the typo in the preexistent comment too late (and I
> didn't notice the "query-cpus-fast" omission at all).
>
> Thanks!

You're welcome!

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [Qemu-devel] [PATCH 3/6] qapi: add SysEmuTarget to "common.json"
  2018-04-25 12:54     ` Daniel P. Berrangé
@ 2018-04-25 19:05       ` Laszlo Ersek
  2018-04-25 19:08         ` Eric Blake
  0 siblings, 1 reply; 46+ messages in thread
From: Laszlo Ersek @ 2018-04-25 19:05 UTC (permalink / raw)
  To: Daniel P. Berrangé, Eric Blake
  Cc: qemu-devel, David Gibson, Gerd Hoffmann, Kashyap Chamarthy,
	Markus Armbruster, Paolo Bonzini, Thomas Huth

On 04/25/18 14:54, Daniel P. Berrangé wrote:
> On Tue, Apr 24, 2018 at 06:11:05PM -0500, Eric Blake wrote:
>> On 04/24/2018 04:45 PM, Laszlo Ersek wrote:
>>> We'll soon need an enumeration type that lists all the softmmu targets
>>> that QEMU (the project) supports. Introduce @SysEmuTarget to
>>> "common.json".
>>>
>>> Cc: "Daniel P. Berrange" <berrange@redhat.com>
>>> Cc: David Gibson <dgibson@redhat.com>
>>> Cc: Eric Blake <eblake@redhat.com>
>>> Cc: Gerd Hoffmann <kraxel@redhat.com>
>>> Cc: Kashyap Chamarthy <kchamart@redhat.com>
>>> Cc: Markus Armbruster <armbru@redhat.com>
>>> Cc: Paolo Bonzini <pbonzini@redhat.com>
>>> Cc: Thomas Huth <thuth@redhat.com>
>>> Signed-off-by: Laszlo Ersek <lersek@redhat.com>
>>> Reviewed-by: Markus Armbruster <armbru@redhat.com>
>>> Reviewed-by: Kashyap Chamarthy <kchamart@redhat.com>
>>> ---
>>>
>>
>>> +##
>>> +{ 'enum' : 'SysEmuTarget',
>>> +  'data' : [ 'aarch64', 'alpha', 'arm', 'cris', 'hppa', 'i386', 'lm32',
>>> +             'm68k', 'microblaze', 'microblazeel', 'mips', 'mips64',
>>> +             'mips64el', 'mipsel', 'moxie', 'nios2', 'or1k', 'ppc',
>>> +             'ppc64', 'ppcemb', 'riscv32', 'riscv64', 's390x', 'sh4',
>>> +             'sh4eb', 'sparc', 'sparc64', 'tricore', 'unicore32',
>>> +             'x86_64', 'xtensa', 'xtensaeb' ] }
>>
>> x86_64 doesn't match our typical conventions of preferring '-' over '_';
>> also, wikipedia mentions both spellings but under the page name
>> 'x86-64'.  Is it worth switching that enum constant?
>>
>> https://en.wikipedia.org/wiki/X86-64
> 
> I would not want that - SysEmuTarget is supposed to be correlated with
> the qemu-system-$TARGET  binary names and we use qemu-system-x86_64
> there.

Right; also TARGET_NAME is looked up as follows in patch #4, in
qmp_query_target():

+    info->arch = qapi_enum_parse(&SysEmuTarget_lookup, TARGET_NAME, -1,
+                                 &error_abort);

That would fail if we used "x86-64" here.

Thanks!
Laszlo

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [Qemu-devel] [PATCH 3/6] qapi: add SysEmuTarget to "common.json"
  2018-04-25 19:05       ` Laszlo Ersek
@ 2018-04-25 19:08         ` Eric Blake
  2018-04-25 22:57           ` Laszlo Ersek
  0 siblings, 1 reply; 46+ messages in thread
From: Eric Blake @ 2018-04-25 19:08 UTC (permalink / raw)
  To: Laszlo Ersek, Daniel P. Berrangé
  Cc: qemu-devel, David Gibson, Gerd Hoffmann, Kashyap Chamarthy,
	Markus Armbruster, Paolo Bonzini, Thomas Huth

[-- Attachment #1: Type: text/plain, Size: 1053 bytes --]

On 04/25/2018 02:05 PM, Laszlo Ersek wrote:

>>>> +             'x86_64', 'xtensa', 'xtensaeb' ] }
>>>
>>> x86_64 doesn't match our typical conventions of preferring '-' over '_';
>>> also, wikipedia mentions both spellings but under the page name
>>> 'x86-64'.  Is it worth switching that enum constant?
>>>
>>> https://en.wikipedia.org/wiki/X86-64
>>
>> I would not want that - SysEmuTarget is supposed to be correlated with
>> the qemu-system-$TARGET  binary names and we use qemu-system-x86_64
>> there.
> 
> Right; also TARGET_NAME is looked up as follows in patch #4, in
> qmp_query_target():
> 
> +    info->arch = qapi_enum_parse(&SysEmuTarget_lookup, TARGET_NAME, -1,
> +                                 &error_abort);
> 
> That would fail if we used "x86-64" here.

Then worth a mention in the commit message to make it obvious that our
choice of _ for over-the-wire QMP is intentional.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 619 bytes --]

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [Qemu-devel] [PATCH 5/6] qapi: extract CpuInfoCommon to mitigate schema duplication
  2018-04-25 13:20     ` Laszlo Ersek
  2018-04-25 17:12       ` Markus Armbruster
@ 2018-04-25 19:12       ` Eric Blake
  2018-04-25 22:56         ` Laszlo Ersek
  1 sibling, 1 reply; 46+ messages in thread
From: Eric Blake @ 2018-04-25 19:12 UTC (permalink / raw)
  To: Laszlo Ersek, Markus Armbruster; +Cc: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 910 bytes --]

On 04/25/2018 08:20 AM, Laszlo Ersek wrote:

> ...
> 
> and people would ask themselves ever after, "are there some common
> fields in there that we could extract ... hmmm, @props and @arch, okay,
> maybe, maybe not, grey area". Let's do it now and save them the thinking.

No, CpuInfo is slated for death in the next year or so; per commit
ff9a9156.  Once it disappears (in 2.14 or 2.15?), we will ONLY have
CpuInfoFast (although we might rename it at that time, as the name of
QMP structs is not part of the introspection interface).

So, my personal inclination is to just live with the mindless
near-duplication until the deprecation period ends, rather than wasting
cycles refactoring things just to refactor it back out when removing the
dead code later.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 619 bytes --]

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [Qemu-devel] [PATCH 5/6] qapi: extract CpuInfoCommon to mitigate schema duplication
  2018-04-25 19:12       ` Eric Blake
@ 2018-04-25 22:56         ` Laszlo Ersek
  2018-04-26  6:19           ` Markus Armbruster
  0 siblings, 1 reply; 46+ messages in thread
From: Laszlo Ersek @ 2018-04-25 22:56 UTC (permalink / raw)
  To: Eric Blake, Markus Armbruster; +Cc: qemu-devel

On 04/25/18 21:12, Eric Blake wrote:
> On 04/25/2018 08:20 AM, Laszlo Ersek wrote:
> 
>> ...
>>
>> and people would ask themselves ever after, "are there some common
>> fields in there that we could extract ... hmmm, @props and @arch, okay,
>> maybe, maybe not, grey area". Let's do it now and save them the thinking.
> 
> No, CpuInfo is slated for death in the next year or so; per commit
> ff9a9156.  Once it disappears (in 2.14 or 2.15?), we will ONLY have
> CpuInfoFast (although we might rename it at that time, as the name of
> QMP structs is not part of the introspection interface).
> 
> So, my personal inclination is to just live with the mindless
> near-duplication until the deprecation period ends, rather than wasting
> cycles refactoring things just to refactor it back out when removing the
> dead code later.
> 

This is an important update; thank you for it. Because, it tells me that
we might not need to add @target to CpuInfo at all. Why *extend* an
interface that is deprecated to the point that we're reluctant even to
*refactor* it?

(BTW, I had noticed the deprecation note in the schema source code, from
what you've now identified as commit ff9a9156; I didn't know what it
meant -- I didn't know it carried a removal sentence.)

The consequence is that I could drop the painful modifications for
qmp_query_cpus() altogether, and just keep the simple ones for
qmp_query_cpus_fast().

Markus, does that work for you? Forget about @CpuInfo for good?

Thanks,
Laszlo

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [Qemu-devel] [PATCH 3/6] qapi: add SysEmuTarget to "common.json"
  2018-04-25 19:08         ` Eric Blake
@ 2018-04-25 22:57           ` Laszlo Ersek
  0 siblings, 0 replies; 46+ messages in thread
From: Laszlo Ersek @ 2018-04-25 22:57 UTC (permalink / raw)
  To: Eric Blake, Daniel P. Berrangé
  Cc: qemu-devel, David Gibson, Gerd Hoffmann, Kashyap Chamarthy,
	Markus Armbruster, Paolo Bonzini, Thomas Huth

On 04/25/18 21:08, Eric Blake wrote:
> On 04/25/2018 02:05 PM, Laszlo Ersek wrote:
> 
>>>>> +             'x86_64', 'xtensa', 'xtensaeb' ] }
>>>>
>>>> x86_64 doesn't match our typical conventions of preferring '-' over '_';
>>>> also, wikipedia mentions both spellings but under the page name
>>>> 'x86-64'.  Is it worth switching that enum constant?
>>>>
>>>> https://en.wikipedia.org/wiki/X86-64
>>>
>>> I would not want that - SysEmuTarget is supposed to be correlated with
>>> the qemu-system-$TARGET  binary names and we use qemu-system-x86_64
>>> there.
>>
>> Right; also TARGET_NAME is looked up as follows in patch #4, in
>> qmp_query_target():
>>
>> +    info->arch = qapi_enum_parse(&SysEmuTarget_lookup, TARGET_NAME, -1,
>> +                                 &error_abort);
>>
>> That would fail if we used "x86-64" here.
> 
> Then worth a mention in the commit message to make it obvious that our
> choice of _ for over-the-wire QMP is intentional.
> 

Right; I'll add a note to the schema too.

Thanks!
Laszlo

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [Qemu-devel] [PATCH 5/6] qapi: extract CpuInfoCommon to mitigate schema duplication
  2018-04-25 22:56         ` Laszlo Ersek
@ 2018-04-26  6:19           ` Markus Armbruster
  0 siblings, 0 replies; 46+ messages in thread
From: Markus Armbruster @ 2018-04-26  6:19 UTC (permalink / raw)
  To: Laszlo Ersek; +Cc: Eric Blake, qemu-devel

Laszlo Ersek <lersek@redhat.com> writes:

> On 04/25/18 21:12, Eric Blake wrote:
>> On 04/25/2018 08:20 AM, Laszlo Ersek wrote:
>> 
>>> ...
>>>
>>> and people would ask themselves ever after, "are there some common
>>> fields in there that we could extract ... hmmm, @props and @arch, okay,
>>> maybe, maybe not, grey area". Let's do it now and save them the thinking.
>> 
>> No, CpuInfo is slated for death in the next year or so; per commit
>> ff9a9156.

Good catch, I missed it.

>>            Once it disappears (in 2.14 or 2.15?), we will ONLY have
>> CpuInfoFast (although we might rename it at that time, as the name of
>> QMP structs is not part of the introspection interface).
>> 
>> So, my personal inclination is to just live with the mindless
>> near-duplication until the deprecation period ends, rather than wasting
>> cycles refactoring things just to refactor it back out when removing the
>> dead code later.
>> 
>
> This is an important update; thank you for it. Because, it tells me that
> we might not need to add @target to CpuInfo at all. Why *extend* an
> interface that is deprecated to the point that we're reluctant even to
> *refactor* it?
>
> (BTW, I had noticed the deprecation note in the schema source code, from
> what you've now identified as commit ff9a9156; I didn't know what it
> meant -- I didn't know it carried a removal sentence.)

No need to enhance it even without a removal sentence.

> The consequence is that I could drop the painful modifications for
> qmp_query_cpus() altogether, and just keep the simple ones for
> qmp_query_cpus_fast().
>
> Markus, does that work for you? Forget about @CpuInfo for good?

Absolutely.

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [Qemu-devel] [PATCH 6/6] qapi: discriminate CpuInfo[Fast] on SysEmuTarget, not CpuInfoArch
  2018-04-25 13:47     ` Laszlo Ersek
@ 2018-04-26  6:26       ` Markus Armbruster
  2018-04-26  9:18         ` Laszlo Ersek
  0 siblings, 1 reply; 46+ messages in thread
From: Markus Armbruster @ 2018-04-26  6:26 UTC (permalink / raw)
  To: Laszlo Ersek
  Cc: Paolo Bonzini, Peter Crosthwaite, qemu-devel, Richard Henderson

Laszlo Ersek <lersek@redhat.com> writes:

[...]
> In brief, I think extending configure / the build system would only help
> with the less painful part of this (the scalar mapping), and so it's not
> worth doing.

We're going to leave deprecated query-cpus alone (see Eric's review of
the previous patch).  Does that change matters?

PS: Instead of configure changes, #TARGET_BASE_ARCH might do.

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [Qemu-devel] [PATCH 6/6] qapi: discriminate CpuInfo[Fast] on SysEmuTarget, not CpuInfoArch
  2018-04-26  6:26       ` Markus Armbruster
@ 2018-04-26  9:18         ` Laszlo Ersek
  2018-04-26 11:57           ` Markus Armbruster
  2018-04-26 13:33           ` Laszlo Ersek
  0 siblings, 2 replies; 46+ messages in thread
From: Laszlo Ersek @ 2018-04-26  9:18 UTC (permalink / raw)
  To: Markus Armbruster
  Cc: Paolo Bonzini, Peter Crosthwaite, qemu-devel, Richard Henderson

On 04/26/18 08:26, Markus Armbruster wrote:
> Laszlo Ersek <lersek@redhat.com> writes:
> 
> [...]
>> In brief, I think extending configure / the build system would only help
>> with the less painful part of this (the scalar mapping), and so it's not
>> worth doing.
> 
> We're going to leave deprecated query-cpus alone (see Eric's review of
> the previous patch).

Yes.

> Does that change matters?

It does.

> PS: Instead of configure changes, #TARGET_BASE_ARCH might do.

Does that already exist as a macro? Hmm... After grepping my build dir,
it doesn't seem to, but maybe I can change that. Because,
TARGET_BASE_ARCH is exactly what we need.

Thanks!
Laszlo

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [Qemu-devel] [PATCH 6/6] qapi: discriminate CpuInfo[Fast] on SysEmuTarget, not CpuInfoArch
  2018-04-26  9:18         ` Laszlo Ersek
@ 2018-04-26 11:57           ` Markus Armbruster
  2018-04-26 13:33           ` Laszlo Ersek
  1 sibling, 0 replies; 46+ messages in thread
From: Markus Armbruster @ 2018-04-26 11:57 UTC (permalink / raw)
  To: Laszlo Ersek
  Cc: Paolo Bonzini, Richard Henderson, qemu-devel, Peter Crosthwaite

Laszlo Ersek <lersek@redhat.com> writes:

> On 04/26/18 08:26, Markus Armbruster wrote:
>> Laszlo Ersek <lersek@redhat.com> writes:
>> 
>> [...]
>>> In brief, I think extending configure / the build system would only help
>>> with the less painful part of this (the scalar mapping), and so it's not
>>> worth doing.
>> 
>> We're going to leave deprecated query-cpus alone (see Eric's review of
>> the previous patch).
>
> Yes.
>
>> Does that change matters?
>
> It does.
>
>> PS: Instead of configure changes, #TARGET_BASE_ARCH might do.
>
> Does that already exist as a macro? Hmm... After grepping my build dir,
> it doesn't seem to, but maybe I can change that. Because,
> TARGET_BASE_ARCH is exactly what we need.

You're right, it's not in config-target.h, only in config-target.mak.
scripts/create_config would need a (trivial) patch.

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [Qemu-devel] [PATCH 6/6] qapi: discriminate CpuInfo[Fast] on SysEmuTarget, not CpuInfoArch
  2018-04-26  9:18         ` Laszlo Ersek
  2018-04-26 11:57           ` Markus Armbruster
@ 2018-04-26 13:33           ` Laszlo Ersek
  2018-04-26 14:34             ` Markus Armbruster
  1 sibling, 1 reply; 46+ messages in thread
From: Laszlo Ersek @ 2018-04-26 13:33 UTC (permalink / raw)
  To: Markus Armbruster
  Cc: Paolo Bonzini, Peter Crosthwaite, qemu-devel, Richard Henderson

On 04/26/18 11:18, Laszlo Ersek wrote:
> On 04/26/18 08:26, Markus Armbruster wrote:
>> Laszlo Ersek <lersek@redhat.com> writes:
>>
>> [...]
>>> In brief, I think extending configure / the build system would only help
>>> with the less painful part of this (the scalar mapping), and so it's not
>>> worth doing.
>>
>> We're going to leave deprecated query-cpus alone (see Eric's review of
>> the previous patch).
> 
> Yes.
> 
>> Does that change matters?
> 
> It does.
> 
>> PS: Instead of configure changes, #TARGET_BASE_ARCH might do.
> 
> Does that already exist as a macro? Hmm... After grepping my build dir,
> it doesn't seem to, but maybe I can change that. Because,
> TARGET_BASE_ARCH is exactly what we need.

Acerbic discovery of the day: @CpuInfoArch has "x86", while configure
produces:

  TARGET_NAME  TARGET_BASE_ARCH
         i386              i386
       x86_64              i386

Note how "i386" does not match "x86".

I guess I'll have to keep the sysemu_target_to_cpuinfo_arch() function.

Thanks
Laszlo

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [Qemu-devel] [PATCH 6/6] qapi: discriminate CpuInfo[Fast] on SysEmuTarget, not CpuInfoArch
  2018-04-26 13:33           ` Laszlo Ersek
@ 2018-04-26 14:34             ` Markus Armbruster
  2018-04-26 14:48               ` Eric Blake
  0 siblings, 1 reply; 46+ messages in thread
From: Markus Armbruster @ 2018-04-26 14:34 UTC (permalink / raw)
  To: Laszlo Ersek
  Cc: Paolo Bonzini, Richard Henderson, qemu-devel, Peter Crosthwaite

Laszlo Ersek <lersek@redhat.com> writes:

> On 04/26/18 11:18, Laszlo Ersek wrote:
>> On 04/26/18 08:26, Markus Armbruster wrote:
>>> Laszlo Ersek <lersek@redhat.com> writes:
>>>
>>> [...]
>>>> In brief, I think extending configure / the build system would only help
>>>> with the less painful part of this (the scalar mapping), and so it's not
>>>> worth doing.
>>>
>>> We're going to leave deprecated query-cpus alone (see Eric's review of
>>> the previous patch).
>> 
>> Yes.
>> 
>>> Does that change matters?
>> 
>> It does.
>> 
>>> PS: Instead of configure changes, #TARGET_BASE_ARCH might do.
>> 
>> Does that already exist as a macro? Hmm... After grepping my build dir,
>> it doesn't seem to, but maybe I can change that. Because,
>> TARGET_BASE_ARCH is exactly what we need.
>
> Acerbic discovery of the day: @CpuInfoArch has "x86", while configure
> produces:
>
>   TARGET_NAME  TARGET_BASE_ARCH
>          i386              i386
>        x86_64              i386
>
> Note how "i386" does not match "x86".

Review fail.

Just three weeks ago, we could still have fixed query-cpus-fast...

> I guess I'll have to keep the sysemu_target_to_cpuinfo_arch() function.

Assuming this is the only offender, you could also s/i386/x86/ before
you pass it to qapi_enum_parse().  Pick what you hate less.

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [Qemu-devel] [PATCH 6/6] qapi: discriminate CpuInfo[Fast] on SysEmuTarget, not CpuInfoArch
  2018-04-26 14:34             ` Markus Armbruster
@ 2018-04-26 14:48               ` Eric Blake
  2018-04-26 15:51                 ` Markus Armbruster
  0 siblings, 1 reply; 46+ messages in thread
From: Eric Blake @ 2018-04-26 14:48 UTC (permalink / raw)
  To: Markus Armbruster, Laszlo Ersek
  Cc: Paolo Bonzini, Peter Crosthwaite, qemu-devel, Richard Henderson

[-- Attachment #1: Type: text/plain, Size: 1408 bytes --]

On 04/26/2018 09:34 AM, Markus Armbruster wrote:
>>
>> Acerbic discovery of the day: @CpuInfoArch has "x86", while configure
>> produces:
>>
>>   TARGET_NAME  TARGET_BASE_ARCH
>>          i386              i386
>>        x86_64              i386
>>
>> Note how "i386" does not match "x86".
> 
> Review fail.
> 
> Just three weeks ago, we could still have fixed query-cpus-fast...

Actually, I think we still can.  We already documented in the 2.12
release notes that the "arch" field of query-cpus-fast is known to be
broken for all but "s390x" (which is really the only arch field that
MUST be correct, as that is the only time we send additional
information).  And introspection can easily see both the enum contents
(if we add something) as well as any other additions to the
query-cpus-fast output union (although that is less likely), to use
those as a witness for whether qemu is new enough to have fixed the
bogus "arch" values.  I'd argue that if we change things right now, with
intent to include the change in 2.12.1, before people start relying on
the bogus "arch" of 2.12, then we should feel free to make
query-cpus-fast output whatever we want for all architectures other than
"s390x", even if it changes the current output of "x86".

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 619 bytes --]

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [Qemu-devel] [PATCH 6/6] qapi: discriminate CpuInfo[Fast] on SysEmuTarget, not CpuInfoArch
  2018-04-26 14:48               ` Eric Blake
@ 2018-04-26 15:51                 ` Markus Armbruster
  2018-04-26 16:30                   ` Laszlo Ersek
  0 siblings, 1 reply; 46+ messages in thread
From: Markus Armbruster @ 2018-04-26 15:51 UTC (permalink / raw)
  To: Eric Blake
  Cc: Laszlo Ersek, Paolo Bonzini, Richard Henderson, qemu-devel,
	Peter Crosthwaite

Eric Blake <eblake@redhat.com> writes:

> On 04/26/2018 09:34 AM, Markus Armbruster wrote:
>>>
>>> Acerbic discovery of the day: @CpuInfoArch has "x86", while configure
>>> produces:
>>>
>>>   TARGET_NAME  TARGET_BASE_ARCH
>>>          i386              i386
>>>        x86_64              i386
>>>
>>> Note how "i386" does not match "x86".
>> 
>> Review fail.
>> 
>> Just three weeks ago, we could still have fixed query-cpus-fast...
>
> Actually, I think we still can.  We already documented in the 2.12
> release notes that the "arch" field of query-cpus-fast is known to be
> broken for all but "s390x" (which is really the only arch field that
> MUST be correct, as that is the only time we send additional
> information).  And introspection can easily see both the enum contents
> (if we add something) as well as any other additions to the
> query-cpus-fast output union (although that is less likely), to use
> those as a witness for whether qemu is new enough to have fixed the
> bogus "arch" values.  I'd argue that if we change things right now, with
> intent to include the change in 2.12.1, before people start relying on
> the bogus "arch" of 2.12, then we should feel free to make
> query-cpus-fast output whatever we want for all architectures other than
> "s390x", even if it changes the current output of "x86".

In other words, we managed to screw up query-cpus-fast sufficiently to
let us fix it even now.  Cool, let's do it!

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [Qemu-devel] [PATCH 6/6] qapi: discriminate CpuInfo[Fast] on SysEmuTarget, not CpuInfoArch
  2018-04-26 15:51                 ` Markus Armbruster
@ 2018-04-26 16:30                   ` Laszlo Ersek
  2018-04-27  6:53                     ` Markus Armbruster
  0 siblings, 1 reply; 46+ messages in thread
From: Laszlo Ersek @ 2018-04-26 16:30 UTC (permalink / raw)
  To: Markus Armbruster, Eric Blake
  Cc: Paolo Bonzini, Richard Henderson, qemu-devel, Peter Crosthwaite

On 04/26/18 17:51, Markus Armbruster wrote:
> Eric Blake <eblake@redhat.com> writes:
> 
>> On 04/26/2018 09:34 AM, Markus Armbruster wrote:
>>>>
>>>> Acerbic discovery of the day: @CpuInfoArch has "x86", while configure
>>>> produces:
>>>>
>>>>   TARGET_NAME  TARGET_BASE_ARCH
>>>>          i386              i386
>>>>        x86_64              i386
>>>>
>>>> Note how "i386" does not match "x86".
>>>
>>> Review fail.
>>>
>>> Just three weeks ago, we could still have fixed query-cpus-fast...
>>
>> Actually, I think we still can.  We already documented in the 2.12
>> release notes that the "arch" field of query-cpus-fast is known to be
>> broken for all but "s390x" (which is really the only arch field that
>> MUST be correct, as that is the only time we send additional
>> information).  And introspection can easily see both the enum contents
>> (if we add something) as well as any other additions to the
>> query-cpus-fast output union (although that is less likely), to use
>> those as a witness for whether qemu is new enough to have fixed the
>> bogus "arch" values.  I'd argue that if we change things right now, with
>> intent to include the change in 2.12.1, before people start relying on
>> the bogus "arch" of 2.12, then we should feel free to make
>> query-cpus-fast output whatever we want for all architectures other than
>> "s390x", even if it changes the current output of "x86".
> 
> In other words, we managed to screw up query-cpus-fast sufficiently to
> let us fix it even now.  Cool, let's do it!
> 

Let me clarify a little.

The @CpuInfoArch enum has the following constants now:

['x86', 'sparc', 'ppc', 'mips', 'tricore', 's390', 'riscv', 'other' ]

This enum was originally introduced in 2.6 (according to the
documentation), and only the @s390 and @riscv constants were added in 2.12.

The enum constants show up in the following two places, *on the wire*:

- in @CpuInfo.@arch, only produced by @query-cpus,
- in @CpuInfoFast.@arch, only produced by @query-cpus-fast.

The plan would be to rewrite *all* those enum constants of @CpuInfoArch
to which the respective TARGET_BASE_ARCH values (from "configure") do
not map *identically*. Here's the mapping:

  TARGET_BASE_ARCH  CpuInfoArch  CpuInfoArch needs change
  ----------------  -----------  ------------------------
  i386              x86          YES
  sparc             sparc        no
  ppc               ppc          no
  mips              mips         no
  tricore           tricore      no
  s390x             s390         YES
  riscv             riscv        no

In other words, @CpuInfoArch would have to be changed to the following:

['i386', 'sparc', 'ppc', 'mips', 'tricore', 's390x', 'riscv', 'other' ]
 ^^^^^^                                     ^^^^^^^

This means that the @arch field, returned by @query-cpus and
@query-cpus-fast, would change incompatibly for those QAPI clients that
look specifically for "x86" or "s390".

Is this a safe change?

I would say, because of the 's390' -> 's390x' change, that it isn't.

(Also, to confirm, the wiki section at
<https://wiki.qemu.org/Planning/2.12#Issues_that_will_not_be_fixed> states,

  * the query-cpus-fast QMP command reports bogus arch data for all
    architectures except x86 and s390; applications should be careful to
    not rely on the bogus information

It (correctly) refers to "s390". That value would change.)

Thanks
Laszlo

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [Qemu-devel] [PATCH 6/6] qapi: discriminate CpuInfo[Fast] on SysEmuTarget, not CpuInfoArch
  2018-04-26 16:30                   ` Laszlo Ersek
@ 2018-04-27  6:53                     ` Markus Armbruster
  2018-04-27 13:46                       ` Eric Blake
  0 siblings, 1 reply; 46+ messages in thread
From: Markus Armbruster @ 2018-04-27  6:53 UTC (permalink / raw)
  To: Laszlo Ersek
  Cc: Eric Blake, Paolo Bonzini, Peter Crosthwaite, qemu-devel,
	Richard Henderson

Laszlo Ersek <lersek@redhat.com> writes:

> On 04/26/18 17:51, Markus Armbruster wrote:
>> Eric Blake <eblake@redhat.com> writes:
>> 
>>> On 04/26/2018 09:34 AM, Markus Armbruster wrote:
>>>>>
>>>>> Acerbic discovery of the day: @CpuInfoArch has "x86", while configure
>>>>> produces:
>>>>>
>>>>>   TARGET_NAME  TARGET_BASE_ARCH
>>>>>          i386              i386
>>>>>        x86_64              i386
>>>>>
>>>>> Note how "i386" does not match "x86".
>>>>
>>>> Review fail.
>>>>
>>>> Just three weeks ago, we could still have fixed query-cpus-fast...
>>>
>>> Actually, I think we still can.  We already documented in the 2.12
>>> release notes that the "arch" field of query-cpus-fast is known to be
>>> broken for all but "s390x" (which is really the only arch field that
>>> MUST be correct, as that is the only time we send additional
>>> information).  And introspection can easily see both the enum contents
>>> (if we add something) as well as any other additions to the
>>> query-cpus-fast output union (although that is less likely), to use
>>> those as a witness for whether qemu is new enough to have fixed the
>>> bogus "arch" values.  I'd argue that if we change things right now, with
>>> intent to include the change in 2.12.1, before people start relying on
>>> the bogus "arch" of 2.12, then we should feel free to make
>>> query-cpus-fast output whatever we want for all architectures other than
>>> "s390x", even if it changes the current output of "x86".
>> 
>> In other words, we managed to screw up query-cpus-fast sufficiently to
>> let us fix it even now.  Cool, let's do it!
>> 
>
> Let me clarify a little.
>
> The @CpuInfoArch enum has the following constants now:
>
> ['x86', 'sparc', 'ppc', 'mips', 'tricore', 's390', 'riscv', 'other' ]
>
> This enum was originally introduced in 2.6 (according to the
> documentation), and only the @s390 and @riscv constants were added in 2.12.
>
> The enum constants show up in the following two places, *on the wire*:
>
> - in @CpuInfo.@arch, only produced by @query-cpus,
> - in @CpuInfoFast.@arch, only produced by @query-cpus-fast.
>
> The plan would be to rewrite *all* those enum constants of @CpuInfoArch
> to which the respective TARGET_BASE_ARCH values (from "configure") do
> not map *identically*. Here's the mapping:
>
>   TARGET_BASE_ARCH  CpuInfoArch  CpuInfoArch needs change
>   ----------------  -----------  ------------------------
>   i386              x86          YES
>   sparc             sparc        no
>   ppc               ppc          no
>   mips              mips         no
>   tricore           tricore      no
>   s390x             s390         YES
>   riscv             riscv        no
>
> In other words, @CpuInfoArch would have to be changed to the following:
>
> ['i386', 'sparc', 'ppc', 'mips', 'tricore', 's390x', 'riscv', 'other' ]
>  ^^^^^^                                     ^^^^^^^
>
> This means that the @arch field, returned by @query-cpus and
> @query-cpus-fast, would change incompatibly for those QAPI clients that
> look specifically for "x86" or "s390".
>
> Is this a safe change?
>
> I would say, because of the 's390' -> 's390x' change, that it isn't.
>
> (Also, to confirm, the wiki section at
> <https://wiki.qemu.org/Planning/2.12#Issues_that_will_not_be_fixed> states,
>
>   * the query-cpus-fast QMP command reports bogus arch data for all
>     architectures except x86 and s390; applications should be careful to
>     not rely on the bogus information
>
> It (correctly) refers to "s390". That value would change.)

You're right, that's a compatibility break.

We could perhaps still declare *all* @arch values useless in v2.12.0,
then fix them in v2.12.1.

Or we deprecate @arch right when we introduce @target, and drop it later
in accordance with our deprecation policy (qemu-doc.texi @appendix
Deprecated features).  That way, the rather ridiculous code to compute
it will be temporary.  I think that's cleaner.

   @arch in     query-cpus      query-cpus-fast
   before 2.6   nonexistent
   2.6 - 2.11   CpuInfoArch
   2.12         cmd deprecated  CpuInfoArch
   2.13         cmd deprecated  memb deprecated
   2.14         cmd gone        memb deprecated
   2.15         cmd gone        memb gone

Opinions?

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [Qemu-devel] [PATCH 6/6] qapi: discriminate CpuInfo[Fast] on SysEmuTarget, not CpuInfoArch
  2018-04-27  6:53                     ` Markus Armbruster
@ 2018-04-27 13:46                       ` Eric Blake
  0 siblings, 0 replies; 46+ messages in thread
From: Eric Blake @ 2018-04-27 13:46 UTC (permalink / raw)
  To: Markus Armbruster, Laszlo Ersek
  Cc: Paolo Bonzini, Peter Crosthwaite, qemu-devel, Richard Henderson

[-- Attachment #1: Type: text/plain, Size: 1448 bytes --]

On 04/27/2018 01:53 AM, Markus Armbruster wrote:

> We could perhaps still declare *all* @arch values useless in v2.12.0,
> then fix them in v2.12.1.
> 

Well, it's still useful to know that "s390" means the extra field is
available even in 2.12.0.  But your plan:

> Or we deprecate @arch right when we introduce @target, and drop it later
> in accordance with our deprecation policy (qemu-doc.texi @appendix
> Deprecated features).  That way, the rather ridiculous code to compute
> it will be temporary.  I think that's cleaner.
> 
>    @arch in     query-cpus      query-cpus-fast
>    before 2.6   nonexistent
>    2.6 - 2.11   CpuInfoArch
>    2.12         cmd deprecated  CpuInfoArch
>    2.13         cmd deprecated  memb deprecated
>    2.14         cmd gone        memb deprecated
>    2.15         cmd gone        memb gone

works well for me.  I don't think we can accelerate the deprecation by
backporting that to 2.12.1, or if the deprecation belongs only in 2.13,
but the overall plan is sane (libvirt has the deprecation timeframe to
start accessing 'target' instead of 'arch' when worrying about whether
the extra s390x information is present - if it doesn't already just read
the information when present without worrying about the value of 'arch'
in the first place).

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 619 bytes --]

^ permalink raw reply	[flat|nested] 46+ messages in thread

end of thread, other threads:[~2018-04-27 13:46 UTC | newest]

Thread overview: 46+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-24 21:45 [Qemu-devel] [PATCH 0/6] qapi: introduce the SysEmuTarget enumeration Laszlo Ersek
2018-04-24 21:45 ` [Qemu-devel] [PATCH 1/6] qapi: fill in CpuInfoFast.arch in query-cpus-fast Laszlo Ersek
2018-04-24 22:30   ` Eric Blake
2018-04-25 12:30     ` Laszlo Ersek
2018-04-25  6:39   ` Markus Armbruster
2018-04-25 12:30     ` Laszlo Ersek
2018-04-25  7:28   ` Cornelia Huck
2018-04-24 21:45 ` [Qemu-devel] [PATCH 2/6] qapi: handle the riscv CpuInfoArch " Laszlo Ersek
2018-04-24 22:32   ` Eric Blake
2018-04-25 12:32     ` Laszlo Ersek
2018-04-25  6:44   ` Markus Armbruster
2018-04-25  7:48     ` Cornelia Huck
2018-04-25 12:38       ` Viktor VM Mihajlovski
2018-04-25 12:43       ` Laszlo Ersek
2018-04-24 21:45 ` [Qemu-devel] [PATCH 3/6] qapi: add SysEmuTarget to "common.json" Laszlo Ersek
2018-04-24 23:11   ` Eric Blake
2018-04-25 12:54     ` Daniel P. Berrangé
2018-04-25 19:05       ` Laszlo Ersek
2018-04-25 19:08         ` Eric Blake
2018-04-25 22:57           ` Laszlo Ersek
2018-04-24 21:45 ` [Qemu-devel] [PATCH 4/6] qapi: change the type of TargetInfo.arch from string to enum SysEmuTarget Laszlo Ersek
2018-04-25  6:48   ` Markus Armbruster
2018-04-25 12:58     ` Laszlo Ersek
2018-04-24 21:45 ` [Qemu-devel] [PATCH 5/6] qapi: extract CpuInfoCommon to mitigate schema duplication Laszlo Ersek
2018-04-25  7:06   ` Markus Armbruster
2018-04-25 13:20     ` Laszlo Ersek
2018-04-25 17:12       ` Markus Armbruster
2018-04-25 19:12       ` Eric Blake
2018-04-25 22:56         ` Laszlo Ersek
2018-04-26  6:19           ` Markus Armbruster
2018-04-24 21:45 ` [Qemu-devel] [PATCH 6/6] qapi: discriminate CpuInfo[Fast] on SysEmuTarget, not CpuInfoArch Laszlo Ersek
2018-04-25  7:33   ` Markus Armbruster
2018-04-25 13:47     ` Laszlo Ersek
2018-04-26  6:26       ` Markus Armbruster
2018-04-26  9:18         ` Laszlo Ersek
2018-04-26 11:57           ` Markus Armbruster
2018-04-26 13:33           ` Laszlo Ersek
2018-04-26 14:34             ` Markus Armbruster
2018-04-26 14:48               ` Eric Blake
2018-04-26 15:51                 ` Markus Armbruster
2018-04-26 16:30                   ` Laszlo Ersek
2018-04-27  6:53                     ` Markus Armbruster
2018-04-27 13:46                       ` Eric Blake
2018-04-24 22:03 ` [Qemu-devel] [PATCH 0/6] qapi: introduce the SysEmuTarget enumeration no-reply
2018-04-25 12:26   ` Laszlo Ersek
2018-04-25 14:37     ` Eric Blake

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.