From nobody Fri Nov 14 03:48:36 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.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; dkim=fail; spf=pass (zohomail.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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1584494604; cv=none; d=zohomail.com; s=zohoarc; b=cmLGShn2wwnhs0DLqGJT5DIMSqjCb6CsyqJYp/4fc4QVQyRXH39WV+M82E5VC36svi3ozr7MOQLlP/bdtIJddWXXGh1vkrv0cbYIRO3FAPfEZo1zOiFoc97ciat5afogZPx8gU4LglKqzniMy+ePXgy+LuaAOcCEy1Eu5wZgGX4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1584494604; h=Content-Type: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; bh=KXPYI74UUQLKfuswF4jeS8KuX070oe1Vo0knYTlRAvE=; b=AAUl8lR4IH+qZIiPj2R8bpje7HPHDLMg94bCMyRdro6jHocUhRf6Lv5N9NeRCw7iLCtV5TkkBPdsf58uViBXXAAEnbf8FgGY7QZj1aM4s2zq1Nvjgp2cHqWaOCme4th8IwV8Nn1KwXLdoeF37wpx06qwdvEMq+K95wL6+UnTilA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.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 1584494604429466.36262806108607; Tue, 17 Mar 2020 18:23:24 -0700 (PDT) Received: from localhost ([::1]:44036 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jENQZ-0002h8-Aj for importer@patchew.org; Tue, 17 Mar 2020 21:23:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34638) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jENLl-0004Y6-Nk for qemu-devel@nongnu.org; Tue, 17 Mar 2020 21:18:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jENLk-0002eS-DO for qemu-devel@nongnu.org; Tue, 17 Mar 2020 21:18:25 -0400 Received: from us-smtp-delivery-74.mimecast.com ([63.128.21.74]:35816) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jENLk-0002Zi-90 for qemu-devel@nongnu.org; Tue, 17 Mar 2020 21:18:24 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-452-bu98x6YYO9-7J4_KFYQlSw-1; Tue, 17 Mar 2020 21:18:18 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 95431DB60; Wed, 18 Mar 2020 01:18:17 +0000 (UTC) Received: from localhost (ovpn-118-148.rdu2.redhat.com [10.10.118.148]) by smtp.corp.redhat.com (Postfix) with ESMTP id 79BCC19C58; Wed, 18 Mar 2020 01:18:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1584494303; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KXPYI74UUQLKfuswF4jeS8KuX070oe1Vo0knYTlRAvE=; b=LyxqXN0Nj67FLzIBZk2QAxIFJrQXL0zhKTdwv8ygCvZVLw530R/meXBw1ZX9v3H8kQToMJ +diGLIKClB4epmJ/iEgaeL8pHxYl9Oe5oCx/yStLDfoAYOmHhC0T4X0OWMIPPhvxPk5U0w UD/qdLuaRYHCkzNBRga91aXfku2wkCw= X-MC-Unique: bu98x6YYO9-7J4_KFYQlSw-1 From: Eduardo Habkost To: qemu-devel@nongnu.org, Peter Maydell Subject: [PULL 10/13] machine: Add SMP Sockets in CpuTopology Date: Tue, 17 Mar 2020 21:17:45 -0400 Message-Id: <20200318011748.2104336-11-ehabkost@redhat.com> In-Reply-To: <20200318011748.2104336-1-ehabkost@redhat.com> References: <20200318011748.2104336-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 63.128.21.74 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , "Michael S . Tsirkin" , Babu Moger , Igor Mammedov , Paolo Bonzini , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Babu Moger Store the smp sockets in CpuTopology. The socket information required to build the apic id in EPYC mode. Right now socket information is not passed to down when decoding the apic id. Add the socket information here. Signed-off-by: Babu Moger Reviewed-by: Eduardo Habkost Reviewed-by: Igor Mammedov Acked-by: Michael S. Tsirkin Message-Id: <158396718647.58170.2278448323151215741.stgit@naples-babu.amd.c= om> --- hw/core/machine.c | 1 + hw/i386/pc.c | 1 + include/hw/boards.h | 2 ++ softmmu/vl.c | 1 + 4 files changed, 5 insertions(+) diff --git a/hw/core/machine.c b/hw/core/machine.c index 4778bc6b08..b958cd1b99 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -757,6 +757,7 @@ static void smp_parse(MachineState *ms, QemuOpts *opts) ms->smp.cpus =3D cpus; ms->smp.cores =3D cores; ms->smp.threads =3D threads; + ms->smp.sockets =3D sockets; } =20 if (ms->smp.cpus > 1) { diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 662abb549d..05e7f1090f 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -781,6 +781,7 @@ void pc_smp_parse(MachineState *ms, QemuOpts *opts) ms->smp.cpus =3D cpus; ms->smp.cores =3D cores; ms->smp.threads =3D threads; + ms->smp.sockets =3D sockets; x86ms->smp_dies =3D dies; } =20 diff --git a/include/hw/boards.h b/include/hw/boards.h index c96120d15f..236d239c19 100644 --- a/include/hw/boards.h +++ b/include/hw/boards.h @@ -236,12 +236,14 @@ typedef struct DeviceMemoryState { * @cpus: the number of present logical processors on the machine * @cores: the number of cores in one package * @threads: the number of threads in one core + * @sockets: the number of sockets on the machine * @max_cpus: the maximum number of logical processors on the machine */ typedef struct CpuTopology { unsigned int cpus; unsigned int cores; unsigned int threads; + unsigned int sockets; unsigned int max_cpus; } CpuTopology; =20 diff --git a/softmmu/vl.c b/softmmu/vl.c index 6a285925b3..1d33a28340 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -3946,6 +3946,7 @@ void qemu_init(int argc, char **argv, char **envp) current_machine->smp.max_cpus =3D machine_class->default_cpus; current_machine->smp.cores =3D 1; current_machine->smp.threads =3D 1; + current_machine->smp.sockets =3D 1; =20 machine_class->smp_parse(current_machine, qemu_opts_find(qemu_find_opts("smp-opts"), NULL)); --=20 2.24.1