On 08/01/19 01:46, Laszlo Ersek wrote:
> So ultimately, I would argue for the following patch series:
>
> - patch#1: Revert commit c60d36b4, and explain why, in the commit
> message.
>
> - patch#2: Introduce the new PCD, also mentioning MMIO.
>
> - Patch#3: modify *all* of the following functions, internally, to
> return immediately, if "mSmmAccessOut" is TRUE:
>
> - GetUefiMemoryMap()
> - SetUefiMemMapAttributes()
> - IsSmmCommBufferForbiddenAddress()
>
> Basically, the new PCD should short-circuit all three functions
> declared in "PiSmmCpuDxeSmm.h" by commit d2fc7711136a.
Sigh, why is this so friggin complicated.
The functions added by commit d2fc7711136a were extended with the
following commits, later:
* ac6613db4697 ("UefiCpuPkg/PiSmmCpu: Check for untested memory in GCD",
2018-07-26)
The commit message says, "It treats GCD untested memory as invalid SMM
communication buffer".
* 8a2e1a9d54ee ("UefiCpuPkg/PiSmmCpu: Check EFI_RUNTIME_RO in UEFI mem
attrib table.", 2018-07-26)
The commit message says, "It treats the UEFI runtime page with
EFI_MEMORY_RO attribute as invalid SMM communication buffer.
Both of these commits come from the patch series
[edk2] [PATCH 0/6] Check untested memory and EFI_MEMORY_RO
http://mid.mail-archive.com/[email protected]
https://lists.01.org/pipermail/edk2-devel/2018-July/027326.html
And now the question becomes: when a platform permits "access-out", does
it also enable access to untested memory, and EFI_MEMORY_RO?
(a) If the answer is yes, then short-circuiting the three functions that
I listed, on (mSmmAccessOut == TRUE), *immediately* after entering them,
is correct.
(b) If the answer is no -- that is, access-out should *continue*
preventing access to untested memory, and EFI_MEMORY_RO -- then we
cannot completely short-circuit the functions that I listed. Instead, we
can only short-circuit those parts that work with the "mUefiMemoryMap"
variable.
The current description of the PCD suggests that (b) is the right approach.
Thanks,
Laszlo
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#44708): https://edk2.groups.io/g/devel/message/44708
Mute This Topic: https://groups.io/mt/32668874/21656
Group Owner: [email protected]
Unsubscribe: https://edk2.groups.io/g/devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-