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; Mon, 26 Aug 2019 10:09:37 -0700 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id F035718012FC; Mon, 26 Aug 2019 17:09:36 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-117-34.ams2.redhat.com [10.36.117.34]) by smtp.corp.redhat.com (Postfix) with ESMTP id EC2E75D9C3; Mon, 26 Aug 2019 17:09:35 +0000 (UTC) Subject: Re: [edk2-devel] [PATCH 1/5] UefiCpuPkg: Add PcdCpuSmmRestrictedMemoryAccess To: devel@edk2.groups.io, ray.ni@intel.com Cc: Eric Dong , Jiewen Yao References: <20190825224513.171572-1-ray.ni@intel.com> <20190825224513.171572-2-ray.ni@intel.com> From: "Laszlo Ersek" Message-ID: Date: Mon, 26 Aug 2019 19:09:35 +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: <20190825224513.171572-2-ray.ni@intel.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.63]); Mon, 26 Aug 2019 17:09:37 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit On 08/26/19 00:45, Ni, Ray wrote: > The patch adds a new X64 only PCD PcdCpuSmmRestrictedMemoryAccess. > The PCD indicates access to non-SMRAM memory is restricted to > reserved, runtime and ACPI NVS type after SmmReadyToLock. > MMIO access is always allowed regardless of the value of this PCD. > Loose of such restriction is only required by RAS components in X64 > platforms. > The PCD value is considered as constantly TRUE in IA32 platforms. > When the PCD value is TRUE, page table is initialized to cover all > memory spaces and the memory occupied by page table is protected by > page table itself as read-only. > > Signed-off-by: Ray Ni > Cc: Eric Dong > Cc: Jiewen Yao > Cc: Laszlo Ersek > --- > UefiCpuPkg/UefiCpuPkg.dec | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > > diff --git a/UefiCpuPkg/UefiCpuPkg.dec b/UefiCpuPkg/UefiCpuPkg.dec > index 86ad61f64b..83acd33612 100644 > --- a/UefiCpuPkg/UefiCpuPkg.dec > +++ b/UefiCpuPkg/UefiCpuPkg.dec > @@ -278,6 +278,18 @@ [PcdsFixedAtBuild, PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx] > # @Prompt Current boot is a power-on reset. > gUefiCpuPkgTokenSpaceGuid.PcdIsPowerOnReset|FALSE|BOOLEAN|0x0000001B > > +[PcdsFixedAtBuild.X64, PcdsPatchableInModule.X64, PcdsDynamic.X64, PcdsDynamicEx.X64] > + ## Indicate access to non-SMRAM memory is restricted to reserved, runtime and ACPI NVS type after SmmReadyToLock. > + # MMIO access is always allowed regardless of the value of this PCD. > + # Loose of such restriction is only required by RAS components in X64 platforms. > + # The PCD value is considered as constantly TRUE in IA32 platforms. > + # When the PCD value is TRUE, page table is initialized to cover all memory spaces > + # and the memory occupied by page table is protected by page table itself as read-only. > + # TRUE - Access to non-SMRAM memory is restricted to reserved, runtime and ACPI NVS type after SmmReadyToLock.
> + # FALSE - Access to any type of non-SMRAM memory after SmmReadyToLock is allowed.
> + # @Prompt Access to non-SMRAM memory is restricted to reserved, runtime and ACPI NVS type after SmmReadyToLock. > + gUefiCpuPkgTokenSpaceGuid.PcdCpuSmmRestrictedMemoryAccess|TRUE|BOOLEAN|0x3213210F > + > [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. > Please consider updating the UNI file as well. Reviewed-by: Laszlo Ersek