public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Zeng, Star" <star.zeng@intel.com>
To: "Wang, Jian J" <jian.j.wang@intel.com>,
	Laszlo Ersek <lersek@redhat.com>,
	 Ard Biesheuvel <ard.biesheuvel@linaro.org>,
	"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Cc: "Wu, Hao A" <hao.a.wu@intel.com>,
	"Gao, Liming" <liming.gao@intel.com>,
	"Kinney, Michael D" <michael.d.kinney@intel.com>,
	star.zeng@intel.com
Subject: Re: [PATCH 5/6] MdeModulePkg/VariableRuntimeDxe: factor out boot service accesses
Date: Thu, 10 Jan 2019 15:17:25 +0800	[thread overview]
Message-ID: <06f8bea1-f371-8011-d93f-66924f79ab77@intel.com> (raw)
In-Reply-To: <D827630B58408649ACB04F44C5100036258931A9@SHSMSX107.ccr.corp.intel.com>

On 2019/1/10 10:33, Wang, Jian J wrote:
> Laszlo,
> 
> Regards,
> Jian
> 
>> -----Original Message-----
>> From: Laszlo Ersek [mailto:lersek@redhat.com]
>> Sent: Tuesday, January 08, 2019 11:38 PM
>> To: Ard Biesheuvel <ard.biesheuvel@linaro.org>; edk2-devel@lists.01.org
>> Cc: Leif Lindholm <leif.lindholm@linaro.org>; Kinney, Michael D
>> <michael.d.kinney@intel.com>; Gao, Liming <liming.gao@intel.com>; Wang,
>> Jian J <jian.j.wang@intel.com>; Wu, Hao A <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
>>
>> 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.)
>>
> 
> I agree "PrivilegePolymorphic.h" is more appropriate place for them.
> Maybe Star have different opinion.

At current situation, I prefer PrivilegePolymorphic.h. :)

Some minor feedback will be added in another reply.

Thanks,
Star

> 
>> Thanks,
>> Laszlo



  reply	other threads:[~2019-01-10  7:17 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
2019-01-10  2:33     ` Wang, Jian J
2019-01-10  7:17       ` Zeng, Star [this message]
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=06f8bea1-f371-8011-d93f-66924f79ab77@intel.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