From nobody Mon Nov 10 19:10:28 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 ARC-Seal: i=1; a=rsa-sha256; t=1558428930; cv=none; d=zoho.com; s=zohoarc; b=Jodf3J+4WsVLtenFxVph7B6mfU0U7NZOYcT19TZgxwKViOZKQcfIbHilpPkACQ/Ig2fR4qgImgPTgEuHm3rDMPWN+YRpiV8yRmhohtvXmiXXlkby+cXwp+8EPyrcLlo9y8YkwJfVfICCeXOVXt4LxukCQKBMHgflK9gN+Eh68So= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1558428930; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=IsF9cLxKi88VEp2hLEEY8eIn5aGmdV3008vAKJz3A34=; b=crWrI7+gWV73kSnVaDsLICGCmHUCiESo3TCnJ0j1gUaRdwB5JdeZ84eOJ6xaxOD41v+8hL3HTN51AUtF4jpzUxApeN5YQF9gRw1f70Gs6z9S5ojhw5xyQtZ4ic7a8Li1RcXR+FzYkJKq/cVcZvhTI/pY47LR8T1g2YNDnGvKWHo= ARC-Authentication-Results: i=1; mx.zoho.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 header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1558428929840733.6451018011287; Tue, 21 May 2019 01:55:29 -0700 (PDT) Received: from localhost ([127.0.0.1]:49271 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hT0YM-0002nu-LS for importer@patchew.org; Tue, 21 May 2019 04:55:22 -0400 Received: from eggs.gnu.org ([209.51.188.92]:51885) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hT0W8-0001J8-8S for qemu-devel@nongnu.org; Tue, 21 May 2019 04:53:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hT0W7-0000Xm-1x for qemu-devel@nongnu.org; Tue, 21 May 2019 04:53:04 -0400 Received: from mga04.intel.com ([192.55.52.120]:1682) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hT0W6-0000W3-QC for qemu-devel@nongnu.org; Tue, 21 May 2019 04:53:02 -0400 Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 May 2019 01:53:00 -0700 Received: from clx-ap-likexu.sh.intel.com ([10.239.48.98]) by fmsmga007.fm.intel.com with ESMTP; 21 May 2019 01:52:58 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 From: Like Xu To: qemu-devel@nongnu.org Date: Tue, 21 May 2019 00:50:53 +0800 Message-Id: <20190520165056.175475-3-like.xu@linux.intel.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190520165056.175475-1-like.xu@linux.intel.com> References: <20190520165056.175475-1-like.xu@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 192.55.52.120 Subject: [Qemu-devel] [PATCH v2 2/5] i386/cpu: Consolidate die-id validity in smp context 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: Andrew Jones , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= , Eduardo Habkost , Peter Crosthwaite , Marcelo Tosatti , "Dr . David Alan Gilbert" , Markus Armbruster , Brice Goglin , Paolo Bonzini , Igor Mammedov , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Following the legacy smp check rules, the die_id validity is added to the same contexts as leagcy smp variables such as hmp_hotpluggable_cpus(), machine_set_cpu_numa_node(), cpu_slot_to_string() and pc_cpu_pre_plug(). Signed-off-by: Like Xu Acked-by: Dr. David Alan Gilbert --- hmp.c | 3 +++ hw/core/machine.c | 12 ++++++++++++ hw/i386/pc.c | 11 +++++++++++ 3 files changed, 26 insertions(+) diff --git a/hmp.c b/hmp.c index 56a3ed7375..7deb7b7226 100644 --- a/hmp.c +++ b/hmp.c @@ -3112,6 +3112,9 @@ void hmp_hotpluggable_cpus(Monitor *mon, const QDict = *qdict) if (c->has_socket_id) { monitor_printf(mon, " socket-id: \"%" PRIu64 "\"\n", c->soc= ket_id); } + if (c->has_die_id) { + monitor_printf(mon, " die-id: \"%" PRIu64 "\"\n", c->die_id= ); + } if (c->has_core_id) { monitor_printf(mon, " core-id: \"%" PRIu64 "\"\n", c->core_= id); } diff --git a/hw/core/machine.c b/hw/core/machine.c index 5d046a43e3..5116429732 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -659,6 +659,11 @@ void machine_set_cpu_numa_node(MachineState *machine, return; } =20 + if (props->has_die_id && !slot->props.has_die_id) { + error_setg(errp, "die-id is not supported"); + return; + } + /* skip slots with explicit mismatch */ if (props->has_thread_id && props->thread_id !=3D slot->props.thre= ad_id) { continue; @@ -668,6 +673,10 @@ void machine_set_cpu_numa_node(MachineState *machine, continue; } =20 + if (props->has_die_id && props->die_id !=3D slot->props.die_id) { + continue; + } + if (props->has_socket_id && props->socket_id !=3D slot->props.sock= et_id) { continue; } @@ -925,6 +934,9 @@ static char *cpu_slot_to_string(const CPUArchId *cpu) if (cpu->props.has_socket_id) { g_string_append_printf(s, "socket-id: %"PRId64, cpu->props.socket_= id); } + if (cpu->props.has_die_id) { + g_string_append_printf(s, "die-id: %"PRId64, cpu->props.die_id); + } if (cpu->props.has_core_id) { if (s->len) { g_string_append_printf(s, ", "); diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 83ab53c814..00be2463af 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -2321,6 +2321,10 @@ static void pc_cpu_pre_plug(HotplugHandler *hotplug_= dev, error_setg(errp, "Invalid CPU socket-id: %u must be in range 0= :%u", cpu->socket_id, max_socket); return; + } else if (cpu->die_id > max_socket) { + error_setg(errp, "Invalid CPU die-id: %u must be in range 0:%u= ", + cpu->die_id, max_socket); + return; } if (cpu->core_id < 0) { error_setg(errp, "CPU core-id is not set"); @@ -2378,6 +2382,13 @@ static void pc_cpu_pre_plug(HotplugHandler *hotplug_= dev, } cpu->socket_id =3D topo.pkg_id; =20 + if (cpu->die_id !=3D -1 && cpu->die_id !=3D topo.die_id) { + error_setg(errp, "property die-id: %u doesn't match set apic-id:" + " 0x%x (die-id: %u)", cpu->die_id, cpu->apic_id, topo.die_id); + return; + } + cpu->die_id =3D topo.die_id; + if (cpu->core_id !=3D -1 && cpu->core_id !=3D topo.core_id) { error_setg(errp, "property core-id: %u doesn't match set apic-id:" " 0x%x (core-id: %u)", cpu->core_id, cpu->apic_id, topo.core_i= d); --=20 2.21.0