From nobody Sun Feb 8 12:38:23 2026 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 1553849551353211.63461083079767; Fri, 29 Mar 2019 01:52:31 -0700 (PDT) Received: from localhost ([127.0.0.1]:48850 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h9nFQ-0001NA-2L for importer@patchew.org; Fri, 29 Mar 2019 04:52:24 -0400 Received: from eggs.gnu.org ([209.51.188.92]:48176) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h9nCs-0007fK-TQ for qemu-devel@nongnu.org; Fri, 29 Mar 2019 04:49:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h9nCq-0006X5-Ub for qemu-devel@nongnu.org; Fri, 29 Mar 2019 04:49:46 -0400 Received: from mga06.intel.com ([134.134.136.31]:30613) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h9nCn-0006TI-Pm; Fri, 29 Mar 2019 04:49:42 -0400 Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Mar 2019 01:49:35 -0700 Received: from xulike-server.sh.intel.com ([10.239.48.134]) by orsmga008.jf.intel.com with ESMTP; 29 Mar 2019 01:49:34 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,283,1549958400"; d="scan'208";a="129706905" From: Like Xu To: qemu-trivial@nongnu.org Date: Fri, 29 Mar 2019 16:48:37 +0800 Message-Id: <1553849325-44201-2-git-send-email-like.xu@linux.intel.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1553849325-44201-1-git-send-email-like.xu@linux.intel.com> References: <1553849325-44201-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: 134.134.136.31 Subject: [Qemu-devel] [PATCH 1/9] cpu/topology: add struct CpuTopology to MachineState 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: Eduardo Habkost , like.xu@intel.com, qemu-devel@nongnu.org, Paolo Bonzini , Igor Mammedov 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" Signed-off-by: Like Xu --- include/hw/arm/virt.h | 2 +- include/hw/boards.h | 8 ++++++++ include/sysemu/sysemu.h | 2 +- vl.c | 7 ++++++- 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/include/hw/arm/virt.h b/include/hw/arm/virt.h index 507517c..724da0c 100644 --- a/include/hw/arm/virt.h +++ b/include/hw/arm/virt.h @@ -123,7 +123,7 @@ typedef struct { struct arm_boot_info bootinfo; MemMapEntry *memmap; const int *irqmap; - int smp_cpus; + unsigned int smp_cpus; void *fdt; int fdt_size; uint32_t clock_phandle; diff --git a/include/hw/boards.h b/include/hw/boards.h index e231860..cbde276 100644 --- a/include/hw/boards.h +++ b/include/hw/boards.h @@ -231,6 +231,13 @@ typedef struct DeviceMemoryState { MemoryRegion mr; } DeviceMemoryState; =20 +typedef struct CpuTopology { + unsigned int smp_cpus; + unsigned int smp_cores; + unsigned int smp_threads; + unsigned int max_cpus; +} CpuTopology; + /** * MachineState: */ @@ -273,6 +280,7 @@ struct MachineState { const char *cpu_type; AccelState *accelerator; CPUArchIdList *possible_cpus; + CpuTopology topo; struct NVDIMMState *nvdimms_state; }; =20 diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h index 6065d9e..c0d7d7c 100644 --- a/include/sysemu/sysemu.h +++ b/include/sysemu/sysemu.h @@ -100,7 +100,7 @@ extern const char *keyboard_layout; extern int win2k_install_hack; extern int alt_grab; extern int ctrl_grab; -extern int smp_cpus; +extern unsigned int smp_cpus; extern unsigned int max_cpus; extern int cursor_hide; extern int graphic_rotate; diff --git a/vl.c b/vl.c index d61d560..9089253 100644 --- a/vl.c +++ b/vl.c @@ -162,7 +162,7 @@ static Chardev **serial_hds; Chardev *parallel_hds[MAX_PARALLEL_PORTS]; int win2k_install_hack =3D 0; int singlestep =3D 0; -int smp_cpus; +unsigned int smp_cpus; unsigned int max_cpus; int smp_cores =3D 1; int smp_threads =3D 1; @@ -4116,6 +4116,11 @@ int main(int argc, char **argv, char **envp) =20 smp_parse(qemu_opts_find(qemu_find_opts("smp-opts"), NULL)); =20 + current_machine->topo.smp_cpus =3D smp_cpus; + current_machine->topo.max_cpus =3D max_cpus; + current_machine->topo.smp_cores =3D smp_cores; + current_machine->topo.smp_threads =3D smp_threads; + /* sanity-check smp_cpus and max_cpus against machine_class */ if (smp_cpus < machine_class->min_cpus) { error_report("Invalid SMP CPUs %d. The min CPUs " --=20 1.8.3.1