From mboxrd@z Thu Jan 1 00:00:00 1970 Subject: Access non-SMRAM memory regions from SMM To: devel@edk2.groups.io From: asallan3@gmail.com X-Originating-Location: Lauro de Freitas, Bahia, BR (45.233.231.5) X-Originating-Platform: Linux Chrome 107 User-Agent: GROUPS.IO Web Poster MIME-Version: 1.0 Date: Mon, 05 Dec 2022 08:41:23 -0800 Message-ID: Content-Type: multipart/alternative; boundary="BwiJaxnDvqXZOmwgUkq2" --BwiJaxnDvqXZOmwgUkq2 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hi, I'm aware theres been implemented a PCD `gUefiCpuPkgTokenSpaceGuid.PcdC= puSmmRestrictedMemoryAccess` that blocks access to "any" type of non-SMRAM = memory after SmmReadyToLock. But I ran some tests and found out I can access some memory regions outside= SMRAM, like address 0xFFFD0 for instance, and dereference a pointer to tha= t address inside my Mm Handler without any problems, even though this is a = non-SMRAM address and I have that PCD set to TRUE (Access to non-SMRAM memo= ry is restricted). However when I try to dereference a pointer to a memory region used by the = OS I get an error saying `Access SMM communication forbidden address (0xC60= 0000)!` So I'm wondering: 1) Is it blocked or not? 2) In what context I *can* access non-SMRAM memory regions from inside my m= m Handler? 3) Is there any way to read these memory regions used by the OS from inside= the mm Handler other than setting PcdCpuSmmRestrictedMemoryAccess to FALSE= ? Any kind of help would be appreciated. Thanks! --BwiJaxnDvqXZOmwgUkq2 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hi, I'm aware theres been implemented a PCD `gUefiCpuPkgTokenSpaceGuid.PcdC= puSmmRestrictedMemoryAccess` that blocks access to "any" type of non-SMRAM = memory after SmmReadyToLock.

But I ran some tests and found out = I can access some memory regions outside SMRAM, like address 0xFFFD0 for in= stance, and dereference a pointer to that address inside my Mm Handler with= out any problems, even though this is a non-SMRAM address and I have that P= CD set to TRUE (Access to non-SMRAM memory is restricted).

Howev= er when I try to dereference a pointer to a memory region used by the OS I = get an error saying `Access SMM communication forbidden address (0xC600000)= !`

So I'm wondering:

1) Is it blocked or not?
2)= In what context I can access non-SMRAM memory regions fro= m inside my mm Handler?
3) Is there any way to read these memory regio= ns used by the OS from inside the mm Handler other than setting PcdCpuSmmRe= strictedMemoryAccess to FALSE?

Any kind of help would be appreci= ated. Thanks! --BwiJaxnDvqXZOmwgUkq2--