From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 3427E740034 for ; Mon, 1 Apr 2024 07:45:24 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=SEO7nlIpiyurjX9whi+aGZL9K4/OzOr/4yfsFhD51Ag=; c=relaxed/simple; d=groups.io; h=From:To:CC:Subject:Thread-Topic:Thread-Index:Date:Message-ID:References:In-Reply-To:Accept-Language:msip_labels:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type; s=20240206; t=1711957522; v=1; b=tSbKBT6681nFtLxOs5Dbp7ypGidC+h6xOjsr9hdwNvcgeR+C+6pbxdRmcsWU5Koj3fZSBS4+ vMOP12Msg5shIgo8DREyVICnbxLss5w6BPhR0yaPTQAXBGo/f+LC0t0vt2YdoFToMuJupYGzrvh cqf+0hR1iPSrRdP4E48U3d3t2gAn+bmMpOyGcMhsVHtiVf8ROZo6xoRXTjsspC9qQqpYVDoORDf zjoS5tvOhUJW8ikhy2WsMCM1GuakOlpyN4FaPg/bglyz8tUwOIyKTmaoGtzB+xp60JogI0ZLqkb wFmPbqyYQuvlU6WtMJyXORpDt9Mif0IcvA32S/ofvX8Ww== X-Received: by 127.0.0.2 with SMTP id KvTwYY7687511x79bHjc7SNH; Mon, 01 Apr 2024 00:45:22 -0700 X-Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.10]) by mx.groups.io with SMTP id smtpd.web10.32691.1711957522173882757 for ; Mon, 01 Apr 2024 00:45:22 -0700 X-CSE-ConnectionGUID: KCWdbxHMRo6nuhXh1sqfaw== X-CSE-MsgGUID: ivTF3j1kS5KfboHr6gsVIg== X-IronPort-AV: E=McAfee;i="6600,9927,11030"; a="24527978" X-IronPort-AV: E=Sophos;i="6.07,171,1708416000"; d="scan'208,217";a="24527978" X-Received: from fmviesa006.fm.intel.com ([10.60.135.146]) by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Apr 2024 00:45:16 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,171,1708416000"; d="scan'208,217";a="17670343" X-Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by fmviesa006.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 01 Apr 2024 00:45:15 -0700 X-Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Mon, 1 Apr 2024 00:45:15 -0700 X-Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Mon, 1 Apr 2024 00:45:14 -0700 X-Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35 via Frontend Transport; Mon, 1 Apr 2024 00:45:14 -0700 X-Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.168) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Mon, 1 Apr 2024 00:45:14 -0700 X-Received: from MN6PR11MB8244.namprd11.prod.outlook.com (2603:10b6:208:470::14) by DS7PR11MB7836.namprd11.prod.outlook.com (2603:10b6:8:e3::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7452.24; Mon, 1 Apr 2024 07:45:12 +0000 X-Received: from MN6PR11MB8244.namprd11.prod.outlook.com ([fe80::2c31:82b7:9f26:5817]) by MN6PR11MB8244.namprd11.prod.outlook.com ([fe80::2c31:82b7:9f26:5817%5]) with mapi id 15.20.7409.031; Mon, 1 Apr 2024 07:45:12 +0000 From: "Ni, Ray" To: "Tan, Dun" , "devel@edk2.groups.io" CC: "Lou, Yun" , "Chiu, Chasel" , "Desimone, Nathaniel L" , Liming Gao , "Dong, Eric" Subject: Re: [edk2-devel] [edk2-platforms V2] MinPlatformPkg: Corret AcpiProcessorUid in MADT Thread-Topic: [edk2-platforms V2] MinPlatformPkg: Corret AcpiProcessorUid in MADT Thread-Index: AQHag/nTMKxbNd87ZkO4Zd6nRNyQ9rFTCQKJ Date: Mon, 1 Apr 2024 07:45:12 +0000 Message-ID: References: <20240401055934.1704-1-dun.tan@intel.com> In-Reply-To: <20240401055934.1704-1-dun.tan@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MN6PR11MB8244:EE_|DS7PR11MB7836:EE_ x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: iwZyjxJaMnz4ls6HXkxgDPnUT1k3gjdlCvCdk2yPc3ki3WFD9FjPokqFZ7XFn66SHgsAq6mJXaXnSvbPkOYJ/qHUg9GpIkY+hr6MUCM4WU6AkXaFtcJbB4LSYTf4Ht+iRcdOx8j6PIt2VVhQuC6SaBntiPVCrUP6P7l5U2VCEU66HKnOaJ495FxeiTTPGX2olBhg1yAhs81muHct3RwWHtfWGU0hAT0AWXFyWRIxBorGlLfbMg1vjbaicUxbsUu1MvuDLgjIbXN4wq8OedtbuefVpIUBEAmNmKS3OosCw+p8hk9yrMWRz1eE7AAGHWEhhPN5DFQ0BDa3PVQA2vDSS3dyZ5PfD2XW6M1q+ZSwZBhUnt2QFXZeyAzSZ0LkzZf1q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J5SBnyI947NnBNUzmEU8+JwzFKZEX65dNYox/1fWTFsbSL0/Bv5?= =?us-ascii?Q?DgE7L2mBs9dqixmZCHurzkdanm31G7r93Z67lCiAq8NlYtBFGP4YTC9iRyo4?= =?us-ascii?Q?nm8Z4/MwANdonC5zzvo=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MN6PR11MB8244.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6bba023a-c767-413a-4e1d-08dc521fa98d X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Apr 2024 07:45:12.1505 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: mDyoCVhZeWQVjJQQpzNq04Ghyr8iGcLJm87zkeNU3+GGEixsuonGg7aZ97TMQ+mJJosNhLB7epHiMukhkzYfOg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR11MB7836 X-OriginatorOrg: intel.com Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Resent-Date: Mon, 01 Apr 2024 00:45:22 -0700 Reply-To: devel@edk2.groups.io,ray.ni@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: fcVSSPj02CxWDuiiyXPC2QA0x7686176AA= Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_MN6PR11MB8244E7C79545A47E97B26C918C3F2MN6PR11MB8244namp_" X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=tSbKBT66; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=intel.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io --_000_MN6PR11MB8244E7C79545A47E97B26C918C3F2MN6PR11MB8244namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Ray Ni Thanks, Ray ________________________________ From: Tan, Dun Sent: Monday, April 1, 2024 13:59 To: devel@edk2.groups.io Cc: Ni, Ray ; Lou, Yun ; Chiu, Chasel = ; Desimone, Nathaniel L ; Liming Gao ; Dong, Eric Subject: [edk2-platforms V2] MinPlatformPkg: Corret AcpiProcessorUid in MAD= T Change AcpiProcessorUid in CpuApicIdOrderTable to the index in MpService regardless of disabled core. Let's take a simple example: There are 2 enabled cores and 1 disabled core. APICID Index in MpService 0x0000_0000 0 0x0000_0010(disbaled) 1 0x0000_0040 2 With current implementation, the results of the x2apic structure entries in MADT are: MADT Entry APICID AcpiProcessorUid 0 0x0000_0000 0 1 0x0000_0040 1 The AcpiProcessorUid will be associated with the processor device defined in DSDT/SSDT. To make sure the x2apic structure entries in MADT can be mapped to the right processor devices in DSDT, the AcpiProcessorUid of the second x2apic structure entry in MADT should be kept as 2, which is the core index in MpService. Signed-off-by: Dun Tan Cc: Ray Ni Cc: Jason Lou Cc: Chasel Chiu Cc: Nate DeSimone Cc: Liming Gao Cc: Eric Dong --- Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c b= /Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c index 2a833ec99c..f6ea7454d3 100644 --- a/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c +++ b/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c @@ -190,7 +190,7 @@ CreateCpuLocalApicInTable ( // for (Socket =3D 0; Socket < FixedPcdGet32 (PcdMaxCpuSocketCount); Socket= ++) { for (CurrProcessor =3D 0, Index =3D 0; CurrProcessor < mNumberOfCpus; = CurrProcessor++) { - if (CpuApicIdOrderTable[CurrProcessor].Flags && (CpuApicIdOrderTable= [CurrProcessor].SocketNum =3D=3D Socket)) { + if (CpuApicIdOrderTable[CurrProcessor].SocketNum =3D=3D Socket) { CpuApicIdOrderTable[CurrProcessor].AcpiProcessorUid =3D (CpuApicId= OrderTable[CurrProcessor].SocketNum << mNumOfBitShift) + Index; Index++; } -- 2.31.1.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#117283): https://edk2.groups.io/g/devel/message/117283 Mute This Topic: https://groups.io/mt/105259071/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- --_000_MN6PR11MB8244E7C79545A47E97B26C918C3F2MN6PR11MB8244namp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable
Reviewed-by: Ray Ni <ray.ni@intel.com>

Thanks,
Ray

From: Tan, Dun <dun.tan@= intel.com>
Sent: Monday, April 1, 2024 13:59
To: devel@edk2.groups.io <devel@edk2.groups.io>
Cc: Ni, Ray <ray.ni@intel.com>; Lou, Yun <yun.lou@intel.com= >; Chiu, Chasel <chasel.chiu@intel.com>; Desimone, Nathaniel L <= ;nathaniel.l.desimone@intel.com>; Liming Gao <gaoliming@byosoft.com.c= n>; Dong, Eric <eric.dong@intel.com>
Subject: [edk2-platforms V2] MinPlatformPkg: Corret AcpiProcessorUid= in MADT
 
Change AcpiProcessorUid in CpuApicIdOrderTable to<= br> the index in MpService regardless of disabled core.

Let's take a simple example:
There are 2 enabled cores and 1 disabled core.
  APICID           I= ndex in MpService
0x0000_0000          &nbs= p;     0
0x0000_0010(disbaled)      1
0x0000_0040          &nbs= p;     2

With current implementation, the results of the x2apic
structure entries in MADT are:
MADT Entry      APICID     Acp= iProcessorUid
    0         0x0000= _0000          0
    1         0x0000= _0040          1

The AcpiProcessorUid will be associated with the
processor device defined in DSDT/SSDT. To make sure
the x2apic structure entries in MADT can be mapped to
the right processor devices in DSDT, the AcpiProcessorUid
of the second x2apic structure entry in MADT should
be kept as 2, which is the core index in MpService.

Signed-off-by: Dun Tan <dun.tan@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Jason Lou <yun.lou@intel.com>
Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Eric Dong <eric.dong@intel.com>
---
 Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c | 2 +-  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c b= /Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c
index 2a833ec99c..f6ea7454d3 100644
--- a/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c
+++ b/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c
@@ -190,7 +190,7 @@ CreateCpuLocalApicInTable (
   //
   for (Socket =3D 0; Socket < FixedPcdGet32 (PcdMaxCpuSocketC= ount); Socket++) {
     for (CurrProcessor =3D 0, Index =3D 0; CurrProcess= or < mNumberOfCpus; CurrProcessor++) {
-      if (CpuApicIdOrderTable[CurrProcessor].Flag= s && (CpuApicIdOrderTable[CurrProcessor].SocketNum =3D=3D Socket)) = {
+      if (CpuApicIdOrderTable[CurrProcessor].Sock= etNum =3D=3D Socket) {
         CpuApicIdOrderTable[CurrPr= ocessor].AcpiProcessorUid =3D (CpuApicIdOrderTable[CurrProcessor].SocketNum= << mNumOfBitShift) + Index;
         Index++;
       }
--
2.31.1.windows.1

_._,_._,_

Groups.io Links:

=20 You receive all messages sent to this group. =20 =20

View/Reply Online (#117283) | =20 | Mute= This Topic | New Topic
Your Subscriptio= n | Contact Group Owner | Unsubscribe [rebecca@openfw.io]

_._,_._,_
--_000_MN6PR11MB8244E7C79545A47E97B26C918C3F2MN6PR11MB8244namp_--