From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mx.groups.io with SMTP id smtpd.web12.1731.1580709544086259002 for ; Sun, 02 Feb 2020 21:59:04 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.115, mailfrom: star.zeng@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Feb 2020 21:59:03 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,396,1574150400"; d="scan'208";a="225076004" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by fmsmga008.fm.intel.com with ESMTP; 02 Feb 2020 21:59:03 -0800 Received: from shsmsx108.ccr.corp.intel.com (10.239.4.97) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sun, 2 Feb 2020 21:59:02 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.126]) by SHSMSX108.ccr.corp.intel.com ([169.254.8.98]) with mapi id 14.03.0439.000; Mon, 3 Feb 2020 13:59:01 +0800 From: "Zeng, Star" To: "Ni, Ray" , Ray Ni , "devel@edk2.groups.io" CC: "Dong, Eric" , "Kinney, Michael D" , "Zeng, Star" Subject: Re: [PATCH v2 3/3] UefiCpuPkg/CpuFeature: Introduce First to indicate 1st unit. Thread-Topic: [PATCH v2 3/3] UefiCpuPkg/CpuFeature: Introduce First to indicate 1st unit. Thread-Index: AQHVpCEqq2O5kWjKlE2gLmpXzSLbhafKyWGQgAud1gCAMv41QA== Date: Mon, 3 Feb 2020 05:59:01 +0000 Message-ID: <0C09AFA07DD0434D9E2A0C6AEB04831040534FC4@shsmsx102.ccr.corp.intel.com> References: <20191126061550.494828-1-niruiyu@users.noreply.github.com> <20191126061550.494828-4-niruiyu@users.noreply.github.com> <0C09AFA07DD0434D9E2A0C6AEB048310404960B6@shsmsx102.ccr.corp.intel.com> <734D49CCEBEEF84792F5B80ED585239D5C3D170B@SHSMSX104.ccr.corp.intel.com> In-Reply-To: <734D49CCEBEEF84792F5B80ED585239D5C3D170B@SHSMSX104.ccr.corp.intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: star.zeng@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Got the point. With the typo fixed, Reviewed-by: Star Zeng > -----Original Message----- > From: Ni, Ray > Sent: Thursday, January 2, 2020 11:15 AM > To: Zeng, Star ; Ray Ni > ; devel@edk2.groups.io > Cc: Dong, Eric ; Kinney, Michael D > > Subject: RE: [PATCH v2 3/3] UefiCpuPkg/CpuFeature: Introduce First to ind= icate > 1st unit. >=20 > > > > Need some patches to update individual InitializeFunc() for features. > > These patches can be a separated patch series. > > > Yes. >=20 > > > > > > The patch adds a new field Fist to indicate the CPU's location in > > > > "Firt" should be "First". > Will fix the typo in next version of patch or pushing. >=20 > > > + // > > > + // Set First.Die/Tile/Module for each thread assuming: > > > + // single Die under each package, single Tile under each Die, sin= gle > > Module > > > under each Tile > > > > This assumption needs to be addressed in this or a separated patch seri= es. >=20 > The assumption will be fixed after the below changes are merged to trunk. > https://github.com/tianocore/edk2-staging/tree/cpu/6-level >=20 >=20 > > > + for (PackageIndex =3D 0; PackageIndex < CpuStatus->PackageCount; > > > PackageIndex++) { > > > + // > > > + // Set First.Core for each thread in the first core of each pack= age. > > > + // > > > + First =3D MAX_UINT32; > > > + for (ProcessorNumber =3D 0; ProcessorNumber < NumberOfCpus; > > > ProcessorNumber++) { > > > + Location =3D &CpuFeaturesData- > > > >InitOrder[ProcessorNumber].CpuInfo.ProcessorInfo.Location; > > > + if (Location->Package =3D=3D PackageIndex) { > > > > Here the code is assuming Location->Package starts from 0 and consecuti= ve. >=20 > CpuStatus->PackageCount is assigned in CpuInitDataInitialize(): > > CpuStatus->PackageCount =3D Package + 1; > > CpuStatus->MaxCoreCount =3D Core + 1; > > CpuStatus->MaxThreadCount =3D Thread + 1; > So PackageCount actually is the value of max package ID + 1. > With that, the code change isn't assuming Location->Package starts from 0= and > consecutive. >=20 > > > > Here the code is assuming Location->Package and Location->Core start fr= om > > 0 and consecutive. > > We could not have this assumption, this patch is to resolve this assump= tion. > Similarly, The code change above isn't assuming Location->Core starts fro= m 0 > and consecutive. >=20 > > > > > > Thanks, > > Star > >