From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mx.groups.io with SMTP id smtpd.web11.7537.1577934893409419792 for ; Wed, 01 Jan 2020 19:14:53 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.151, mailfrom: ray.ni@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 fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Jan 2020 19:14:53 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,385,1571727600"; d="scan'208";a="216398292" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga008.fm.intel.com with ESMTP; 01 Jan 2020 19:14:53 -0800 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 1 Jan 2020 19:14:52 -0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.197]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.55]) with mapi id 14.03.0439.000; Thu, 2 Jan 2020 11:14:51 +0800 From: "Ni, Ray" 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 indicate 1st unit. Thread-Topic: [PATCH v2 3/3] UefiCpuPkg/CpuFeature: Introduce First to indicate 1st unit. Thread-Index: AQHVpCEq/499IzJio0+cD5NOk6fDHafKRXsAgAykTbA= Date: Thu, 2 Jan 2020 03:14:50 +0000 Message-ID: <734D49CCEBEEF84792F5B80ED585239D5C3D170B@SHSMSX104.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> In-Reply-To: <0C09AFA07DD0434D9E2A0C6AEB048310404960B6@shsmsx102.ccr.corp.intel.com> Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: ray.ni@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable >=20 > Need some patches to update individual InitializeFunc() for features. > These patches can be a separated patch series. >=20 Yes. > > > > The patch adds a new field Fist to indicate the CPU's location in >=20 > "Firt" should be "First". Will fix the typo in next version of patch or pushing. > > + // > > + // Set First.Die/Tile/Module for each thread assuming: > > + // single Die under each package, single Tile under each Die, singl= e > Module > > under each Tile >=20 > This assumption needs to be addressed in this or a separated patch series= . The assumption will be fixed after the below changes are merged to trunk. https://github.com/tianocore/edk2-staging/tree/cpu/6-level > > + for (PackageIndex =3D 0; PackageIndex < CpuStatus->PackageCount; > > PackageIndex++) { > > + // > > + // Set First.Core for each thread in the first core of each packag= e. > > + // > > + 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) { >=20 > Here the code is assuming Location->Package starts from 0 and consecutive= . 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 a= nd consecutive. >=20 > Here the code is assuming Location->Package and Location->Core start from > 0 and consecutive. > We could not have this assumption, this patch is to resolve this assumpti= on. Similarly, The code change above isn't assuming Location->Core starts from = 0 and consecutive. >=20 >=20 > Thanks, > Star >=20