From patchwork Mon Feb 13 09:50:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhao Liu X-Patchwork-Id: 1741529 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=ItKY1GzA; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PFfhZ5Ly9z23hX for ; Mon, 13 Feb 2023 20:50:06 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pRVQB-0002lu-4j; Mon, 13 Feb 2023 04:46:51 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pRVPs-00027L-K3 for qemu-devel@nongnu.org; Mon, 13 Feb 2023 04:46:34 -0500 Received: from mga12.intel.com ([192.55.52.136]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pRVPk-0002o2-SG for qemu-devel@nongnu.org; Mon, 13 Feb 2023 04:46:30 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1676281584; x=1707817584; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=QeD+vK4so9MELduw52hWTL0ikN2+DglvZKSq12m5+oI=; b=ItKY1GzAbVcbwWI7g92DyDdhCAVSEiza9SpAh4Yd4CxMmj1Sc57IaxJz iiQfSPYs8a0Z8ifI6xPwIZcwfIHQCSIA9hI4+hsmanzEjPgRxtPpsZWIo E29+2RKBS6tmIykvTRt0vn7dNB/54d9LB68etqRqMzDa3IqzhAoPlkBaE PSYMP4zJNpGTXLRCNsYXH5RbEgvA6tamZsLH+K+YboJ2Olacb7KFGeFZ/ 4Dx/AaVPCorGcQcUFN72Yx2MzyXkWB82o/02XlYCvesF4CckMn++9afHI r3KrJ5oYeLut3vgjalX7dzyXKELLwzTAod+YrX22O2Vj9nGzpl/VoN2dM w==; X-IronPort-AV: E=McAfee;i="6500,9779,10619"; a="310487127" X-IronPort-AV: E=Sophos;i="5.97,293,1669104000"; d="scan'208";a="310487127" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Feb 2023 01:45:41 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10619"; a="670760642" X-IronPort-AV: E=Sophos;i="5.97,293,1669104000"; d="scan'208";a="670760642" Received: from liuzhao-optiplex-7080.sh.intel.com ([10.239.160.112]) by fmsmga007.fm.intel.com with ESMTP; 13 Feb 2023 01:45:38 -0800 From: Zhao Liu To: Eduardo Habkost , Marcel Apfelbaum , =?utf-8?q?Philippe_Mathieu-D?= =?utf-8?q?aud=C3=A9?= , Yanan Wang , "Michael S . Tsirkin" , Richard Henderson , Paolo Bonzini , Eric Blake , Markus Armbruster Cc: qemu-devel@nongnu.org, Zhenyu Wang , Dapeng Mi , Zhuocheng Ding , Robert Hoo , Sean Christopherson , Like Xu , Zhao Liu Subject: [RFC 40/52] qapi: Introduce hybrid options Date: Mon, 13 Feb 2023 17:50:23 +0800 Message-Id: <20230213095035.158240-41-zhao1.liu@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230213095035.158240-1-zhao1.liu@linux.intel.com> References: <20230213095035.158240-1-zhao1.liu@linux.intel.com> MIME-Version: 1.0 Received-SPF: none client-ip=192.55.52.136; envelope-from=zhao1.liu@linux.intel.com; helo=mga12.intel.com X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_PASS=-0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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 From: Zhao Liu For hybrid cpu topology configuration, the original "-smp" lack of flexibility to expand, and unables to customize different cores. So we introduce "-hybrid" command: -hybrid socket,sockets=n -hybrid die,dies=n -hybrid cluster,clusters=n -hybrid core,cores=n,type=core_type[,threads=threads] [,clusterid=cluster] Here, we first define the corresponding qapi options for these 4 topology levels: core, cluster, die and socket. We doesn't need a thread level since thread doesn't have different type. Signed-off-by: Zhao Liu --- qapi/machine.json | 90 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) diff --git a/qapi/machine.json b/qapi/machine.json index bd7303f34497..931c6dea9819 100644 --- a/qapi/machine.json +++ b/qapi/machine.json @@ -1694,3 +1694,93 @@ { 'command': 'dumpdtb', 'data': { 'filename': 'str' }, 'if': 'CONFIG_FDT' } + +## +# @HybridOptionsType: +# +# @socket: socket level configuration +# +# @die: die level configuration +# +# @cluster: cluster level configuration +# +# @core: core level configuration +# +# Since: 8.0 +## +{ 'enum': 'HybridOptionsType', + 'data': [ 'socket', 'die', 'cluster', 'core' ] } + +## +# @HybridOptions: +# +# A discriminated record of hybrid options. (for OptsVisitor) +# +# Since: 8.0 +## +{ 'union': 'HybridOptions', + 'base': { 'type': 'HybridOptionsType' }, + 'discriminator': 'type', + 'data': { + 'socket': 'HybridSocketOptions', + 'die': 'HybridDieOptions', + 'cluster': 'HybridClusterOptions', + 'core': 'HybridCoreOptions' }} + +## +# @HybridCoreOptions: +# +# Configure core level topology for hybrid cpu topology. +# +# @cores: number of current type cores in one die. +# +# @coretype: type of current core. +# +# @threads: number of threads that current core has. +# +# @clusterid: cluster index in one die that current core will be +# inserted to. +# +# Since: 8.0 +## +{ 'struct': 'HybridCoreOptions', 'data': { + '*cores': 'uint32', + '*coretype': 'str', + '*threads': 'uint32', + '*clusterid': ['uint32']} } + +## +# @HybridClusterOptions: +# +# Configure cluster level topology for hybrid cpu topology. +# +# @clusters: number of clusters in one socket. +# +# Since: 8.0 +## +{ 'struct': 'HybridClusterOptions', 'data': { + '*clusters': 'uint32' } } + +## +# @HybridDieOptions: +# +# Configure die level topology for hybrid cpu topology. +# +# @dies: number of dies in one socket. +# +# Since: 8.0 +## +{ 'struct': 'HybridDieOptions', 'data': { + '*dies': 'uint32' } } + +## +# @HybridSocketOptions: +# +# Configure socket level topology for hybrid cpu topology. +# +# @sockets: number of sockets in the whole system. +# +# Since: 8.0 +## +{ 'struct': 'HybridSocketOptions', 'data': { + '*sockets': 'uint32' } }