From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.126; helo=mga18.intel.com; envelope-from=star.zeng@intel.com; receiver=edk2-devel@lists.01.org Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 990F6211B6C0E for ; Sun, 13 Jan 2019 07:42:43 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Jan 2019 07:42:43 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,474,1539673200"; d="scan'208";a="311450419" Received: from shzintpr01.sh.intel.com (HELO [10.253.24.32]) ([10.239.4.80]) by fmsmga005.fm.intel.com with ESMTP; 13 Jan 2019 07:42:41 -0800 To: Ard Biesheuvel , edk2-devel@lists.01.org Cc: Hao Wu , Liming Gao , Michael D Kinney , Laszlo Ersek , star.zeng@intel.com References: <20190103182825.32231-1-ard.biesheuvel@linaro.org> From: "Zeng, Star" Message-ID: Date: Sun, 13 Jan 2019 23:42:11 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <20190103182825.32231-1-ard.biesheuvel@linaro.org> Subject: Re: [PATCH 0/6] implement standalone MM versions of the variable runtime drivers X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jan 2019 15:42:43 -0000 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Ard, FYI: There is minor change overlap to VariableDxe/Smm.c between this patch series and the patch series at https://lists.01.org/pipermail/edk2-devel/2019-January/034921.html ([PATCH 04/12]) I just sent. After one patch series is pushed, the other patch series will need a simple rebase. Thanks, Star On 2019/1/4 2:28, Ard Biesheuvel wrote: > This series proposed an alternative approach to the series sent out by > Jagadeesh [0]. In particular, it gets rid of the InMm() calls and the > special PCD, as well as some other if() conditionals. > > The primary difference is that this series defines and implements > MmServicesTableLib in such a way that the traditional SMM drivers > can use it as well. This is appropriate, considering that the PI > spec has rebranded traditional SMM as one implementation of the generic > MM framework. > > Patch #1 is based on Jagadeesh's patch, and introduces the MmServicesTableLib > library class, but for all SMM flavours, not only for standalone MM. > > Patch #2 implements MmServicesTableLib for traditional SMM implementations. > > Patch #3 refactors FaultTolerantWriteDxe so that the parts of the SMM > driver that invoke boot services are separated from the core SMM pieces. > > Patch #4 implements FaultTolerantWriteSmm for the standalone MM environment. > > Patches #5 and #6 do the same, respectively, for the variable runtime driver. > > This approach minimizes the delta, and thus the maintenance burden, between > the traditional SMM and standalone MM drivers, while not resorting to runtime > checks or other conditionals in the code to implement logic that should be > decided at build time. > > Note that this series only covers part of the work contributed by Jagadeesh. > This series focuses on the MdePkg and MdeModulePkg changes that affect shared > code. > > Cc: Laszlo Ersek > Cc: Leif Lindholm > Cc: Michael D Kinney > Cc: Liming Gao > Cc: Jian J Wang > Cc: Hao Wu > Cc: Jagadeesh Ujja > Cc: Achin Gupta > Cc: Thomas Panakamattam Abraham > Cc: Sami Mujawar > > Ard Biesheuvel (5): > MdePkg: implement MmServicesTableLib based on traditional SMM > MdeModulePkg/FaultTolerantWriteDxe: factor out boot service accesses > MdeModulePkg/FaultTolerantWriteDxe: implement standalone MM version > MdeModulePkg/VariableRuntimeDxe: factor out boot service accesses > MdeModulePkg/VariableRuntimeDxe: implement standalone MM version > > Jagadeesh Ujja (1): > MdePkg/Include: add MmServicesTableLib header file > > MdeModulePkg/MdeModulePkg.dsc | 1 + > .../FaultTolerantWrite.h | 22 ++- > .../FaultTolerantWriteDxe.c | 31 ++++ > .../FaultTolerantWriteSmm.c | 54 +++---- > .../FaultTolerantWriteSmm.inf | 5 +- > .../FaultTolerantWriteSmmCommon.h | 31 ++++ > .../FaultTolerantWriteSmmDxe.c | 1 + > .../FaultTolerantWriteStandaloneMm.c | 70 +++++++++ > .../FaultTolerantWriteStandaloneMm.inf | 90 ++++++++++++ > .../FaultTolerantWriteTraditionalMm.c | 94 ++++++++++++ > .../UpdateWorkingBlock.c | 10 +- > .../Variable/RuntimeDxe/TcgMorLockSmm.c | 18 +-- > .../Universal/Variable/RuntimeDxe/Variable.h | 50 +++++++ > .../Variable/RuntimeDxe/VariableSmm.c | 59 +++----- > .../Variable/RuntimeDxe/VariableSmm.inf | 5 +- > .../RuntimeDxe/VariableStandaloneMm.c | 69 +++++++++ > .../RuntimeDxe/VariableStandaloneMm.inf | 135 ++++++++++++++++++ > .../RuntimeDxe/VariableTraditionalMm.c | 114 +++++++++++++++ > MdePkg/Include/Library/MmServicesTableLib.h | 25 ++++ > .../MmServicesTableLib/MmServicesTableLib.c | 63 ++++++++ > .../MmServicesTableLib/MmServicesTableLib.inf | 45 ++++++ > .../MmServicesTableLib/MmServicesTableLib.uni | 22 +++ > MdePkg/MdePkg.dec | 4 + > MdePkg/MdePkg.dsc | 1 + > 24 files changed, 916 insertions(+), 103 deletions(-) > create mode 100644 MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteStandaloneMm.c > create mode 100644 MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteStandaloneMm.inf > create mode 100644 MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteTraditionalMm.c > create mode 100644 MdeModulePkg/Universal/Variable/RuntimeDxe/VariableStandaloneMm.c > create mode 100644 MdeModulePkg/Universal/Variable/RuntimeDxe/VariableStandaloneMm.inf > create mode 100644 MdeModulePkg/Universal/Variable/RuntimeDxe/VariableTraditionalMm.c > create mode 100644 MdePkg/Include/Library/MmServicesTableLib.h > create mode 100644 MdePkg/Library/MmServicesTableLib/MmServicesTableLib.c > create mode 100644 MdePkg/Library/MmServicesTableLib/MmServicesTableLib.inf > create mode 100644 MdePkg/Library/MmServicesTableLib/MmServicesTableLib.uni >