From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (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 1E2708046D for ; Mon, 20 Mar 2017 19:58:15 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga105.jf.intel.com with ESMTP; 20 Mar 2017 19:58:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,197,1486454400"; d="scan'208";a="62952918" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by orsmga002.jf.intel.com with ESMTP; 20 Mar 2017 19:58:13 -0700 Received: from fmsmsx151.amr.corp.intel.com (10.18.125.4) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 20 Mar 2017 19:57:59 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by FMSMSX151.amr.corp.intel.com (10.18.125.4) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 20 Mar 2017 19:57:52 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.88]) by SHSMSX103.ccr.corp.intel.com ([10.239.4.69]) with mapi id 14.03.0248.002; Tue, 21 Mar 2017 10:57:15 +0800 From: "Zeng, Star" To: "Yao, Jiewen" , "edk2-devel@lists.01.org" CC: Xiaofeng Wang , "Zeng, Star" Thread-Topic: [PATCH] MdeModulePkg CapsuleApp: Add -NR (no-reset) option support Thread-Index: AQHSoVtGiO6WoAzAsEyE0r03osoDXqGeEGqAgACKXkA= Date: Tue, 21 Mar 2017 02:57:15 +0000 Message-ID: <0C09AFA07DD0434D9E2A0C6AEB0483103B836647@shsmsx102.ccr.corp.intel.com> References: <1490001632-35572-1-git-send-email-star.zeng@intel.com> <74D8A39837DF1E4DA445A8C0B3885C503A9079D9@shsmsx102.ccr.corp.intel.com> In-Reply-To: <74D8A39837DF1E4DA445A8C0B3885C503A9079D9@shsmsx102.ccr.corp.intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH] MdeModulePkg CapsuleApp: Add -NR (no-reset) option support 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, 21 Mar 2017 02:58:15 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Yes, right. How about to like below? Print(L" -NR: No reset will be triggered for the capsule\n"); Print(L" with CAPSULE_FLAGS_PERSIST_ACROSS_RESET and without CAPSUL= E_FLAGS_INITIATE_RESET.\n"); Thanks, Star -----Original Message----- From: Yao, Jiewen=20 Sent: Tuesday, March 21, 2017 10:41 AM To: Zeng, Star ; edk2-devel@lists.01.org Cc: Xiaofeng Wang Subject: RE: [PATCH] MdeModulePkg CapsuleApp: Add -NR (no-reset) option sup= port I feel a little confused on "but no CAPSULE_FLAGS_INITIATE_RESET". > + Print(L" -NR: No reset will be trigger for the capsule with flag\n"); > + Print(L" CAPSULE_FLAGS_PERSIST_ACROSS_RESET but no CAPSULE_FLAGS= _INITIATE_RESET.\n"); Do you mean "No impact to CAPSULE_FLAGS_INITIATE_RESET", because this flag = is consumed by Capsule driver, but not this APP? If so, we can update the help info to make it clear? > + Print(L" -NR: No reset will be trigger for the capsule with CAPSULE_F= LAGS_PERSIST_ACROSS_RESET.\n"); > + Print(L" -NR has no impact for the capsule with CAPSULE_FLAGS_INI= TIATE_RESET.\n"); > -----Original Message----- > From: Zeng, Star > Sent: Monday, March 20, 2017 5:21 PM > To: edk2-devel@lists.01.org > Cc: Zeng, Star ; Yao, Jiewen=20 > ; Xiaofeng Wang > Subject: [PATCH] MdeModulePkg CapsuleApp: Add -NR (no-reset) option=20 > support >=20 > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D388 >=20 > Add -NR (no-reset) option support, once the option is specified, no=20 > reset will be trigger for the capsule with flag=20 > CAPSULE_FLAGS_PERSIST_ACROSS_RESET and no=20 > CAPSULE_FLAGS_INITIATE_RESET. >=20 > Cc: Jiewen Yao > Cc: Xiaofeng Wang > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Star Zeng >=20 > Note: the related discussion was at > https://lists.01.org/pipermail/edk2-devel/2017-February/007513.html. > --- > MdeModulePkg/Application/CapsuleApp/CapsuleApp.c | 28 > +++++++++++++++++++----- > 1 file changed, 23 insertions(+), 5 deletions(-) >=20 > diff --git a/MdeModulePkg/Application/CapsuleApp/CapsuleApp.c > b/MdeModulePkg/Application/CapsuleApp/CapsuleApp.c > index 84ed4d738bc4..62bc12a88afe 100644 > --- a/MdeModulePkg/Application/CapsuleApp/CapsuleApp.c > +++ b/MdeModulePkg/Application/CapsuleApp/CapsuleApp.c > @@ -670,7 +670,7 @@ PrintUsage ( > ) > { > Print(L"CapsuleApp: usage\n"); > - Print(L" CapsuleApp \n"); > + Print(L" CapsuleApp [-NR]\n"); > Print(L" CapsuleApp -S\n"); > Print(L" CapsuleApp -C\n"); > Print(L" CapsuleApp -P\n"); > @@ -680,6 +680,8 @@ PrintUsage ( > Print(L" CapsuleApp -D \n"); > Print(L" CapsuleApp -P GET -O \n"); > Print(L"Parameter:\n"); > + Print(L" -NR: No reset will be trigger for the capsule with flag\n"); > + Print(L" CAPSULE_FLAGS_PERSIST_ACROSS_RESET but no > CAPSULE_FLAGS_INITIATE_RESET.\n"); > Print(L" -S: Dump capsule report variable=20 > (EFI_CAPSULE_REPORT_GUID),\n"); > Print(L" which is defined in UEFI specification.\n"); > Print(L" -C: Clear capsule report variable=20 > (EFI_CAPSULE_RPORT_GUID),\n"); @@ -721,6 +723,7 @@ UefiMain ( > UINT64 MaxCapsuleSize; > EFI_RESET_TYPE ResetType; > BOOLEAN NeedReset; > + BOOLEAN NoReset; > CHAR16 *CapsuleName; > UINTN CapsuleNum; > UINTN Index; > @@ -783,7 +786,13 @@ UefiMain ( > return EFI_SUCCESS; > } > CapsuleFirstIndex =3D 1; > - CapsuleLastIndex =3D Argc - 1; > + NoReset =3D FALSE; > + if ((Argc > 1) && (StrCmp(Argv[Argc - 1], L"-NR") =3D=3D 0)) { > + NoReset =3D TRUE; > + CapsuleLastIndex =3D Argc - 2; > + } else { > + CapsuleLastIndex =3D Argc - 1; > + } > CapsuleNum =3D CapsuleLastIndex - CapsuleFirstIndex + 1; >=20 > if (CapsuleFirstIndex > CapsuleLastIndex) { @@ -855,10 +864,19 @@=20 > UefiMain ( > goto Done; > } > // > - // For capsule who has reset flag, after calling UpdateCapsule servi= ce,triger > a > - // system reset to process capsule persist across a system reset. > + // For capsule with flags CAPSULE_FLAGS_PERSIST_ACROSS_RESET + > CAPSULE_FLAGS_INITIATE_RESET, > + // a system reset should have been triggered by=20 > + gRT->UpdateCapsule() > calling above. > + // > + // For capsule with flag CAPSULE_FLAGS_PERSIST_ACROSS_RESET but=20 > + no > CAPSULE_FLAGS_INITIATE_RESET, > + // check if -NR (no-reset) has been specified or not. > // > - gRT->ResetSystem (ResetType, EFI_SUCCESS, 0, NULL); > + if (!NoReset) { > + // > + // For capsule who has reset flag and no -NR (no-reset) has=20 > + been > specified, after calling UpdateCapsule service, > + // trigger a system reset to process capsule persist across a syst= em reset. > + // > + gRT->ResetSystem (ResetType, EFI_SUCCESS, 0, NULL); > + } > } else { > // > // For capsule who has no reset flag, only call UpdateCapsule=20 > Service without a > -- > 2.7.0.windows.1