From: "Laszlo Ersek" <lersek@redhat.com>
To: ray.ni@intel.com, Jiewen Yao <jiewen.yao@intel.com>
Cc: devel@edk2.groups.io, Eric Dong <eric.dong@intel.com>,
Jian J Wang <jian.j.wang@intel.com>
Subject: Re: [edk2-devel] [PATCH v2 2/2] UefiCpuPkg/PiSmmCpu: PcdCpuSmmAccessOut controls SMM access-out policy
Date: Thu, 1 Aug 2019 02:08:27 +0200 [thread overview]
Message-ID: <f69dc4b7-d196-e877-8a46-13e98d0cdffa@redhat.com> (raw)
In-Reply-To: <9158c339-5af7-0d12-fbe9-c5c01499e54e@redhat.com>
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/20180720052626.24932-1-hao.a.wu@intel.com
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
next prev parent reply other threads:[~2019-08-01 0:08 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-31 16:38 [PATCH v2 0/2] Add new PCD PcdCpuSmmAccessOut to control SMM access out Ni, Ray
2019-07-31 16:38 ` [PATCH v2 1/2] UefiCpuPkg: Add " Ni, Ray
2019-07-31 22:21 ` [edk2-devel] " Laszlo Ersek
2019-08-01 6:38 ` Ni, Ray
2019-07-31 16:38 ` [PATCH v2 2/2] UefiCpuPkg/PiSmmCpu: PcdCpuSmmAccessOut controls SMM access-out policy Ni, Ray
2019-07-31 23:13 ` [edk2-devel] " Laszlo Ersek
2019-07-31 23:46 ` Laszlo Ersek
2019-08-01 0:08 ` Laszlo Ersek [this message]
2019-08-01 0:02 ` Yao, Jiewen
2019-08-01 1:27 ` Ni, Ray
2019-08-01 1:38 ` Yao, Jiewen
2019-08-01 2:23 ` Ni, Ray
2019-08-01 3:10 ` Yao, Jiewen
2019-08-01 6:25 ` Ni, Ray
2019-08-02 1:41 ` Laszlo Ersek
2019-08-02 2:04 ` Laszlo Ersek
2019-08-02 2:46 ` Yao, Jiewen
2019-08-02 22:06 ` Laszlo Ersek
2019-08-03 2:23 ` Yao, Jiewen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f69dc4b7-d196-e877-8a46-13e98d0cdffa@redhat.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox