From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.100; helo=mga07.intel.com; envelope-from=ruiyu.ni@intel.com; receiver=edk2-devel@lists.01.org Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 7483E2034BBDD for ; Wed, 8 Nov 2017 23:08:00 -0800 (PST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga105.jf.intel.com with ESMTP; 08 Nov 2017 23:12:01 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,368,1505804400"; d="scan'208";a="2857085" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga001.jf.intel.com with ESMTP; 08 Nov 2017 23:12:01 -0800 Received: from fmsmsx155.amr.corp.intel.com (10.18.116.71) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 8 Nov 2017 23:12:00 -0800 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by FMSMSX155.amr.corp.intel.com (10.18.116.71) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 8 Nov 2017 23:12:00 -0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.152]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.159]) with mapi id 14.03.0319.002; Thu, 9 Nov 2017 15:11:58 +0800 From: "Ni, Ruiyu" To: "Justen, Jordan L" , Laszlo Ersek CC: "Kinney, Michael D" , "edk2-devel@lists.01.org" , "Yao, Jiewen" , "Dong, Eric" , Ard Biesheuvel Thread-Topic: [edk2] [PATCH 3/4] UefiCpuPkg/MtrrLib: Update algorithm to calculate optimal settings Thread-Index: AQHTQzbswd4TLjpf8E2+WggDFOcMPKMK6aiAgAAFA4CAAJR3YP//v+CAgACJ5qA= Date: Thu, 9 Nov 2017 07:11:57 +0000 Message-ID: <734D49CCEBEEF84792F5B80ED585239D5BAB804D@SHSMSX104.ccr.corp.intel.com> References: <20171012084810.148196-1-ruiyu.ni@intel.com> <20171012084810.148196-4-ruiyu.ni@intel.com> <03e369bb-77c4-0134-258f-bdae62cbc8c5@redhat.com> <151019243761.10467.634318081879242382@jljusten-skl> <734D49CCEBEEF84792F5B80ED585239D5BAB7B62@SHSMSX104.ccr.corp.intel.com> <151021054953.14125.10727630216824816281@jljusten-skl> In-Reply-To: <151021054953.14125.10727630216824816281@jljusten-skl> 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 Subject: Re: [PATCH 3/4] UefiCpuPkg/MtrrLib: Update algorithm to calculate optimal settings X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Nov 2017 07:08:00 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable The old version is not just slow. It cannot work in certain cases. That's why the new version was developed. The new version adds a new API which allows caller to pass in the scratch buffer instead of using the stack. If a platform has limited stack, it can = use that API. Thanks/Ray > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of > Jordan Justen > Sent: Thursday, November 9, 2017 2:56 PM > To: Ni, Ruiyu ; Laszlo Ersek > Cc: Kinney, Michael D ; edk2- > devel@lists.01.org; Yao, Jiewen ; Dong, Eric > ; Ard Biesheuvel > Subject: Re: [edk2] [PATCH 3/4] UefiCpuPkg/MtrrLib: Update algorithm to > calculate optimal settings >=20 > On 2017-11-08 19:04:35, Ni, Ruiyu wrote: > > Jordan, Laszlo, > > > > I didn't realize that a platform may have less than 4-page stack > > before memory is ready. If I was aware of that, I would change the > > default scratch buffer size to 2 page, which should be enough too. >=20 > This does not sound much better. I'm saying that the BASE library should = only > use at most a few hundred bytes of stack. >=20 > Apparently the old algorithm did not use much memory, but perhaps was > slow? Can we put it back in place for the BASE version of the library? > Then, we can add a DXE specific version that uses a large buffer which it= can > allocate, and potentially free. >=20 > -Jordan > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel