From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mx.groups.io with SMTP id smtpd.web10.5249.1659998444396002937 for ; Mon, 08 Aug 2022 15:40:44 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=PJkq4PvJ; spf=pass (domain: intel.com, ip: 134.134.136.20, 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=1659998444; x=1691534444; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=ZiEo1RfAnBSTJ+b5y1sp2+ifidq5V5y7vvtQJKZMNP8=; b=PJkq4PvJrJnFVoOFcKdRPNi2kgHFtHj9x4ztOZRjEGCAwXT7+SLXj2U3 cRZxsB7TAUbA+RhrhSBxIKyymAz/YB+GJRbaRUwMTNNoWTfGtuMDgozPk 5MXUCgIrNGY+0AhtynljTGLczcW4aeb83o+J6aw8LEXeAFlVkgy33QS4v RQ5GkB4o2C33rxHoXqZDmBoz/iu/Uq2Bbw14Ef1EXBC8sMkl3II8JsEwH jgqCe1AsqI7ljAeDsJ3i9g7IoTAS0zEutXGmrlU7qftrmWpLh7/cCFEnb +GZm78ON4ZywjeYI9Cl+LhigBYBFFORvnGpJxomNEKwEe1fIn/jLEbID0 Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10433"; a="277640195" X-IronPort-AV: E=Sophos;i="5.93,222,1654585200"; d="scan'208";a="277640195" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Aug 2022 15:40:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,222,1654585200"; d="scan'208";a="730914851" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by orsmga004.jf.intel.com with ESMTP; 08 Aug 2022 15:40:43 -0700 Received: from orsmsx612.amr.corp.intel.com (10.22.229.25) 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:40:43 -0700 Received: from orsmsx601.amr.corp.intel.com (10.22.229.14) 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; Mon, 8 Aug 2022 15:40:41 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) 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 via Frontend Transport; Mon, 8 Aug 2022 15:40:41 -0700 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (104.47.51.40) 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:40:41 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=M8WgSuDar1HdGsecoEWMHarOqF5qvN8PPwAjlij63yylYp1LylFazOo4VddFBEprY6vxkt4NjIS7GlWCgKynWJxOQDtOixxM4KC18J6KlJCR97oc1YEGRwqXq4QUhhq1pD7AOf5zzMx/jxJDTxz/vCggkoBsAHxLTEU5l7IpF+cj+GOJfvFFOln4wMkbmetPFuVymbeM64fM+8QLzI1QbZomlX4xABhZqyLEIPMC0dXSp7gOBh9CYGkSfw5uV2ZQDXXRDglOeHlkDRArz47hTcjVTk4DSx7EUrd41z73eQk4GSitO2Li+SLBhD/bktc/QltMY4Mx4Xvgltc0i1+qhA== 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=aqODs1Yqb+gARBU2mvNi5oWnAdIlpixvO7JfH+fruQ4=; b=eLw1ORfxh3zBGltSnZdxzb5qf8eecS/OfGfV318+RvxPKwBjAiqKAHwAUTyLtSmgTpgv6Won/Kqnlms/PKLambGlJLU1qk+Y9hlK0M4VMvfEU7ceqtxb64Fx5AHilCJWaNn6k9i8JN48nnQAfzYxv3zvFVnuT5cX9XL6rXaE7Z77Tqp0tkhC9I8oDdd5wClCHkYzsFmMaeeTZg8AHODn+ORHoNhYzWEa9+Ji2DaExqysm+YNtWS9dwioAULyrTIs84JxppwIvg3wekGQP/UYc7klXRfW5yFWCTb+iqOOQHB2rre645N0M7RW/Dh9m8AJHYBQAQDLKnMbONy9Yx+OBQ== 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 DM6PR11MB4515.namprd11.prod.outlook.com (2603:10b6:5:2a9::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5504.14; Mon, 8 Aug 2022 22:40:39 +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:40:39 +0000 From: "Oram, Isaac W" To: "Sinha, Ankit" , "devel@edk2.groups.io" 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: AQHYq2qq8Bu9ZQGpe0e6jMAdIUw4ha2lmNAg Date: Mon, 8 Aug 2022 22:40:39 +0000 Message-ID: References: <20220808210511.466-1-ankit.sinha@intel.com> In-Reply-To: <20220808210511.466-1-ankit.sinha@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.6.500.17 dlp-reaction: no-action 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: 9d73f26d-e5bb-479a-a71a-08da798f04e3 x-ms-traffictypediagnostic: DM6PR11MB4515:EE_ x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: TPoK2uI6qf/+fofhMwHrnakWeP3J8gky4b9wuwTS27F1VGiwKQVLcktlACCV7F2NUbqSVAT/IRmUZOHD0fyXtUxK81fW7Q9o9Gb3lVuYBNz5iG4IamachqBptIXZH6yN9Ctjm+K/RtXayuSxk2GcpjeTP/Caq/O94dBsbUP7vurbP/W48WmSH8srEIZpHP/mJdz78qSKGJhKBPQVCV1rSKI2LZ3sxww1oYEB0A8X3ruzncPxOVOUOBS7ONRGnkiog4zPU62Dx3JyqSB2zUPFNUEb+eKjKF1/OjInd6/d+4UHlzxdURp/Vzigc9dz66xRhqlvFkJOHbLZ3AhmFtSKqnOABOnDKhd5BkhRoYvJNFp3/NibKThNrS8GzbiPTgVGyZlDzUaOYWqkvivgoFiOT5E+z0ZJL279oZGAMv12bHP6/tsQWwx+YhAewxiBO2Bc3yBkJo6iXjukbDQvllY6LyMFVx2ArXlJsGOm4R3T0o6DUvJs5U0/rCwR42A8HDGMLKADHoXnDe23Cs2/WhDA8X5/7h7YknZktcoRLeDY1uz0AqFuYc/MPF4wD/Cl0+vxdRokltr8wADRmji2oaWtrZUn49MJJR7x+hRap0ykyPbYy044iSovyFKXVgFW7WX/JAvD4nsGz2CVuGmnyxU+ox5iQ8IGMWeW0e9wWg0OAqLY9uT6wPw8uhqWxisM4YgTBUFbqYQuKf2t1rdaqpbDzrK41Osll3qlIBUt2T2Kswo1M7e7upb5Uf2jBng53fnkiKjfQ+pgqpOXrYJ1XLPfiDANOD8KLemhMV0xzYamnDMfnMWw9NtDvkS4vTistVXJxvw7RAB5IB1dup1E1MgO7t0n0Qjbp1luh3aCfbR9CfI= 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)(346002)(396003)(136003)(376002)(366004)(39860400002)(83380400001)(186003)(9686003)(26005)(107886003)(76116006)(4326008)(86362001)(316002)(33656002)(110136005)(2906002)(41300700001)(7696005)(6506007)(478600001)(66946007)(53546011)(66446008)(66556008)(66476007)(71200400001)(122000001)(38100700002)(64756008)(5660300002)(52536014)(54906003)(82960400001)(8676002)(38070700005)(55016003)(8936002);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?b8E565SlARV59z/vU96AfiBArTY1/tn8vy4HiU132UoLwnyj8+/yaI5AG9N6?= =?us-ascii?Q?nTgAF8DeLO2xfzS4xKnd0kjg6Lz44Kh+XcpMmgSWWPrcOuz0IzlD8Qm0PUMC?= =?us-ascii?Q?kD/oWKBxbqCbD30g2R9orrOygrosbS6+7Ne7TQRUOOfRz6KDlOCzEEe+zmNs?= =?us-ascii?Q?I5SvMLWp+acnZzuyak7PnnsxciikxG+2ykbXafHTIPGOmlR+nr22H+OhREwt?= =?us-ascii?Q?fd9G/t3TuzllrQYVvfBpaPeO3NoPlo8lAdYp0+tUx8tv+3rBp+1Rf7cd760L?= =?us-ascii?Q?fykWd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L?= =?us-ascii?Q?YwPECZCbNTpdBZ3joL2Bi7kLV/lBZNrlnZwR8kCFzpxm0ZFJNFkkoFLfCRT5?= =?us-ascii?Q?FYO8BLY5FDIAzfsEvETS2z96CPYU9/oR7wl70ciZJb17sXGpkTX2uawju4SE?= =?us-ascii?Q?RhMu27nAIz7MR7JEpizNv2dtYAxfPcGtMqLtlUzwT10dLSGZyq/MMelP3Js+?= =?us-ascii?Q?+EgJBdwTX0RwzTeKzdxLZi4+nKz+6+nyC2Yip6aDi9RuAGBQw0wOl3xamZ1k?= =?us-ascii?Q?46d1IYpz/w0lteKWaBog9ckif6wasQIXql2EXqiMrhsWWlYh0UPm5xvP6guU?= =?us-ascii?Q?u4XFuVPRb+EjU/V+c/CuPYMq/AR+qfUf6l/VuCH0GFb4mXAUPebKQ9KsDn93?= =?us-ascii?Q?MHGNZnY9ATqGxTUa4X1xy4XPyoazJhAxYNGNcLPm?= 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: 9d73f26d-e5bb-479a-a71a-08da798f04e3 X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Aug 2022 22:40:39.5034 (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: B3hQQ6NIrHz1e83fHKJqztxoZjnghCutCA5z70k0hzUzfRuroBMa3HVaQRkrTGfrrBMZf300qAwJ2P9srw/pdw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB4515 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 Reviewed-by: Isaac Oram -----Original Message----- From: Sinha, Ankit =20 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