From patchwork Tue Feb 2 12:25:55 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: James Hogan X-Patchwork-Id: 577123 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 0D9D314090A for ; Tue, 2 Feb 2016 23:26:19 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=albanarts-com.20150623.gappssmtp.com header.i=@albanarts-com.20150623.gappssmtp.com header.b=YQPBD54K; dkim-atps=neutral Received: from localhost ([::1]:56594 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aQa2C-0007mS-Tm for incoming@patchwork.ozlabs.org; Tue, 02 Feb 2016 07:26:16 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52010) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aQa1v-0007UB-VS for qemu-devel@nongnu.org; Tue, 02 Feb 2016 07:26:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aQa1s-0005uG-Le for qemu-devel@nongnu.org; Tue, 02 Feb 2016 07:25:59 -0500 Received: from mail-yk0-x243.google.com ([2607:f8b0:4002:c07::243]:33039) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aQa1s-0005tt-BT for qemu-devel@nongnu.org; Tue, 02 Feb 2016 07:25:56 -0500 Received: by mail-yk0-x243.google.com with SMTP id r207so1730470ykd.0 for ; Tue, 02 Feb 2016 04:25:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=albanarts-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=5NcZykUJzIZzm+cHRBuVQMYSa4IXORsMpcr5SXB792Q=; b=YQPBD54Kv6gYcT5rDPNKLdJzFO6OcDVMOugSHdd8IVMzPdhKavRXuuJ/NcQSlVT52/ LKJtWQP1SdDHTeUDDNX+cQxsUYTGnCjPo2QTtMJ5xkiK3yNQI/jVWv5BOXzb/Sj853g2 Qj8LMRJW9j9qQVnC5Xz7nLGREV/87VROpIAaztsQgN/qqerogEMjI+ZTpnzPRdHDqUYG Q1e9VUKkWHKg453jaqTbdUp3NDbAsOyjEV5MZzda/T59CWgRQqt1Yj+J5NoHOrdPwq99 eGwy8+i9ZyNCplMgq4YhoibMzmmu1z2q4GWUP51XClsgJ+KpPJRvenMrgbAMJ+MCfu/U p4WA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=5NcZykUJzIZzm+cHRBuVQMYSa4IXORsMpcr5SXB792Q=; b=EWjjMkgvrRxeF2KLtEfXGkBxQTgLTw3gYbVhN6XFU6cI6wR1pKzmETyfbinQqCWCE4 KjdO/aurZbIBdPhxNz1iwa53KlvFjP0lULMDD4YaZOvOE2ZiPgc5l8elfkxgCtWLG7XB AcW4qZ0BEYdSCDSzq0qWPpNSdFQfBzeV/h5FbIY+ADAMn5E/h0ekW16EAt7C0TcIjbgx LS5QEjtP0HLILqcUiNw38gBh+Q34/gDZJQTRWZXMy9ngYNEIAUapbjHJ+QOhIGFUYdkn OyvAau2liz5reJhSWqFnMWLfRgJZPeVMjYXCemm7o7iIPVHnaCFWiEF7e42zgXIQkCQF 6EaQ== X-Gm-Message-State: AG10YOTX4AnU18uYLgR2G0VA2LkBTx74iuQM7CaCSOZj1UhTe5pBHe2dsI1nvlxVCWmjs3oROr7dp7ER/rVTtQ== MIME-Version: 1.0 X-Received: by 10.37.96.65 with SMTP id u62mr17043397ybb.78.1454415955739; Tue, 02 Feb 2016 04:25:55 -0800 (PST) Received: by 10.37.10.197 with HTTP; Tue, 2 Feb 2016 04:25:55 -0800 (PST) X-Originating-IP: [212.159.75.221] In-Reply-To: <1447836791-369-25-git-send-email-eblake@redhat.com> References: <1447836791-369-1-git-send-email-eblake@redhat.com> <1447836791-369-25-git-send-email-eblake@redhat.com> Date: Tue, 2 Feb 2016 12:25:55 +0000 X-Google-Sender-Auth: fI4bJ77GOAGEcrbhc9DQxoMhyHw Message-ID: From: James Hogan To: Eric Blake X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:4002:c07::243 Cc: Paolo Bonzini , Luiz Capitulino , qemu-devel@nongnu.org, armbru@redhat.com Subject: Re: [Qemu-devel] [PATCH v12 24/36] cpu: Convert CpuInfo into flat union X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Hi Eric, On 18 November 2015 at 08:52, Eric Blake wrote: > +# An enumeration of cpu types that enable additional information during > +# @query-cpus. > +# > +# Since: 2.6 > +## > +{ 'enum': 'CpuInfoArch', > + 'data': ['x86', 'sparc', 'ppc', 'mips', 'tricore', 'other' ] } > + ... > +## > +# @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', This is causing compilation issues on MIPS, because gcc bizarrely defines mips=1: $ mips-img-linux-gnu-gcc -dM -E - value->u.sparc->pc = env->pc; info->value->u.sparc->npc = env->npc; #elif defined(TARGET_MIPS) - info->value->arch = CPU_INFO_ARCH_MIPS; - info->value->u.mips = g_new0(CpuInfoMIPS, 1); - info->value->u.mips->PC = env->active_tc.PC; + info->value->arch = CPU_INFO_ARCH_MIPSARCH; + info->value->u.mipsarch = g_new0(CpuInfoMIPS, 1); + info->value->u.mipsarch->PC = env->active_tc.PC; #elif defined(TARGET_TRICORE) info->value->arch = CPU_INFO_ARCH_TRICORE; info->value->u.tricore = g_new0(CpuInfoTricore, 1); diff --git a/hmp.c b/hmp.c index 54f2620690b1..e4cba874352e 100644 --- a/hmp.c +++ b/hmp.c @@ -321,8 +321,8 @@ void hmp_info_cpus(Monitor *mon, const QDict *qdict) monitor_printf(mon, " pc=0x%016" PRIx64, cpu->value->u.sparc->pc); monitor_printf(mon, " npc=0x%016" PRIx64, cpu->value->u.sparc->npc); break; - case CPU_INFO_ARCH_MIPS: - monitor_printf(mon, " PC=0x%016" PRIx64, cpu->value->u.mips->PC); + case CPU_INFO_ARCH_MIPSARCH: + monitor_printf(mon, " PC=0x%016" PRIx64, cpu->value->u.mipsarch->PC); break; case CPU_INFO_ARCH_TRICORE: monitor_printf(mon, " PC=0x%016" PRIx64, cpu->value->u.tricore->PC); diff --git a/qapi-schema.json b/qapi-schema.json index 8d04897922ec..c72e0615e074 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -750,7 +750,7 @@ # Since: 2.6 ## { 'enum': 'CpuInfoArch', - 'data': ['x86', 'sparc', 'ppc', 'mips', 'tricore', 'other' ] } + 'data': ['x86', 'sparc', 'ppc', 'mipsarch', 'tricore', 'other' ] } ## # @CpuInfoBase: @@ -791,7 +791,7 @@ 'data': { 'x86': 'CpuInfoX86', 'sparc': 'CpuInfoSPARC', 'ppc': 'CpuInfoPPC', - 'mips': 'CpuInfoMIPS', + 'mipsarch': 'CpuInfoMIPS', 'tricore': 'CpuInfoTricore', 'other': 'CpuInfoOther' } }