From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: redhat.com, ip: 209.132.183.28, mailfrom: lersek@redhat.com) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by groups.io with SMTP; Tue, 08 Oct 2019 04:27:23 -0700 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8167D87633; Tue, 8 Oct 2019 11:27:23 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-120-109.rdu2.redhat.com [10.10.120.109]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5D871600CE; Tue, 8 Oct 2019 11:27:22 +0000 (UTC) From: "Laszlo Ersek" To: edk2-devel-groups-io Cc: Ard Biesheuvel , Igor Mammedov , Jordan Justen Subject: [PATCH 3/4] OvmfPkg/IndustryStandard: define FW_CFG_X86_TOPOLOGY structure type Date: Tue, 8 Oct 2019 13:27:13 +0200 Message-Id: <20191008112714.6215-4-lersek@redhat.com> In-Reply-To: <20191008112714.6215-1-lersek@redhat.com> References: <20191008112714.6215-1-lersek@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Tue, 08 Oct 2019 11:27:23 +0000 (UTC) Content-Transfer-Encoding: quoted-printable pc-q35-4.2+ and pc-i440fx-4.2+ machine types report CPU topology info in the "etc/x86-smp-topology" fw_cfg file. Add a structure type for parsing this blob. Cc: Ard Biesheuvel Cc: Igor Mammedov Cc: Jordan Justen Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D1515 Signed-off-by: Laszlo Ersek --- OvmfPkg/Include/IndustryStandard/QemuFwCfg.h | 22 ++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/OvmfPkg/Include/IndustryStandard/QemuFwCfg.h b/OvmfPkg/Inclu= de/IndustryStandard/QemuFwCfg.h index 7969aba3ca61..fe410d4a3fc2 100644 --- a/OvmfPkg/Include/IndustryStandard/QemuFwCfg.h +++ b/OvmfPkg/Include/IndustryStandard/QemuFwCfg.h @@ -95,4 +95,26 @@ typedef struct { } FW_CFG_DMA_ACCESS; #pragma pack () =20 +// +// Structure describing the VCPU topology on IA32 and X64, in the fw_cfg= file +// named "etc/x86-smp-topology". +// +// All fields are little endian. +// +// The number of sockets (aka packages) can be calculated by dividing +// MaxLogicalProcessors by (DiesPerSocket * CoresPerDie * ThreadsPerCore= ), and +// rounding up the quotient. +// +// APIC ID field widths and offsets can be derived with the standard met= hod +// described in "Intel(R) 64 Architecture Processor Topology Enumeration= " +// . +// +#pragma pack (1) +typedef struct { + UINT32 DiesPerSocket; + UINT32 CoresPerDie; + UINT32 ThreadsPerCore; + UINT32 MaxLogicalProcessors; +} FW_CFG_X86_TOPOLOGY; +#pragma pack () #endif --=20 2.19.1.3.g30247aa5d201