From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mx.groups.io with SMTP id smtpd.web11.5215.1659998621751895420 for ; Mon, 08 Aug 2022 15:43:42 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=Ew1F8i+t; spf=pass (domain: intel.com, ip: 192.55.52.88, mailfrom: isaac.w.oram@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1659998621; x=1691534621; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=wer7HN7K90Jc9XUlug7H+jGp1uP2yrCbCzbClLoX1wk=; b=Ew1F8i+t0e7aidWPAMDDeMTCC81YoFEzl9dRRvg4VozHlq5gdCfHkzgY mWUeq3dWyYUPESVZTm1Pplrwdg6IwkESIjPAyZ+6mQdw0D8yNaL4EE32J qvRbFCGnzu1R5UCG1SpqAENHjsVZUjbEaXg+o/bnE2+ZaNAFocaJGtQSi 4h4AGN6aQwYxPnDAIK2cQmnsPvHuWeMPYwOayh0xtMo/nvhdhHHGz81QF OQKtAyR1gZEgJuNgW87sx5qTHuG3yjVBLJchFn5fk6hgY+pNvXkrbr0i2 noQPs858FLD4o4LHn30qNG9lcDDVAusheJ0GvCKUP1FEjVPrOPNp50/iI A==; X-IronPort-AV: E=McAfee;i="6400,9594,10433"; a="316631312" X-IronPort-AV: E=Sophos;i="5.93,222,1654585200"; d="scan'208";a="316631312" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Aug 2022 15:43:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,222,1654585200"; d="scan'208";a="730915783" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by orsmga004.jf.intel.com with ESMTP; 08 Aug 2022 15:43:32 -0700 Received: from orsmsx609.amr.corp.intel.com (10.22.229.22) by ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Mon, 8 Aug 2022 15:43:31 -0700 Received: from orsmsx612.amr.corp.intel.com (10.22.229.25) by ORSMSX609.amr.corp.intel.com (10.22.229.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Mon, 8 Aug 2022 15:43:31 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx612.amr.corp.intel.com (10.22.229.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28 via Frontend Transport; Mon, 8 Aug 2022 15:43:31 -0700 Received: from NAM02-DM3-obe.outbound.protection.outlook.com (104.47.56.46) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2375.28; Mon, 8 Aug 2022 15:43:31 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MrGux5xBqG9vCxlE1XaeR5hrXWTVtiD14XUAp23fhKTHx8KqYyvaqbQqpo7XAaf19N+AsGi3BwmgbVsHpa6t9ZyISya9RvKuFdSExMRCGGsLjDQAaXQWxhNlOtTZrSG/TQeA30Nza9x+MHVg3YOf3H+8DnePwJEI6Z0DmdMDsbIqDRPTz/Oe8pY/GTh2skhPFOdxTWELgDoSO8Pdd4K6l5t1yfxbW1CYBXZybMokthJhUA6et48HzZodIC5ugr0j70jhs5noFD+h+zK29iq4PY1/yZFbfn0T7L2csm0Bkfb5uZq04rkEA/0oJNDoADtXfeEtdoUaPVEMrNlN9d9L6w== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=LxOnCphhs/HNhw7B7WquNC21txKuzoVDItOjp5eoRl8=; b=OWuiZ8Eu9XByLfe/hf5NLv+PMQvsA820mVZDPs5RUdb6MWYGmpa5DDGOpITpL4bg5GxHmUwmhEobwyzx9L3BmQPJc2nlmmJs8ZxbRA8s+S4oQ77LxdpJpFj3m0h5KDPP3k5hUOuyh6D4VDYawMttxFTjCCVt8oFRxjydZCtxk1+wf7p9c4HfR7soBjAhiz9rl0RlRhs1RNY8F/mCnL2OoJvadg0LScpSRQo0XvgPVaP5epqmAd6az4t9eLKzVGyKTMukWS9+E1NP+dpFomKtl7xBfPG/yqH7TUr1tiuX9X9svH6s1PeYYpPZrEb/G4I877AWYayhw9+ZWDVnzqWG6A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from SA1PR11MB5801.namprd11.prod.outlook.com (2603:10b6:806:23d::13) by SN6PR11MB3088.namprd11.prod.outlook.com (2603:10b6:805:ce::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5504.16; Mon, 8 Aug 2022 22:43:29 +0000 Received: from SA1PR11MB5801.namprd11.prod.outlook.com ([fe80::203f:2686:96f2:f8fe]) by SA1PR11MB5801.namprd11.prod.outlook.com ([fe80::203f:2686:96f2:f8fe%9]) with mapi id 15.20.5504.016; Mon, 8 Aug 2022 22:43:29 +0000 From: "Oram, Isaac W" To: "devel@edk2.groups.io" , "Oram, Isaac W" , "Sinha, Ankit" CC: "Desimone, Nathaniel L" , "Dong, Eric" Subject: Re: [edk2-devel][edk2-platforms][PATCH V3 1/1] MinPlatformPkg/AcpiTables: Add additional thread mapping in MADT Thread-Topic: [edk2-devel][edk2-platforms][PATCH V3 1/1] MinPlatformPkg/AcpiTables: Add additional thread mapping in MADT Thread-Index: AQHYq2qq8Bu9ZQGpe0e6jMAdIUw4ha2lmNAggAAA2oA= Date: Mon, 8 Aug 2022 22:43:29 +0000 Message-ID: References: <20220808210511.466-1-ankit.sinha@intel.com> <17097FCA6B608DF0.19746@groups.io> In-Reply-To: <17097FCA6B608DF0.19746@groups.io> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: f194881c-d572-491f-051e-08da798f6a5b x-ms-traffictypediagnostic: SN6PR11MB3088:EE_ x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: rQLqldYJs6km6la7tqGu5mqBvZQLJdPRfSU0oHVtmyJZHTVpON5HdV4pA49IxoS7QqNEe8TGgq48kpqsgJ501pS3R10ZSwcqbeSVPL4VHfWfjAynFW+oodazfVFW+nICRMr1NzMJf3Nxw3ekng3PEK/d2/B16LqStPpaz8oV0MaFmyXgsm4KyGdgG7+2Fau4fA/hoX/70puCGqUIpKTfkr3b+QkSNlHLo1sLHCtQdO5Sqx6tjaQGbGq2iFg55yPmMTGB7tQEbPf1+WJMtE4KXLbOhekN5IxACcrf/tubrGph0l67dXtpw3plZEodImdTLrr4FE/Js0bOLLnLOzrCEkSQAFVt2ewYOIlcltFFpK5n19IfitFKCc4wRF4scqO9ecSeszd0wCzF/MtATK2gX/19Patub871hYGNgZbF6EBeWreJKvMDelexTfq692bwZ8D0OkDK78eHRIDUQP+qncGM7pQgr5vzyIzN67yA7M32QLF9q+Mxx6MfxFPyt9LI+9qXRwybdSyr9xQg+5O6hZESrGt90HWWVbmKuFE2wL5SFYeu6QSh5oMubQSGTAkVOvpct8ZiToxllN0pwaHSf+9i120dI/nHF59C3B7rJ7Tx46+jPT5sXO8mAAelwHSJMmbV03ULTq09itU0ciQAfIwk6l8CydyVcbxBv91Vuy/BXpO7iFqDLhx/Gydbu/J1ENCjkMNGdd2OG3nIVfzQKYXq9araRQ2dw9PuAQH1OR2C/cOiAJ061qnuXJyM2BFEHvLAiq9pc6RUMDqAbhP0MI/eLgBBpDa7rtZR+mNeMc22BF079jWvAKIMGwwVuQytBVAlv2XTahVG1Y+A1nCkdY5EZdS+lNEXJbpCQoZRCHTi0+GbVS5QXHNVwXCLTrKz x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SA1PR11MB5801.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(376002)(366004)(346002)(39860400002)(136003)(396003)(2906002)(966005)(122000001)(478600001)(82960400001)(9686003)(26005)(41300700001)(107886003)(7696005)(186003)(33656002)(83380400001)(53546011)(55016003)(6506007)(4326008)(66556008)(66476007)(8676002)(64756008)(76116006)(38070700005)(54906003)(66946007)(6636002)(110136005)(71200400001)(86362001)(316002)(5660300002)(38100700002)(8936002)(66446008)(52536014);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?3bGcbzR5D9MCga2IAffxyMIepjuHO/ts0VtGD9hMYS0aKmg2KlGnHLBLsU9M?= =?us-ascii?Q?xHnXrSQp15+MMtnBmMcqKx4uX8PN88ZZaicTla7iajr3rO8P4gjdUtCd6wOT?= =?us-ascii?Q?Ekeg2tIw/mY1ULxPg7hSWqoSBS7PUtKLFEByo4dYlqnGjKluliLBgl1nQbjG?= =?us-ascii?Q?opsNyNOfwbk5rTVA9GUwPaQPgPs21jngoP593bjuxMOvP4MJgrYTSjfQLWzG?= =?us-ascii?Q?m/ovQGaRi2wb9xslQAj74iCoBMfh09OGjTKvVf/3UVy0Q0jXAo/BwuQFBOaZ?= =?us-ascii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ot72OSlSQ4kMaUg4?= =?us-ascii?Q?C0yTqnkvj2ZnQCieWJ3vgXi1YYt6vwJS+bdElUrkqfvy8OzyjjZyhPt/0/MR?= =?us-ascii?Q?rHb6vJ3P5OxwRjUyJ+YplebbQZk/q3HWYLZqUBKq+FvsvE4DZjOAfzQERS2t?= =?us-ascii?Q?TgrhM39NliIWA3cWSTDtjHdvwY+2xIyjuHDge0fmmg6v2uIS/2+8Q8+6UDuz?= =?us-ascii?Q?yFkQI8+KvCyG6U3u5ipSgYAqoLKiDg1J9f+jDdWNQYTxlO2i9y05vjBJOAOM?= =?us-ascii?Q?AuJx+x7ag3uWdN3YXh5JbPBlwaK34DfPF7KofLK7GS5ek3i5t3lLvTK2fnsO?= =?us-ascii?Q?TfT8bJSAP357bwijH4MyslHAIkhw5nqwBDH0QoPmi5ZPOl6vxqJ/h3m9q3rB?= =?us-ascii?Q?wnXMa/V1zg55yPJrrhieWGK4R4NrGqi5IjvX8tEA?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SA1PR11MB5801.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: f194881c-d572-491f-051e-08da798f6a5b X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Aug 2022 22:43:29.7512 (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: VxpCFBlPqWHfKGkaHYYnYwh3/MRjVM7x1+xP4Ga6hzwaKCjacHLn+1h/B6kJ7/Jv/98re6qjWkAmU4+3lGGbPA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR11MB3088 Return-Path: isaac.w.oram@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Pushed as d85e4251ce..306c2d1cef -----Original Message----- From: devel@edk2.groups.io On Behalf Of Oram, Isaac = W Sent: Monday, August 8, 2022 3:41 PM To: Sinha, Ankit ; devel@edk2.groups.io Cc: Desimone, Nathaniel L ; Dong, Eric Subject: Re: [edk2-devel][edk2-platforms][PATCH V3 1/1] MinPlatformPkg/Acpi= Tables: Add additional thread mapping in MADT Reviewed-by: Isaac Oram -----Original Message----- From: Sinha, Ankit Sent: Monday, August 8, 2022 2:05 PM To: devel@edk2.groups.io Cc: Oram, Isaac W ; Desimone, Nathaniel L ; Dong, Eric Subject: [edk2-devel][edk2-platforms][PATCH V3 1/1] MinPlatformPkg/AcpiTabl= es: Add additional thread mapping in MADT Add mapping for all enabled and disabled threads in MADT Cc: Isaac Oram Cc: Nate DeSimone Cc: Eric Dong Signed-off-by: Ankit Sinha --- Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c | 49 ++++++++= +++--------- 1 file changed, 28 insertions(+), 21 deletions(-) diff --git a/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c b= /Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c index e68b6070607f..5a282e7c18f2 100644 --- a/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c +++ b/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c @@ -243,46 +243,54 @@ SortCpuLocalApicInTable ( } } =20 - // - // 1. Sort TempCpuApicIdOrderTable, - // sort it by using ApicId from minimum to maximum (Socket0 to Socket= N), and the BSP must in the fist location of the table. - // So, start sorting the table from the second element and total elem= ents are mNumberOfCpus-1. - // + /* + 1. Sort TempCpuApicIdOrderTable, + Sort it by using ApicId from minimum to maximum (Socket0 to Socket= N), and the BSP must be in the fist location of the table. + + 2. Sort and map all the enabled threads after BSP in=20 + CpuApicIdOrderTable + + 3. Threads that are not enabled are placed in the bottom of=20 + CpuApicIdOrderTable + + 4. Re-assign AcpiProcessorId for AcpiProcessorUid uses purpose. + */ + PerformQuickSort ((TempCpuApicIdOrderTable + 1), (mNumberOfCpus - 1), si= zeof (EFI_CPU_ID_ORDER_MAP), (SORT_COMPARE) ApicIdCompareFunction); =20 - // - // 2. Sort and map the primary threads to the front of the CpuApicIdOrde= rTable - // for (CurrProcessor =3D 0, Index =3D 0; Index < mNumberOfCpus; Index++) { - if ((TempCpuApicIdOrderTable[Index].Thread) =3D=3D 0) { // primary thr= ead + if ((TempCpuApicIdOrderTable[Index].Thread) =3D=3D 0) { CopyMem (&mCpuApicIdOrderTable[CurrProcessor], &TempCpuApicIdOrderTa= ble[Index], sizeof (EFI_CPU_ID_ORDER_MAP)); CurrProcessor++; } } =20 - // - // 3. Sort and map the second threads to the middle of the CpuApicIdOrde= rTable - // for (Index =3D 0; Index < mNumberOfCpus; Index++) { - if ((TempCpuApicIdOrderTable[Index].Thread) =3D=3D 1) { //second threa= d + if ((TempCpuApicIdOrderTable[Index].Thread) =3D=3D 1) { CopyMem (&mCpuApicIdOrderTable[CurrProcessor], &TempCpuApicIdOrderTa= ble[Index], sizeof (EFI_CPU_ID_ORDER_MAP)); CurrProcessor++; } } =20 - // - // 4. Sort and map the not enabled threads to the bottom of the CpuApicI= dOrderTable - // for (Index =3D 0; Index < mNumberOfCpus; Index++) { - if (TempCpuApicIdOrderTable[Index].Flags =3D=3D 0) { // not enabled + if ((TempCpuApicIdOrderTable[Index].Thread) =3D=3D 2) { + CopyMem (&mCpuApicIdOrderTable[CurrProcessor], &TempCpuApicIdOrderTa= ble[Index], sizeof (EFI_CPU_ID_ORDER_MAP)); + CurrProcessor++; + } + } + + for (Index =3D 0; Index < mNumberOfCpus; Index++) { + if ((TempCpuApicIdOrderTable[Index].Thread) =3D=3D 3) { + CopyMem (&mCpuApicIdOrderTable[CurrProcessor], &TempCpuApicIdOrderTa= ble[Index], sizeof (EFI_CPU_ID_ORDER_MAP)); + CurrProcessor++; + } + } + + for (Index =3D 0; Index < mNumberOfCpus; Index++) { + if (TempCpuApicIdOrderTable[Index].Flags =3D=3D 0) { CopyMem (&mCpuApicIdOrderTable[CurrProcessor], &TempCpuApicIdOrderTa= ble[Index], sizeof (EFI_CPU_ID_ORDER_MAP)); CurrProcessor++; } } =20 - // - // 5. Re-assign AcpiProcessorId for AcpiProcessorUid uses purpose. - // for (Socket =3D 0; Socket < FixedPcdGet32 (PcdMaxCpuSocketCount); Socket= ++) { for (CurrProcessor =3D 0, Index =3D 0; CurrProcessor < mNumberOfCpus; = CurrProcessor++) { if (mCpuApicIdOrderTable[CurrProcessor].Flags && (mCpuApicIdOrderTab= le[CurrProcessor].SocketNum =3D=3D Socket)) { @@ -292,7 +300,6 @@ SortCpuLo= calApicInTable ( } } =20 - //keep for debug purpose DEBUG ((DEBUG_INFO, "APIC ID Order Table ReOrdered\n")); DebugDisplayReOrderTable (mCpuApicIdOrderTable); =20 -- 2.27.0.windows.1