From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: redhat.com, ip: 209.132.183.28, mailfrom: lersek@redhat.com) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by groups.io with SMTP; Wed, 31 Jul 2019 15:21:35 -0700 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B5B983091785; Wed, 31 Jul 2019 22:21:34 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-110.ams2.redhat.com [10.36.116.110]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7DFEB600C4; Wed, 31 Jul 2019 22:21:33 +0000 (UTC) Subject: Re: [edk2-devel] [PATCH v2 1/2] UefiCpuPkg: Add PCD PcdCpuSmmAccessOut to control SMM access out To: devel@edk2.groups.io, ray.ni@intel.com Cc: Eric Dong , Jiewen Yao References: <20190731163852.191708-1-ray.ni@intel.com> <20190731163852.191708-2-ray.ni@intel.com> From: "Laszlo Ersek" Message-ID: <892beca6-1be0-6a16-74ab-44577197206d@redhat.com> Date: Thu, 1 Aug 2019 00:21:32 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20190731163852.191708-2-ray.ni@intel.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Wed, 31 Jul 2019 22:21:34 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit On 07/31/19 18:38, Ni, Ray wrote: > There is a requirement to allow SMM code access non-SMRAM memory > after ReadyToLock. > The requirement was expected to be satisfied by commit: > c60d36b4d1ee1f69b7cca897d3621dfa951895c2 > * UefiCpuPkg/SmmCpu: Block access-out only when static paging is used > > Commit c60d36b4 re-interpreted the PcdCpuSmmStaticPageTable as > a way to control whether SMM module can access non-SMRAM memory > after ReadyToLock. > It brought confusion because "static page table" means the page table > is created in advance and there is no dynamic page table modification > at runtime. It only applies to 64bit environment because page table > for memory below 4GB is always created in advance. But the control > of whether allowing SMM module access non-SMRAM memory can also be > applied to 32bit environment. > It makes more sense to have a separate PCD as proposed in this > patch to control the policy. > > Signed-off-by: Ray Ni > Cc: Eric Dong > Cc: Laszlo Ersek > Cc: Jiewen Yao > --- > UefiCpuPkg/UefiCpuPkg.dec | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/UefiCpuPkg/UefiCpuPkg.dec b/UefiCpuPkg/UefiCpuPkg.dec > index 6ddf0cd224..24b44bae39 100644 > --- a/UefiCpuPkg/UefiCpuPkg.dec > +++ b/UefiCpuPkg/UefiCpuPkg.dec > @@ -246,6 +246,13 @@ [PcdsFixedAtBuild, PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx] > # @Prompt Use static page table for all memory in SMM. > gUefiCpuPkgTokenSpaceGuid.PcdCpuSmmStaticPageTable|TRUE|BOOLEAN|0x3213210D > > + ## Controls whether SMM modules can access all non-SMRAM memory after SmmReadyToLock. > + # TRUE - SMM modules can access all non-SMRAM memory after SmmReadyToLock.
> + # FALSE - SMM modules can only access reserved, runtime and ACPI NVS type of non-SMRAM memory > + # after SmmReadyToLock.
> + # @Prompt SMM modules can access all non-SMRAM memory after SmmReadyToLock. > + gUefiCpuPkgTokenSpaceGuid.PcdCpuSmmAccessOut|FALSE|BOOLEAN|0x3213210F > + > ## Specifies timeout value in microseconds for the BSP in SMM to wait for all APs to come into SMM. > # @Prompt AP synchronization timeout value in SMM. > gUefiCpuPkgTokenSpaceGuid.PcdCpuSmmApSyncTimeout|1000000|UINT64|0x32132104 > Reviewed-by: Laszlo Ersek