public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Laszlo Ersek <lersek@redhat.com>
To: Ard Biesheuvel <ard.biesheuvel@linaro.org>, edk2-devel@lists.01.org
Cc: Leif Lindholm <leif.lindholm@linaro.org>,
	Michael D Kinney <michael.d.kinney@intel.com>,
	Liming Gao <liming.gao@intel.com>,
	Jian J Wang <jian.j.wang@intel.com>, Hao Wu <hao.a.wu@intel.com>,
	Jagadeesh Ujja <jagadeesh.ujja@arm.com>,
	Achin Gupta <Achin.Gupta@arm.com>,
	Thomas Panakamattam Abraham <thomas.abraham@arm.com>,
	Sami Mujawar <Sami.Mujawar@arm.com>
Subject: Re: [PATCH 5/6] MdeModulePkg/VariableRuntimeDxe: factor out boot service accesses
Date: Tue, 8 Jan 2019 16:38:21 +0100	[thread overview]
Message-ID: <09818de2-2518-38f7-42ac-8882ecb2ea29@redhat.com> (raw)
In-Reply-To: <20190103182825.32231-7-ard.biesheuvel@linaro.org>

On 01/03/19 19:28, Ard Biesheuvel wrote:
> In preparation of providing a standalone MM based variable runtime
> driver, move the existing SMM driver to the new MM services table,
> and factor out some pieces that are specific to the traditional
> driver, mainly related to the use of UEFI boot services, which are
> not accessible to standalone MM drivers.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> ---
>  MdeModulePkg/Universal/Variable/RuntimeDxe/TcgMorLockSmm.c         |  18 +---
>  MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.h              |  50 +++++++++
>  MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.c           |  59 ++++------
>  MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.inf         |   5 +-
>  MdeModulePkg/Universal/Variable/RuntimeDxe/VariableTraditionalMm.c | 114 ++++++++++++++++++++
>  5 files changed, 187 insertions(+), 59 deletions(-)

I *vaguely* feel like we should extract the new functions to
"PrivilegePolymorphic.h", rather than to "Variable.h".

Please see initial commit 00663d047fc9
("MdeModulePkg/Variable/RuntimeDxe: move SecureBootHook() decl to new
header", 2017-10-10), and other commits that touched that file.

I realize this is not a 100% "constructive" suggestion, and I feel
appropriately bad about that. It's just that "Variable.h" has so many
internals that I feel it's not a good dumping ground for these new
functions. And the other header we have, looks closer in purpose.

For example, MorLockInitAtEndOfDxe() is already declared in
"PrivilegePolymorphic.h" (see commit f1304280435f,
"MdeModulePkg/Variable/RuntimeDxe: introduce MorLockInitAtEndOfDxe()
hook", 2017-10-10).

Admittedly, now that we're going to have three separate builds of this
driver, dedicating a separate header file to each "shared between A and
B" relationship is getting a bit too complex. In retrospect, introducing
"PrivilegePolymorphic.h" may not have been a "scalable" idea, after all,
and I should have just dumped those functions all in "Variable.h".

IOW, I think
- targeting "Variable.h" now is inconsistent with earlier code,
- extending "PrivilegePolymorphic.h" is also suboptimal (although still
better than the previous option),
- adding yet another header might be technically correct, but it would
be over-engineering,
- asking you to merge "PrivilegePolymorphic.h" back into "Variable.h"
feels awkward, especially after I argued *for* "PrivilegePolymorphic.h"
at length, when I originally introduced it. :/

Sigh. Can the variable driver maintainers comment please?

(I still plan to regression-test this series, but I feel like I should
force myself to at least skim the variable driver patches, beyond
testing them. Because, next time I can't avoid working with this very
complex driver, I wouldn't like to be *completely* lost.)

Thanks,
Laszlo


  reply	other threads:[~2019-01-08 15:38 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-03 18:28 [PATCH 0/6] implement standalone MM versions of the variable runtime drivers Ard Biesheuvel
2019-01-03 18:28 ` [PATCH] BaseTools/GenFds: permit stripped MM_CORE_STANDALONE binaries Ard Biesheuvel
2019-01-04  5:51   ` Feng, Bob C
2019-01-03 18:28 ` [PATCH 1/6] MdePkg/Include: add MmServicesTableLib header file Ard Biesheuvel
2019-01-10  6:06   ` Zeng, Star
2019-01-03 18:28 ` [PATCH 2/6] MdePkg: implement MmServicesTableLib based on traditional SMM Ard Biesheuvel
2019-01-10  1:35   ` Wang, Jian J
     [not found]   ` <9bfb4d7c-3d4e-c05c-49a1-1959ddc902e3@intel.com>
2019-01-10  6:54     ` Zeng, Star
2019-01-03 18:28 ` [PATCH 3/6] MdeModulePkg/FaultTolerantWriteDxe: factor out boot service accesses Ard Biesheuvel
2019-01-10  1:36   ` Wang, Jian J
2019-01-10  6:45   ` Zeng, Star
2019-01-03 18:28 ` [PATCH 4/6] MdeModulePkg/FaultTolerantWriteDxe: implement standalone MM version Ard Biesheuvel
2019-01-10  1:41   ` Wang, Jian J
2019-01-10  1:48     ` Wang, Jian J
2019-01-10  6:31     ` Zeng, Star
2019-01-10  6:47   ` Zeng, Star
2019-01-10  7:29     ` Zeng, Star
2019-01-10  7:33       ` Ard Biesheuvel
2019-01-10  7:59         ` Zeng, Star
2019-01-10 12:28           ` Wang, Jian J
2019-01-10 13:03           ` Laszlo Ersek
2019-01-10 16:23             ` Ard Biesheuvel
2019-01-11  2:18               ` Zeng, Star
2019-01-03 18:28 ` [PATCH 5/6] MdeModulePkg/VariableRuntimeDxe: factor out boot service accesses Ard Biesheuvel
2019-01-08 15:38   ` Laszlo Ersek [this message]
2019-01-10  2:33     ` Wang, Jian J
2019-01-10  7:17       ` Zeng, Star
2019-01-10  7:19   ` Zeng, Star
2019-01-03 18:28 ` [PATCH 6/6] MdeModulePkg/VariableRuntimeDxe: implement standalone MM version Ard Biesheuvel
2019-01-10  1:49   ` Wang, Jian J
2019-01-10  1:50   ` Wang, Jian J
2019-01-10  7:28   ` Zeng, Star
2019-01-03 19:13 ` [PATCH 0/6] implement standalone MM versions of the variable runtime drivers Ard Biesheuvel
2019-01-07 12:44 ` Gao, Liming
2019-01-07 13:05   ` Ard Biesheuvel
2019-01-07 19:08     ` Laszlo Ersek
2019-01-09 13:56     ` Gao, Liming
2019-01-09 15:29       ` Ard Biesheuvel
2019-01-14  2:55         ` Gao, Liming
2019-01-14  8:26           ` Ard Biesheuvel
2019-01-14 15:33             ` Gao, Liming
2019-01-09  9:44 ` Laszlo Ersek
2019-01-09 10:28   ` Ard Biesheuvel
2019-01-09 15:04     ` Laszlo Ersek
2019-01-09 21:46       ` Laszlo Ersek
2019-01-09 21:56         ` Ard Biesheuvel
2019-01-10  8:24 ` Zeng, Star
2019-01-13 15:42 ` Zeng, Star

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=09818de2-2518-38f7-42ac-8882ecb2ea29@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