From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 0AC15AC005E for ; Fri, 17 Nov 2023 00:43:53 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=cOoiMUwQx3oRidDa38TvyuJiqQ4q9aiHFlMqj434ziA=; c=relaxed/simple; d=groups.io; h=From:To:Cc:References:In-Reply-To:Subject:Date:Message-ID:MIME-Version:Thread-Index:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Type:Content-Transfer-Encoding:Content-Language; s=20140610; t=1700181832; v=1; b=Q2jsZTPklUgTF5VgBt8FG0AnW+gVmcuc/oX8B+RzJaiwOIaV5/M11TIB8xOnJ4YXmMmS6Tm0 PmVVdnMhhUPjL72T1Ie0hGczxytHxnXOIWgLiJmOZ9wbtKj/Rzs8kP4/3sj8hM1MNlsRlDepdTc iuYkTNYUOxrVwZWLvPDQFtdU= X-Received: by 127.0.0.2 with SMTP id wdz7YY7687511xF2b6ZHAwro; Thu, 16 Nov 2023 16:43:52 -0800 X-Received: from zrleap.intel-email.com (zrleap.intel-email.com [114.80.218.36]) by mx.groups.io with SMTP id smtpd.web10.2025.1700181830661318603 for ; Thu, 16 Nov 2023 16:43:52 -0800 X-Received: from zrleap.intel-email.com (localhost [127.0.0.1]) by zrleap.intel-email.com (Postfix) with ESMTP id 63EA2A32E0DD for ; Fri, 17 Nov 2023 08:43:48 +0800 (CST) X-Received: from localhost (localhost [127.0.0.1]) by zrleap.intel-email.com (Postfix) with ESMTP id 49270A32E01C for ; Fri, 17 Nov 2023 08:43:48 +0800 (CST) X-Received: from mail.byosoft.com.cn (mail.byosoft.com.cn [58.240.74.242]) by zrleap.intel-email.com (Postfix) with SMTP id 8D280A32E02E for ; Fri, 17 Nov 2023 08:43:45 +0800 (CST) X-Received: from DESKTOPS6D0PVI ([58.246.60.130]) (envelope-sender ) by 192.168.6.13 with ESMTP(SSL) for ; Fri, 17 Nov 2023 08:43:41 +0800 X-WM-Sender: gaoliming@byosoft.com.cn X-Originating-IP: 58.246.60.130 X-WM-AuthFlag: YES X-WM-AuthUser: gaoliming@byosoft.com.cn From: "gaoliming via groups.io" To: , Cc: "'Ray Ni'" References: <475e7d21da7f9a54d4841d1efe78c1e587c6b931.1699949356.git.gao.cheng@intel.com> In-Reply-To: <475e7d21da7f9a54d4841d1efe78c1e587c6b931.1699949356.git.gao.cheng@intel.com> Subject: =?UTF-8?B?5Zue5aSNOiBbZWRrMi1kZXZlbF0gW1BBVENIXSBNZGVNb2R1bGVQa2cvVmFyaWFibGU6IE1lcmdlIHZhcmlhYmxlIGhlYWRlciArIGRhdGEgdXBkYXRlIGludG8gb25lIHN0ZXA=?= Date: Fri, 17 Nov 2023 08:43:44 +0800 Message-ID: <000601da18ef$1e996270$5bcc2750$@byosoft.com.cn> MIME-Version: 1.0 Thread-Index: AQJDfvTp//AeBym1NjD0ZYoWOUfU9q+q4Cog Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,gaoliming@byosoft.com.cn List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: NFbUivPOD8BYY92KmnBaMRyyx7686176AA= Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: quoted-printable Content-Language: zh-cn X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=Q2jsZTPk; dmarc=none; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io Cheng: I think this change is fine. Reviewed-by: Liming Gao Thanks Liming > -----=D3=CA=BC=FE=D4=AD=BC=FE----- > =B7=A2=BC=FE=C8=CB: devel@edk2.groups.io =B4=FA=B1= =ED Gao > =B7=A2=CB=CD=CA=B1=BC=E4: 2023=C4=EA11=D4=C214=C8=D5 16:24 > =CA=D5=BC=FE=C8=CB: devel@edk2.groups.io > =B3=AD=CB=CD: Gao Cheng ; Liming Gao > ; Ray Ni > =D6=F7=CC=E2: [edk2-devel] [PATCH] MdeModulePkg/Variable: Merge variable = header > + data update into one step >=20 > REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D4597 >=20 > When creating a new variable, skip marking VAR_HEADER_VALID_ONLY so > that > variable header + data update can be merged into one flash write. This > will greatly reduce the time taken for updating a variable and thus > increase performance. Removing VAR_HEADER_VALID_ONLY marking doesn't > have any function impact since it's not used by current code to detect > variable header + data corruption. >=20 > Cc: Liming Gao > Cc: Ray Ni > Signed-off-by: Gao Cheng > --- > .../Universal/Variable/RuntimeDxe/Variable.c | 45 ++----------------- > 1 file changed, 4 insertions(+), 41 deletions(-) >=20 > diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c > b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c > index 7a1331255b..3c360481f4 100644 > --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c > +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c > @@ -2168,11 +2168,9 @@ UpdateVariable ( >=20 > if (!mVariableModuleGlobal->VariableGlobal.EmuNvMode) { > // > - // Four steps > - // 1. Write variable header > - // 2. Set variable state to header valid > - // 3. Write variable data > - // 4. Set variable state to valid > + // Two steps > + // 1. Write variable header and data > + // 2. Set variable state to valid > // > // > // Step 1: > @@ -2183,7 +2181,7 @@ UpdateVariable ( > TRUE, > Fvb, >=20 > mVariableModuleGlobal->NonVolatileLastVariableOffset, > - (UINT32)GetVariableHeaderSize (AuthFormat), > + (UINT32)VarSize, > (UINT8 *)NextVariable > ); >=20 > @@ -2194,41 +2192,6 @@ UpdateVariable ( > // > // Step 2: > // > - NextVariable->State =3D VAR_HEADER_VALID_ONLY; > - Status =3D UpdateVariableStore ( > - > &mVariableModuleGlobal->VariableGlobal, > - FALSE, > - TRUE, > - Fvb, > - > mVariableModuleGlobal->NonVolatileLastVariableOffset + OFFSET_OF > (VARIABLE_HEADER, State), > - sizeof (UINT8), > - &NextVariable->State > - ); > - > - if (EFI_ERROR (Status)) { > - goto Done; > - } > - > - // > - // Step 3: > - // > - Status =3D UpdateVariableStore ( > - &mVariableModuleGlobal->VariableGlobal, > - FALSE, > - TRUE, > - Fvb, > - > mVariableModuleGlobal->NonVolatileLastVariableOffset + > GetVariableHeaderSize (AuthFormat), > - (UINT32)(VarSize - GetVariableHeaderSize > (AuthFormat)), > - (UINT8 *)NextVariable + GetVariableHeaderSize > (AuthFormat) > - ); > - > - if (EFI_ERROR (Status)) { > - goto Done; > - } > - > - // > - // Step 4: > - // > NextVariable->State =3D VAR_ADDED; > Status =3D UpdateVariableStore ( >=20 > &mVariableModuleGlobal->VariableGlobal, > -- > 2.42.0.windows.2 >=20 >=20 >=20 >=20 >=20 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#111332): https://edk2.groups.io/g/devel/message/111332 Mute This Topic: https://groups.io/mt/102639131/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-