From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54289) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fBxS6-0005aF-CI for qemu-devel@nongnu.org; Fri, 27 Apr 2018 03:05:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fBxS3-0007oK-1z for qemu-devel@nongnu.org; Fri, 27 Apr 2018 03:05:54 -0400 Date: Fri, 27 Apr 2018 09:05:39 +0200 From: Cornelia Huck Message-ID: <20180427090539.7a7ffa0d.cohuck@redhat.com> In-Reply-To: <20180426183404.3756-2-lersek@redhat.com> References: <20180426183404.3756-1-lersek@redhat.com> <20180426183404.3756-2-lersek@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 1/4] qapi: fill in CpuInfoFast.arch in query-cpus-fast List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Laszlo Ersek Cc: qemu devel list , Eric Blake , Markus Armbruster , Viktor VM Mihajlovski , qemu-stable@nongnu.org On Thu, 26 Apr 2018 20:34:01 +0200 Laszlo Ersek wrote: > * Commit ca230ff33f89 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(). > > * 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. > > Assign @CpuInfoOther to the @riscv enum constant in @CpuInfoFast, and > populate only the @arch field in qmp_query_cpus_fast(). Getting CPU > state without interrupting KVM is an exceptional thing that only S390X > does currently. Quoting Cornelia Huck , "s390x is > exceptional in that it has state in QEMU that is actually interesting > for upper layers and can be retrieved without performance penalty". See > also > . > > Cc: Cornelia Huck > Cc: Eric Blake > Cc: Markus Armbruster > Cc: Viktor VM Mihajlovski > Cc: qemu-stable@nongnu.org > Fixes: ca230ff33f89bf7102cbfbc2328716da6750aaed > Fixes: 25fa194b7b11901561532e435beb83d046899f7a > Signed-off-by: Laszlo Ersek > Reviewed-by: Eric Blake > --- > > Notes: > PATCHv2: > > - squash v1 patches 1/6 and 2/6 [Eric, Markus, Cornelia] > > - fix "added added" typo in the commit message [Eric] > > - update commit message wrt. S390X particulars [Cornelia, Markus, > Viktor] > > - pick up Eric's R-b (synthesized from his R-b's for v1 1/6 & 2/6) > > - don't pick up Cornelia's R-b (only given for v1 1/6) > > - update the CC list > > PATCHv1: > > - new patch > > qapi/misc.json | 2 +- > cpus.c | 16 +++++++++++++++- > 2 files changed, 16 insertions(+), 2 deletions(-) Reviewed-by: Cornelia Huck