From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (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 2A2358046B for ; Mon, 20 Mar 2017 19:41:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=intel; t=1490064083; x=1521600083; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=r9S5VsM5zHiRC43UNLwmNchYDCa7zUIWjGPuZ26W8VU=; b=kmsxjoM1icFPJAxf9uukhAqQnFbk5lLYrIbegzOApqAH/1TxZTeY4FKy yDDilbaNCwzl9c6N1w4aLeh1GHHFFQ==; Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Mar 2017 19:41:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,197,1486454400"; d="scan'208";a="238508309" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga004.fm.intel.com with ESMTP; 20 Mar 2017 19:41:22 -0700 Received: from fmsmsx111.amr.corp.intel.com (10.18.116.5) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 20 Mar 2017 19:41:22 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by fmsmsx111.amr.corp.intel.com (10.18.116.5) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 20 Mar 2017 19:41:22 -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:41:20 +0800 From: "Yao, Jiewen" To: "Zeng, Star" , "edk2-devel@lists.01.org" CC: Xiaofeng Wang Thread-Topic: [PATCH] MdeModulePkg CapsuleApp: Add -NR (no-reset) option support Thread-Index: AQHSoVtG/ZEGEtax70GGdcRUTGIiUKGelEfw Date: Tue, 21 Mar 2017 02:41:19 +0000 Message-ID: <74D8A39837DF1E4DA445A8C0B3885C503A9079D9@shsmsx102.ccr.corp.intel.com> References: <1490001632-35572-1-git-send-email-star.zeng@intel.com> In-Reply-To: <1490001632-35572-1-git-send-email-star.zeng@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:41:23 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable 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 ; > Xiaofeng Wang > Subject: [PATCH] MdeModulePkg CapsuleApp: Add -NR (no-reset) option > 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 reset will be trigger for the capsule with flag > CAPSULE_FLAGS_PERSIST_ACROSS_RESET and no > 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 > (EFI_CAPSULE_REPORT_GUID),\n"); > Print(L" which is defined in UEFI specification.\n"); > Print(L" -C: Clear capsule report variable > (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 @@ 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 gRT->UpdateCapsule() > calling above. > + // > + // For capsule with flag CAPSULE_FLAGS_PERSIST_ACROSS_RESET but 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 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 Servic= e > without a > -- > 2.7.0.windows.1