From patchwork Tue Jan 14 09:27:22 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: chenfan X-Patchwork-Id: 310530 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 493AF2C0097 for ; Tue, 14 Jan 2014 20:30:25 +1100 (EST) Received: from localhost ([::1]:47235 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W30KE-0003KM-R6 for incoming@patchwork.ozlabs.org; Tue, 14 Jan 2014 04:30:22 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33109) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W30Jb-0003Cl-0i for qemu-devel@nongnu.org; Tue, 14 Jan 2014 04:29:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W30JW-0005zZ-Ai for qemu-devel@nongnu.org; Tue, 14 Jan 2014 04:29:42 -0500 Received: from [222.73.24.84] (port=61579 helo=song.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W30JV-0005wT-Vy for qemu-devel@nongnu.org; Tue, 14 Jan 2014 04:29:38 -0500 X-IronPort-AV: E=Sophos;i="4.95,657,1384272000"; d="scan'208";a="9414567" Received: from unknown (HELO tang.cn.fujitsu.com) ([10.167.250.3]) by song.cn.fujitsu.com with ESMTP; 14 Jan 2014 17:25:47 +0800 Received: from fnstmail02.fnst.cn.fujitsu.com (tang.cn.fujitsu.com [127.0.0.1]) by tang.cn.fujitsu.com (8.14.3/8.13.1) with ESMTP id s0E9TOeE008815; Tue, 14 Jan 2014 17:29:26 +0800 Received: from G08FNSTD131468.fnst.cn.fujitsu.com ([10.167.226.78]) by fnstmail02.fnst.cn.fujitsu.com (Lotus Domino Release 8.5.3) with ESMTP id 2014011417281347-1062044 ; Tue, 14 Jan 2014 17:28:13 +0800 From: Chen Fan To: qemu-devel@nongnu.org Date: Tue, 14 Jan 2014 17:27:22 +0800 Message-Id: <8d961a7b5e5c4d856b89125ee8205dde87fa38f5.1389685621.git.chen.fan.fnst@cn.fujitsu.com> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: References: X-MIMETrack: Itemize by SMTP Server on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2014/01/14 17:28:13, Serialize by Router on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2014/01/14 17:28:15, Serialize complete at 2014/01/14 17:28:15 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 222.73.24.84 Cc: Igor Mammedov , =?UTF-8?q?Andreas=20F=C3=A4rber?= Subject: [Qemu-devel] [RFC 3/3] target-i386: add qmp command 'query-cpus' to display apic_id 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 this patch provided the apic_id display as using command 'query-cpus'. Signed-off-by: Chen Fan --- cpus.c | 1 + qapi-schema.json | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/cpus.c b/cpus.c index ca4c59f..e6ed098 100644 --- a/cpus.c +++ b/cpus.c @@ -1351,6 +1351,7 @@ CpuInfoList *qmp_query_cpus(Error **errp) #if defined(TARGET_I386) info->value->has_pc = true; info->value->pc = env->eip + env->segs[R_CS].base; + info->value->apic_id = env->cpuid_apic_id; #elif defined(TARGET_PPC) info->value->has_nip = true; info->value->nip = env->nip; diff --git a/qapi-schema.json b/qapi-schema.json index c3c939c..40c67ac 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -783,6 +783,8 @@ # # @thread_id: ID of the underlying host thread # +# @apic_id: the apic id of the virtual CPU +# # Since: 0.14.0 # # Notes: @halted is a transient state that changes frequently. By the time the @@ -790,7 +792,7 @@ ## { 'type': 'CpuInfo', 'data': {'CPU': 'int', 'current': 'bool', 'halted': 'bool', '*pc': 'int', - '*nip': 'int', '*npc': 'int', '*PC': 'int', 'thread_id': 'int'} } + '*nip': 'int', '*npc': 'int', '*PC': 'int', 'thread_id': 'int', 'apic_id': 'int'} } ## # @query-cpus: