From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=209.132.183.28; helo=mx1.redhat.com; envelope-from=lersek@redhat.com; receiver=edk2-devel@lists.01.org Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (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 D8D73208F7903 for ; Tue, 10 Oct 2017 03:05:54 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 37AC513A5D; Tue, 10 Oct 2017 10:09:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 37AC513A5D Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=lersek@redhat.com Received: from lacos-laptop-7.usersys.redhat.com (ovpn-120-87.rdu2.redhat.com [10.10.120.87]) by smtp.corp.redhat.com (Postfix) with ESMTP id C2E036BC0F; Tue, 10 Oct 2017 10:09:20 +0000 (UTC) To: "Yao, Jiewen" , "Zeng, Star" Cc: edk2-devel-01 , "Dong, Eric" , Ladi Prosek References: <20171003212834.25740-1-lersek@redhat.com> <74D8A39837DF1E4DA445A8C0B3885C503A9CE249@shsmsx102.ccr.corp.intel.com> <352f1572-161d-9a32-6628-7f07b17c7ecc@redhat.com> <74D8A39837DF1E4DA445A8C0B3885C503A9D7216@shsmsx102.ccr.corp.intel.com> From: Laszlo Ersek Message-ID: <9e4c0e13-88ef-3dee-b96f-091df517b55e@redhat.com> Date: Tue, 10 Oct 2017 12:09:19 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <74D8A39837DF1E4DA445A8C0B3885C503A9D7216@shsmsx102.ccr.corp.intel.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Tue, 10 Oct 2017 10:09:22 +0000 (UTC) Subject: Re: [PATCH 0/6] MdeModulePkg/VariableSmm: fix MOR / MorLock inconsistency X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 10:05:55 -0000 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit On 10/10/17 06:17, Yao, Jiewen wrote: > Thanks. > Please use ASSERT() when you check in. > > Series Reviewed-by: Jiewen.yao@intel.com Thank you all for the (quick!) feedback; I've pushed the series: 35ac962b5473..fda8f631edbb. Here's the cumulative diff between the posted (v1) and the pushed series, based on the comments: > diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/PrivilegePolymorphic.h b/MdeModulePkg/Universal/Variable/RuntimeDxe/PrivilegePolymorphic.h > index 759e47db7f29..b98b8556a23a 100644 > --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/PrivilegePolymorphic.h > +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/PrivilegePolymorphic.h > @@ -62,9 +62,7 @@ MorLockInitAtEndOfDxe ( > @param[in] VariableName the name of the vendor's variable, as a > Null-Terminated Unicode String > @param[in] VendorGuid Unify identifier for vendor. > - @param[in] Attributes Point to memory location to return the attributes of > - variable. If the point is NULL, the parameter would > - be ignored. > + @param[in] Attributes Attributes bitmask to set for the variable. > @param[in] DataSize The size in bytes of Data-Buffer. > @param[in] Data Point to the content of the variable. > > diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/TcgMorLockDxe.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/TcgMorLockDxe.c > index a91fc42ff465..7142e2da2073 100644 > --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/TcgMorLockDxe.c > +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/TcgMorLockDxe.c > @@ -31,9 +31,7 @@ extern EDKII_VARIABLE_LOCK_PROTOCOL mVariableLock; > @param[in] VariableName the name of the vendor's variable, as a > Null-Terminated Unicode String > @param[in] VendorGuid Unify identifier for vendor. > - @param[in] Attributes Point to memory location to return the attributes of > - variable. If the point is NULL, the parameter would > - be ignored. > + @param[in] Attributes Attributes bitmask to set for the variable. > @param[in] DataSize The size in bytes of Data-Buffer. > @param[in] Data Point to the content of the variable. > > diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/TcgMorLockSmm.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/TcgMorLockSmm.c > index 0a0281e44bc1..93a300a84677 100644 > --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/TcgMorLockSmm.c > +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/TcgMorLockSmm.c > @@ -319,9 +319,7 @@ SetVariableCheckHandlerMorLock ( > @param[in] VariableName the name of the vendor's variable, as a > Null-Terminated Unicode String > @param[in] VendorGuid Unify identifier for vendor. > - @param[in] Attributes Point to memory location to return the attributes of > - variable. If the point is NULL, the parameter would > - be ignored. > + @param[in] Attributes Attributes bitmask to set for the variable. > @param[in] DataSize The size in bytes of Data-Buffer. > @param[in] Data Point to the content of the variable. > > @@ -427,8 +425,9 @@ MorLockInitAtEndOfDxe ( > if (!mMorLockInitializationRequired) { > // > // The EFI_SMM_FAULT_TOLERANT_WRITE_PROTOCOL has never been installed, thus > - // the variable write service is unavailable. Do nothing. > + // the variable write service is unavailable. This should never happen. > // > + ASSERT (FALSE); > return; > } > In addition, I modified the commit message of patch #2 (now commit 03877377e326, "MdeModulePkg/Variable/RuntimeDxe: move MOR func. declarations to header", 2017-09-30), to credit Star for the fixed "Attributes" param description. (The ASSERT from Jiewen needed no commit message update; commit 7516532f9c2d ("MdeModulePkg/Variable/RuntimeDxe: delay MorLock creation until EndOfDxe", 2017-09-30) already carried "Suggested-by: Jiewen Yao ".) I plan to post the separate patch for option (a) soon (see ). Thank you! Laszlo