From nobody Fri Nov 7 09:16:32 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linux.intel.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1547440760753438.49379695909374; Sun, 13 Jan 2019 20:39:20 -0800 (PST) Received: from localhost ([127.0.0.1]:56415 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1giu1r-0008UE-Mk for importer@patchew.org; Sun, 13 Jan 2019 23:39:15 -0500 Received: from eggs.gnu.org ([209.51.188.92]:40707) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1giu01-0007bP-Cd for qemu-devel@nongnu.org; Sun, 13 Jan 2019 23:37:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gitzt-0002X4-5z for qemu-devel@nongnu.org; Sun, 13 Jan 2019 23:37:16 -0500 Received: from mga05.intel.com ([192.55.52.43]:15387) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gitzp-0002SG-S2 for qemu-devel@nongnu.org; Sun, 13 Jan 2019 23:37:10 -0500 Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Jan 2019 20:37:02 -0800 Received: from xulike-server.sh.intel.com ([10.239.48.60]) by fmsmga005.fm.intel.com with ESMTP; 13 Jan 2019 20:37:00 -0800 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,476,1539673200"; d="scan'208";a="311554071" From: Like Xu To: qemu-devel@nongnu.org Date: Mon, 14 Jan 2019 20:24:55 +0800 Message-Id: <1547468699-17633-2-git-send-email-like.xu@linux.intel.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1547468699-17633-1-git-send-email-like.xu@linux.intel.com> References: <1547468699-17633-1-git-send-email-like.xu@linux.intel.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 192.55.52.43 Subject: [Qemu-devel] [PATCH v1 1/5] cpu: introduce die, the new cpu toppolgy emulation level X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: drjones@redhat.com, Peter Crosthwaite , Eduardo Habkost , "Michael S. Tsirkin" , like.xu@intel.com, Marcelo Tosatti , Paolo Bonzini , imammedo@redhat.com, Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Following codes on smp_cores, the smp_dies/nr_dies/die-id is added to machine and CPUState. In addition to enable_cpuid_0xb, enable_cpuid_0x1f is introduced to track wether host is a new MCP macine or just ignored. The number for die level_type on Intel is 5 while core type keeps 2. Signed-off-by: Like Xu --- cpus.c | 1 + include/qom/cpu.h | 1 + include/sysemu/cpus.h | 1 + qapi/misc.json | 1 + target/i386/cpu.h | 5 +++++ 5 files changed, 9 insertions(+) diff --git a/cpus.c b/cpus.c index b09b702..503558d 100644 --- a/cpus.c +++ b/cpus.c @@ -2066,6 +2066,7 @@ static void qemu_dummy_start_vcpu(CPUState *cpu) =20 void qemu_init_vcpu(CPUState *cpu) { + cpu->nr_dies =3D smp_dies; cpu->nr_cores =3D smp_cores; cpu->nr_threads =3D smp_threads; cpu->stopped =3D true; diff --git a/include/qom/cpu.h b/include/qom/cpu.h index 16bbed1..ee53862 100644 --- a/include/qom/cpu.h +++ b/include/qom/cpu.h @@ -332,6 +332,7 @@ struct CPUState { DeviceState parent_obj; /*< public >*/ =20 + int nr_dies; int nr_cores; int nr_threads; =20 diff --git a/include/sysemu/cpus.h b/include/sysemu/cpus.h index 731756d..4243c8f 100644 --- a/include/sysemu/cpus.h +++ b/include/sysemu/cpus.h @@ -34,6 +34,7 @@ void qtest_clock_warp(int64_t dest); #ifndef CONFIG_USER_ONLY /* vl.c */ /* *-user doesn't have configurable SMP topology */ +extern int smp_dies; extern int smp_cores; extern int smp_threads; #endif diff --git a/qapi/misc.json b/qapi/misc.json index 24d20a8..a01a9fe 100644 --- a/qapi/misc.json +++ b/qapi/misc.json @@ -3229,6 +3229,7 @@ { 'struct': 'CpuInstanceProperties', 'data': { '*node-id': 'int', '*socket-id': 'int', + '*die-id': 'int', '*core-id': 'int', '*thread-id': 'int' } diff --git a/target/i386/cpu.h b/target/i386/cpu.h index ef41a03..aa2ee8a 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -732,6 +732,7 @@ typedef uint32_t FeatureWordArray[FEATURE_WORDS]; #define CPUID_TOPOLOGY_LEVEL_INVALID (0U << 8) #define CPUID_TOPOLOGY_LEVEL_SMT (1U << 8) #define CPUID_TOPOLOGY_LEVEL_CORE (2U << 8) +#define CPUID_TOPOLOGY_LEVEL_DIE (5U << 8) =20 /* MSR Feature Bits */ #define MSR_ARCH_CAP_RDCL_NO (1U << 0) @@ -1450,6 +1451,9 @@ struct X86CPU { /* Compatibility bits for old machine types: */ bool enable_cpuid_0xb; =20 + /* Compatibility bits for new machine types: */ + bool enable_cpuid_0x1f; + /* Enable auto level-increase for all CPUID leaves */ bool full_cpuid_auto_level; =20 @@ -1475,6 +1479,7 @@ struct X86CPU { =20 int32_t node_id; /* NUMA node this CPU belongs to */ int32_t socket_id; + int32_t die_id; int32_t core_id; int32_t thread_id; =20 --=20 1.8.3.1