From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (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 2A67481A33 for ; Thu, 3 Nov 2016 01:28:51 -0700 (PDT) Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 922A94E4D9; Thu, 3 Nov 2016 08:28:52 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-71.phx2.redhat.com [10.3.116.71]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id uA38So2p015943; Thu, 3 Nov 2016 04:28:51 -0400 To: Jiewen Yao , edk2-devel@ml01.01.org References: <1478156028-21572-1-git-send-email-jiewen.yao@intel.com> <1478156028-21572-5-git-send-email-jiewen.yao@intel.com> Cc: Michael D Kinney , Feng Tian , Jeff Fan , Star Zeng From: Laszlo Ersek Message-ID: <71b09441-6903-75d0-de06-0f9e18642c85@redhat.com> Date: Thu, 3 Nov 2016 09:28:50 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <1478156028-21572-5-git-send-email-jiewen.yao@intel.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Thu, 03 Nov 2016 08:28:52 +0000 (UTC) Subject: Re: [PATCH 4/6] UefiCpuPkg/dec: Add PcdCpuSmmStaticPageTable. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Nov 2016 08:28:51 -0000 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Jiewen, On 11/03/16 07:53, Jiewen Yao wrote: > If enabled, SMM will not use on-demand paging. > SMM will build static page table for all memory. > > Cc: Jeff Fan > Cc: Feng Tian > Cc: Star Zeng > Cc: Michael D Kinney > Cc: Laszlo Ersek > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Jiewen Yao > --- > UefiCpuPkg/UefiCpuPkg.dec | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/UefiCpuPkg/UefiCpuPkg.dec b/UefiCpuPkg/UefiCpuPkg.dec > index 8674533..a110820 100644 > --- a/UefiCpuPkg/UefiCpuPkg.dec > +++ b/UefiCpuPkg/UefiCpuPkg.dec > @@ -199,6 +199,14 @@ > # @Prompt The specified AP target C-state for Mwait. > gUefiCpuPkgTokenSpaceGuid.PcdCpuApTargetCstate|0|UINT8|0x00000007 > > + ## Indicates if SMM uses static page table. > + # If enabled, SMM will not use on-demand paging. SMM will build static page table for all memory.

> + # This flag only impacts X64 build, because SMM alway builds static page table for IA32. > + # TRUE - SMM uses static page table for all memory.
> + # FALSE - SMM uses static page table for below 4G memory and use on-demand paging for above 4G memory.
> + # @Prompt Use static page table for all memory in SMM. > + gUefiCpuPkgTokenSpaceGuid.PcdCpuSmmStaticPageTable|TRUE|BOOLEAN|0x3213210D > + > [PcdsDynamic, PcdsDynamicEx] > ## Contains the pointer to a CPU S3 data buffer of structure ACPI_CPU_DATA. > # @Prompt The pointer to a CPU S3 data buffer. > can you add more documentation about the PCD (to this patch or the next patch)? Such as: - What SMRAM footprint do we expect for the page tables, for what main RAM size? QEMU's Q35 machine type offers 8MB SMRAM at the most, and that's already quite consumed if you specify a high CPU count for the guest. I don't have any numbers ready, but I seem to recall that with 255 CPUs it gets quite tight. - If a platform disables PcdCpuSmmStaticPageTable, does it lose the SMM page level protection then? If that's the case, then it should be documented in UefiCpuPkg.dec. One might even argue that the PCD should be renamed: the protection is the main featue (our end goal), and the page tables being fully pre-allocated are just an implementation detail for that. Thanks Laszlo