From patchwork Fri Sep 6 19:12:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Babu Moger X-Patchwork-Id: 11135857 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 089F316B1 for ; Fri, 6 Sep 2019 19:14:10 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D48A42070C for ; Fri, 6 Sep 2019 19:14:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=amdcloud.onmicrosoft.com header.i=@amdcloud.onmicrosoft.com header.b="x0Fxmn0A" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D48A42070C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=amd.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:59538 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i6JgO-0004QP-LG for patchwork-qemu-devel@patchwork.kernel.org; Fri, 06 Sep 2019 15:14:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42273) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i6JeR-00026m-T2 for qemu-devel@nongnu.org; Fri, 06 Sep 2019 15:12:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i6JeQ-00048M-Lj for qemu-devel@nongnu.org; Fri, 06 Sep 2019 15:12:07 -0400 Received: from mail-eopbgr750085.outbound.protection.outlook.com ([40.107.75.85]:14086 helo=NAM02-BL2-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1i6JeQ-00048A-Gi for qemu-devel@nongnu.org; Fri, 06 Sep 2019 15:12:06 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=edoL2oLk+SBbcOQg7BYJhU9lMKgC401+bXNL/qlcbq0vyvmAvW+3zYBAT1Fmwg+1m1jxBuyz49ZZLaCRD2bkTQv9rq7eheXHV/z7E/67zq+90raZoJBFsM7qP7FqxmjvjBf0dha4SsWjiMy7sXMRZ099pAn2PblUDpBcunjSS4tfVxdR3M4YVIDhenqCcvboomLnGLvMCj3+0nOpy7cUncLoRfqxI8EKPpD5yakqU8dh0tfugQsVGwOE44ObXWqcmArGXVIyvql7jVZ4P9YMKiO9Bd2v92NteZAHCSrtT5S6wWBVohubalF3Av21RGgjshogxn5AzLj5WHeVM8wV+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=jwwieKg40gAfHsI/mULnbGH/hRQnzyM1XxmktU7VWiY=; b=BUvD3YrI4mkbdvi+j3BgqTnFNz93BqMdfte+pdQlHSikKmQazLWiNeza4t3DesFQE0Cv+hlfeVytY8M2KeD8d7Geu9fsc4zPjTdVdD0nhlYjeztEaiWlxApJfQqymvEask3PD2LlTPPuJ5zjNAPIikupvDscct+MlJ/Rvvaw1cmcvoQa9xI/fa5O5fvPiCU+MzU3rLGAZA10ueNEfrAfsDyw+3DyncNAA7x4ntRSJjzuRIGAuNih8m6bqkrbuJ2wp1CSCcWQpyusSslRcLrr340vTby/7L6ORX+bUESh9b2wkvRyPOs7Ll9f39F2naRUcPii61OuKshS/gn6IVuS8g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector2-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=jwwieKg40gAfHsI/mULnbGH/hRQnzyM1XxmktU7VWiY=; b=x0Fxmn0A/MypXUJVHNyl6jkF6pDr2xtGmqknP6IFgwdnq9EhhGNP0cwxXlgFm1GVnxqmbt0nN+E+z6dwzDdEaF7rtVatBNUOjw8adI9mbOgafvBseFe0K9oSoxarYxjuGnyUKYT/7hqZzyMWTmJoEeRymbf2AaQKL/YSWW7GfpY= Received: from DM5PR12MB2471.namprd12.prod.outlook.com (52.132.141.138) by DM5PR12MB1145.namprd12.prod.outlook.com (10.168.238.141) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2241.14; Fri, 6 Sep 2019 19:12:05 +0000 Received: from DM5PR12MB2471.namprd12.prod.outlook.com ([fe80::6c7c:4b6d:f136:1bf8]) by DM5PR12MB2471.namprd12.prod.outlook.com ([fe80::6c7c:4b6d:f136:1bf8%3]) with mapi id 15.20.2220.022; Fri, 6 Sep 2019 19:12:05 +0000 From: "Moger, Babu" To: ssg.sos.staff , "ehabkost@redhat.com" , "marcel.apfelbaum@gmail.com" , "mst@redhat.com" , "pbonzini@redhat.com" , "rth@twiddle.net" , "eblake@redhat.com" , "armbru@redhat.com" , "imammedo@redhat.com" Thread-Topic: [RFC 2 PATCH 04/16] machine: Add SMP Sockets in CpuTopology Thread-Index: AQHVZOb49iqY+dEK7EqEIoezGv+ilw== Date: Fri, 6 Sep 2019 19:12:04 +0000 Message-ID: <156779712350.21957.6312199085335942636.stgit@localhost.localdomain> References: <156779689013.21957.1631551572950676212.stgit@localhost.localdomain> In-Reply-To: <156779689013.21957.1631551572950676212.stgit@localhost.localdomain> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: SN6PR06CA0020.namprd06.prod.outlook.com (2603:10b6:805:8e::33) To DM5PR12MB2471.namprd12.prod.outlook.com (2603:10b6:4:b5::10) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Babu.Moger@amd.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [165.204.78.1] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 85efdba0-9553-4088-e743-08d732fe1acd x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600166)(711020)(4605104)(1401327)(4618075)(2017052603328)(7193020); SRVR:DM5PR12MB1145; x-ms-traffictypediagnostic: DM5PR12MB1145: x-ld-processed: 3dd8961f-e488-4e60-8e11-a82d994e183d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:5797; x-forefront-prvs: 0152EBA40F x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(376002)(396003)(366004)(39860400002)(136003)(346002)(199004)(189003)(2201001)(71190400001)(305945005)(7736002)(9686003)(52116002)(86362001)(71200400001)(6116002)(8936002)(6512007)(3846002)(6436002)(11346002)(103116003)(99286004)(6506007)(6486002)(26005)(4326008)(14454004)(5660300002)(386003)(476003)(102836004)(2906002)(25786009)(76176011)(2501003)(53936002)(8676002)(66446008)(446003)(186003)(66556008)(486006)(66946007)(66476007)(64756008)(110136005)(81166006)(81156014)(478600001)(66066001)(256004)(316002); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR12MB1145; H:DM5PR12MB2471.namprd12.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: amd.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: ud8EE0DthP2RVzUiAMqhWIKwxOjxhIBJvQMABzXR7XZGzO7HewpsmvJw/p8LSa2nTDNCLZB3fWr2A93m7GjAhRI6A8+puYvXiBgEqLl319Ur/hCDzkJ46QPR1o7sMGJFGY/R0X2K6hDH66As1wkPaT9eLA2IYP1O9sLhLgAOWn3W+VmeN55sUYnNh6Zn50PnwBqo0ris2n3xL8/oOF8flg/VZTbGL1gmaMzLHdSG67WMpXKYXRioQOnW2SjL3pzPMT8y4LgmaSkkQSJ15KgMkOj87cnDNy5eotHLEo6S5AML3L3vK9CLt4K0afya9Lj+4eB7WsULgq2gF1MP00dv7qNqw0vyY0SmwPtZkIgehPXmevmH9UGb7fVaHRkwHKc3vCEHg8/ztg0yEa2NLnL0Cm8Zfa42RVm6zO7xAnn+aDM= Content-ID: MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 85efdba0-9553-4088-e743-08d732fe1acd X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Sep 2019 19:12:05.0147 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: GWbzz1MIzG3R4RJYmRd/bYZMXymqKNHn2x4su72qRppMWkBieDk5QmtybT0ZWXg0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB1145 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 40.107.75.85 Subject: [Qemu-devel] [RFC 2 PATCH 04/16] machine: Add SMP Sockets in CpuTopology 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: "qemu-devel@nongnu.org" Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Store the smp Sockets in CpuTopology. Socket information is required to build the cpu topology in new epyc mode. Signed-off-by: Babu Moger Reviewed-by: Eduardo Habkost --- hw/core/machine.c | 1 + hw/i386/pc.c | 1 + include/hw/boards.h | 2 ++ vl.c | 1 + 4 files changed, 5 insertions(+) diff --git a/hw/core/machine.c b/hw/core/machine.c index c58a8e594e..4034b7e903 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -795,6 +795,7 @@ static void smp_parse(MachineState *ms, QemuOpts *opts) ms->smp.cpus = cpus; ms->smp.cores = cores; ms->smp.threads = threads; + ms->smp.sockets = sockets; } if (ms->smp.cpus > 1) { diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 95aab8e5e7..9e1c3f9f57 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1609,6 +1609,7 @@ void pc_smp_parse(MachineState *ms, QemuOpts *opts) ms->smp.cpus = cpus; ms->smp.cores = cores; ms->smp.threads = threads; + ms->smp.sockets = sockets; pcms->smp_dies = dies; } diff --git a/include/hw/boards.h b/include/hw/boards.h index a71d1a53a5..12eb5032a5 100644 --- a/include/hw/boards.h +++ b/include/hw/boards.h @@ -245,12 +245,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; diff --git a/vl.c b/vl.c index 711d2ae5da..473a688779 100644 --- a/vl.c +++ b/vl.c @@ -3981,6 +3981,7 @@ int main(int argc, char **argv, char **envp) current_machine->smp.max_cpus = machine_class->default_cpus; current_machine->smp.cores = 1; current_machine->smp.threads = 1; + current_machine->smp.sockets = 1; machine_class->smp_parse(current_machine, qemu_opts_find(qemu_find_opts("smp-opts"), NULL));